title: PHP Autoload classes with directories?
body: <p>This is my current autoLoader:</p>
  
  <pre><code>function classAutoLoad($class) {
      if (file_exists($_SERVER['DOCUMENT_ROOT']."/framework/includes/class/$class.class.php"))
          include($_SERVER['DOCUMENT_ROOT']."/framework/includes/class/".$class.".class.php");
  }
  
  spl_autoload_register('classAutoload');
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>$class = new Classname;
  </code></pre>
  
  <p>Basically it will load all classes inside /class/, not including directories.
  What I am trying to do is, be more clean.</p>
  
  <p>I have a lot of classes, and I want to package them into directories.</p>
  
  <p><strong>How can I enable support for packages here? Or is there a popular library for this?</strong></p>