Code refactoring, #16

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@114 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
pzinovkin
2010-02-26 14:49:12 +00:00
parent 10075f88ab
commit 1b422d87ba
26 changed files with 688 additions and 1310 deletions

37
Load.php Normal file
View File

@ -0,0 +1,37 @@
<?php
/**
* @copyright NetMonsters <team@netmonsters.ru>
* @link http://netmonsters.ru
* @package Majestic
* @subpackage Load
* @since 2010-02-24
* @version SVN: $Id$
* @filesource $URL$
*/
class Load
{
static protected $autoload;
static public function autoload($class)
{
if (! isset(self::$autoload[$class])) {
throw new MJException('There is no such class "' . $class . '" in autoload.');
}
require(PATH . self::$autoload[$class]);
}
static public function setAutoloadFrom($file)
{
if (! file_exists($file)) {
throw new MJException('Autoload source doesn\'t exists! Try to generate it!');
}
self::$autoload = require($file);
}
static public function getFilePath($class)
{
return self::$autoload[$class];
}
}