title: __DIR__ and autoloading php
body: <p>I don't know if this is exactly a problem in autoloading, but I am having this problem, here is my code:</p>
  
  <p><code>index.php</code></p>
  
  <pre><code>require __DIR__ . '/app/autoload.php';
  </code></pre>
  
  <p>Folder structure:</p>
  
  <pre><code>index.php
  app/
  --autoload.php
  </code></pre>
  
  <p><code>autoload.php</code></p>
  
  <pre><code> function autoloader($className) {
      // List Directories to Autoload Classes
      $paths = array(
          __DIR__ . '/system/',
          __DIR__ . '/app/models/',
          __DIR__ . '/app/dao/'
      );
      foreach($paths as $path) {
          $file = $path . '/' . $className . '.php';
          if (is_file($file))
              include $file;
      }
  }
  </code></pre>
  
  <p>For some reason it doesn't work even I do:</p>
  
  <pre><code>__DIR__ . '../system/
  ... et al.
  </code></pre>