? .
.
auto_prepend_file ( )
class Import
{
public static $_AutoLoad = array();
public static $_Imported = array();
public static function Load($sName)
{
if(! isset(self::$_AutoLoad[$sName]))
throw new ImportError("Cannot import module with name '$sName'.");
if(! isset(self::$_Imported[$sName]))
{
self::$_Imported[$sName] = True;
require(self::$_AutoLoad[$sName]);
}
}
public static function Push($sName, $sPath)
{
self::$_AutoLoad[$sName] = $sPath;
}
public static function Auto()
{
function __autoload($sClass)
{
Import::Load($sClass);
}
}
}
.
Import::Push('Admin_Layout', App::$Path . '/PHP/Admin_Layout.php');
Import::Push('Admin_Layout_Dialog', App::$Path . '/PHP/Admin_Layout.php');
Import::Push('FileClient', App::$Path . '/PHP/FileClient.php');
, , AutoLoad,
Import::Auto()
, "":
Import::Push('MyModule', App::$Path . '/Module/MyModule/Init.php');
:
Import::Load('MyModule');
- Import::Push , .