Beispiel #1
0
 /**
  * Set disabled tables list
  *
  * @param string $module     Module unique name
  * @param array  $structures Disabled structures OPTIONAL
  *
  * @return void
  */
 public function setDisabledStructures($module, array $structures = array())
 {
     if (!\Includes\Utils\ModulesManager::moveModuleToDisabledRegistry($module)) {
         $path = $this->getDisabledStructuresPath();
         $data = array();
         if (file_exists($path)) {
             $data = \XLite\Core\Operator::getInstance()->loadServiceYAML($path);
         }
         if (!$structures || !$structures['tables'] && !$structures['columns']) {
             unset($data[$module]);
         } else {
             $data[$module] = $structures;
         }
         \Includes\Utils\ModulesManager::storeModuleRegistry($path, $data);
     }
 }
Beispiel #2
0
 /**
  * Set disabled tables list
  *
  * @param string $module     Module unique name
  * @param array  $structures Disabled structures OPTIONAL
  *
  * @return void
  */
 public function setDisabledStructures($module, array $structures = array())
 {
     $remove = !$structures || !$structures['tables'] && !$structures['columns'];
     if ($remove) {
         \Includes\Utils\ModulesManager::removeModuleFromDisabledStructure($module);
     } else {
         if (!\Includes\Utils\ModulesManager::moveModuleToDisabledRegistry($module)) {
             $path = $this->getDisabledStructuresPath();
             $data = file_exists($path) ? \XLite\Core\Operator::getInstance()->loadServiceYAML($path) : array();
             $data[$module] = $structures;
             \Includes\Utils\ModulesManager::storeModuleRegistry($path, $data);
         }
     }
 }