Пример #1
0
 public function uninstall()
 {
     if (!($module = self::getModuleByClassName($this->class))) {
         return true;
     }
     if (method_exists($module, 'uninstall')) {
         $module->uninstall($this->moduleName);
     }
     $config = ConfigManager::getWriteData();
     unset($config['modules'][$this->moduleName]);
     $config['bootstrap'] = array_diff($config['bootstrap'], [$this->moduleName]);
     ConfigManager::remove(['modules', $this->moduleName]);
     ConfigManager::put(['bootstrap' => array_unique($config['bootstrap'])]);
     self::migrate([['module-down', [$this->moduleName]]]);
 }
Пример #2
0
 public function select()
 {
     $themePath = self::$themePath . "/{$this->id}";
     $config = \app\config\ConfigManager::getWriteData();
     \app\config\ConfigManager::set(['components', 'view', 'theme'], ['pathMap' => ['@app/views' => $themePath, '@app/modules' => $themePath], 'basePath' => $themePath, 'baseUrl' => str_replace('@app', '@web', $themePath)]);
 }