Skip to content

Instantly share code, notes, and snippets.

@robap
Created November 6, 2011 14:33
Show Gist options
  • Save robap/1342960 to your computer and use it in GitHub Desktop.
Save robap/1342960 to your computer and use it in GitHub Desktop.
Even more wrong php class autoload
<?php
function __autoload( $class_name )
{
$file = $class_name . '.php';
$dirs = array( 'lib1/', 'lib2/');
foreach( $dirs as $dir )
{
if( file_exists($dir . $file) )
{
require_once $dir . $file;
return;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment