Browse Source

[FIX] installation in php console - load all modules

quickform
Adam Bukowski 5 years ago
parent
commit
eb3290cb62
1 changed files with 1 additions and 44 deletions
  1. +1
    -44
      console.php

+ 1
- 44
console.php View File

@@ -15,50 +15,7 @@ use Epesi\Console\Modules\ListModulesCommand;
use Epesi\Console\Modules\DisableModuleCommand;
use Epesi\Console\Modules\EnableModuleCommand;

class ModuleLoader {
const all_modules = ':all:';

private $lpa;
private $lpa_count;
private $lpa_index = 0;
private $loaded_modules = array();
private $initialized = false;

private function init() {
if (!$this->initialized) {
$this->initialized = true;
$this->lpa = ModuleManager::get_load_priority_array();
$this->lpa_count = count($this->lpa);
ModulesAutoloader::enable();
}
}

function load($modules) {
$this->init();

if (!is_array($modules))
$modules = array($modules);

foreach ($modules as $m) {
if (array_key_exists($m, ModuleManager::$modules))
continue;

while ($this->lpa_index < $this->lpa_count) {
$row = $this->lpa[$this->lpa_index++];
$module = $row['name'];
$version = $row['version'];
ModuleManager :: include_common($module, $version);
ModuleManager :: register($module, $version, ModuleManager::$modules);
if ($m != self::all_modules && $module == $m)
break;
}
}
}

}

(new ModuleLoader())->load(array('Base_User', 'Base_User_Login', 'Base_Acl', 'Base_User_Settings'));

ModuleManager::load_modules();

$application = new Application();
$application->add(new ListModulesCommand());


Loading…
Cancel
Save