title: Issue loading config file array within MVC/OOP structured PHP
body: <p>I am creating a basic MVC structured CMS in PHP as a means to learn how MVC works (thus the reason I am not using a true prebuilt engine). I have a basic version working and am currently trying to shift information over to a config file like so:</p>
  
  <p><strong>config.php</strong></p>
  
  <pre><code> &lt;?php
      return array(
          //  MySQL database details
          'database' =&gt; array(
              'host' =&gt; 'localhost',
              'port' =&gt; '',
              'username' =&gt; '',
              'password' =&gt; '',
              'name' =&gt; '',
              'collation' =&gt; 'utf8_bin'
          ),
  
          // Application settings
          'application' =&gt; array(
              // url paths
              'default_controller' =&gt; 'index',
              'default_action' =&gt; 'index',
              'timezone' =&gt; 'UTC',
          ),
  
          // Session details
          'session' =&gt; array(
              'name' =&gt; '',
              'expire' =&gt; 3600,
              'path' =&gt; '/',
              'domain' =&gt; ''
          ),
  
          // Error handling
          'error' =&gt; array(
              'ignore' =&gt; array(E_NOTICE, E_USER_NOTICE, E_DEPRECATED, E_USER_DEPRECATED),
              'detail' =&gt; false,
              'log' =&gt; false
          )
      );
  </code></pre>
  
  <p>I am including it in the index.php file like this:</p>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>define ('__SITE_PATH', $site_path);
  $config = include __SITE_PATH . '/config.php';
  </code></pre>
  
  <p>However, when I try to load it later in a template file for testing, or any other file for that matter nothing is returned. Is this an issue with classes? If anyone could shed some light on the matter I'd be very appreciative. </p>
  
  <p>Here is the full index.php for more reference:</p>
  
  <pre><code>&lt;?php
  
      /*** error reporting on ***/
      error_reporting(E_ALL);
  
      /*** define the site path ***/
      $site_path = realpath(dirname(__FILE__));
      define ('__SITE_PATH', $site_path);
  
      $config = include __SITE_PATH . '/config.php';
  
      /*** include the controller class ***/
      include __SITE_PATH . '/application/' . 'controller_base.class.php';
  
      /*** include the registry class ***/
      include __SITE_PATH . '/application/' . 'registry.class.php';
  
      /*** include the router class ***/
      include __SITE_PATH . '/application/' . 'router.class.php';
  
      /*** include the template class ***/
      include __SITE_PATH . '/application/' . 'template.class.php';
  
      /*** auto load model classes ***/
      function __autoload($class_name) {
          $filename = strtolower($class_name) . '.class.php';
          $file = __SITE_PATH . '/model/' . $filename;
          if (file_exists($file) == false) {
              return false;
          }
          include ($file);
      }
  
      /*** a new registry object ***/
      $registry = new registry;
  
      /*** load the router ***/
      $registry-&gt;router = new router($registry);
  
      /*** set the controller path ***/
      $registry-&gt;router-&gt;setPath (__SITE_PATH . '/controller');
  
      /*** load up the template ***/
      $registry-&gt;template = new template($registry);
  
      /*** load the controller ***/
      $registry-&gt;router-&gt;loader();
  </code></pre>