Пример #1
0
 /**
  * Installs modules.
  *
  * @return \ICanBoogie\Errors
  */
 protected function process_modules()
 {
     global $core;
     $modules = $core->modules;
     $modules->index;
     $ids = array();
     $errors = new Errors();
     $is_installed_errors = new Errors();
     foreach ($modules->descriptors as $id => $descriptor) {
         $ids[] = $id;
         $modules->enable($id);
     }
     $core();
     foreach ($modules->descriptors as $id => $descriptor) {
         $module = $modules[$id];
         $is_installed_errors->clear();
         if (!$module->is_installed($is_installed_errors)) {
             $module->install($errors);
         }
     }
     $core->vars['enabled_modules'] = $ids;
     \Icybee\Modules\Nodes\Module::create_default_routes();
     return $errors;
 }
Пример #2
0
 public static function on_modules_deactivate(Event $event)
 {
     \Icybee\Modules\Nodes\Module::create_default_routes();
 }