Commit 76fdae8a authored by Alex Ne's avatar Alex Ne

rename autoload

parent f563339c
<?php
if (!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
spl_autoload_register(
function ($className)
{
$className = str_replace("\\", "_", $className);
$classPath = explode('_', $className);
if ( array_shift( $classPath ) != 'X') return;
if ( ctype_digit( end( $classPath ) ) ) $V = "_" . array_pop($classPath); else $V = ""; // Version Control
$filePath = dirname(__FILE__) . DS . implode(DS, $classPath) . $V . '.php';
if ( count($classPath) == 0 ) $classPath[] = "X";
if ( file_exists($filePath) ) require_once($filePath);
}
);
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment