示例#1
0
 /**
  * Adds the basic module data configuration
  *
  * @param App $app_record
  */
 protected function normalizeModuleConfig($app_record)
 {
     $appConnectionsModel = new ModelAppConnections();
     Filters::registerAction([Config::className(), Config::EVENT_AFTER_INSERT], [$appConnectionsModel, 'insertConnectionFromFilter'], $app_record);
     // Adds the class to the module config
     ModelConfig::addConfig(NULL, 'modules', $app_record->app_id, 'class', $app_record->className, FALSE);
     // Adds the alias to the module config
     ModelConfig::addConfig(NULL, 'aliases', NULL, $app_record->alias, $app_record->directory, FALSE);
     Filters::unRegisterAction([Config::className(), Config::EVENT_AFTER_INSERT]);
 }
 protected function executeConfig()
 {
     $appConnectionsModel = new ModelAppConnections();
     Filters::registerAction([Config::className(), Config::EVENT_AFTER_INSERT], [$appConnectionsModel, 'insertConnectionFromFilter'], $this->app);
     // Deleting manually the already assigned configs
     if ($this->preMethod == 'down') {
         $modelConfig = new ModelConfig();
         $modelConfig->deleteAppConfigItems($this->app->id);
     }
     $methodParams = NULL;
     // Declare the parameters passed into the method
     if ($this->preMethod == 'update') {
         $methodParams = $this->app->version;
     }
     call_user_func([$this->installationObject, $this->preMethod . 'Config'], $methodParams);
     Filters::unRegisterAction([Config::className(), Config::EVENT_AFTER_INSERT]);
 }