added plugins support
This commit is contained in:
parent
e0f47af18b
commit
daec4cdf66
@ -99,6 +99,7 @@ class Base
|
||||
$this->setPhpConfig();
|
||||
$this->_load_files();
|
||||
$this->_load_active_record();
|
||||
$this->initPlugins();
|
||||
$this->setDispatcher();
|
||||
$this->init();
|
||||
$this->runInitializers();
|
||||
@ -199,6 +200,17 @@ class Base
|
||||
{
|
||||
}
|
||||
|
||||
private function initPlugins()
|
||||
{
|
||||
if ($this->config()->plugins) {
|
||||
foreach ($this->config()->plugins->toArray() as $pluginName) {
|
||||
$initClassName = $pluginName . '\Initializer';
|
||||
$initializer = new $initClassName();
|
||||
$initializer->initialize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function _load_controller()
|
||||
{
|
||||
$route = $this->dispatcher()->router()->route();
|
||||
|
@ -434,9 +434,9 @@ final class Rails
|
||||
$autoloadFile = defined("COMPOSER_AUTOLOAD_FILE") ?
|
||||
COMPOSER_AUTOLOAD_FILE :
|
||||
Rails::path() . '/../../../autoload.php';
|
||||
// self::$loader->setComposerAutoload(require $autoloadFile);
|
||||
$loader = require $autoloadFile;
|
||||
vpe($loader->getPrefixes());
|
||||
self::$loader->setComposerAutoload(require $autoloadFile);
|
||||
// $loader = require $autoloadFile;
|
||||
// vpe($loader->getPrefixes());
|
||||
spl_autoload_register([Rails::loader(), 'loadClass']);
|
||||
|
||||
set_exception_handler('Rails::exceptionHandler');
|
||||
|
Reference in New Issue
Block a user