Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (29 sloc) 988 Bytes
<?php
clearstatcache();
set_include_path(__DIR__ . PATH_SEPARATOR . __DIR__ . "/Syndetic" . PATH_SEPARATOR . __DIR__ . "/lib" . PATH_SEPARATOR . __DIR__ . "/lib/assetic/src" . PATH_SEPARATOR . __DIR__ . "/lib/assetic/src/Assetic");
spl_autoload_register(
function($className)
{
// Let's not load Functions
if(!strpos($className, "\\")) {
return;
}
$className = str_replace("_", "\\", $className);
$className = ltrim($className, '\\');
$fileName = '';
$namespace = '';
if ($lastNsPos = strripos($className, '\\'))
{
$namespace = substr($className, 0, $lastNsPos);
$className = substr($className, $lastNsPos + 1);
$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
}
$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
if(!class_exists($className)) {
// if(file_exists($fileName)) {
include_once($fileName);
// }
}
}
);
?>