spl_autoload_register issue while loading class
So I already asked this question here earlier, but the solutions provided didn't work for me. Here's my setup: /mylib /Vendor/Module/MyClass.php /document_root index.php Here's my index.php <?php define('CLASSDIR', 'mylib'); define('BASEPATH', @realpath( dirname (__FILE__).'/../').'/'.CLASSDIR); spl_autoload_register(null, false); spl_autoload_extensions('.php'); function autoLoader($className){ $className = ltrim($className, '\\'); $fileName = ''; $namespace = ''; if ($lastNsPos = strrpos($className, '\\')) { echo 'does it come here? nope.'; $namespace = substr($className, 0, $lastNsPos);