Login   Register  
PHP Classes
elePHPant
Icontem

File: demo/autoloader.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ordland Euroboros  >  PHP Collections Framework  >  demo/autoloader.php  >  Download  
File: demo/autoloader.php
Role: Auxiliary script
Content type: text/plain
Description: The Autoload File
Class: PHP Collections Framework
Manipulate collections of objects like Java and C#
Author: By
Last change:
Date: 1 year ago
Size: 340 bytes
 

Contents

Class file image Download
<?php

function __autoload($class) {
    
$stack explode('\\'$class);
    
$class array_pop($stack);
    
$namespace array_pop($stack);
    
$file strtolower("../{$namespace}/{$class}.php");
    if(
file_exists($file)) include($file);
    else throw new \
Resource\Exception\ClassNotFoundException("Cannot load class {$class}");        
}
    
?>