Beispiel #1
0
 /**
  * Return list of modules current module depends on
  *
  * @param \XLite\Model\Module $module Current module
  *
  * @return array
  */
 protected function getDependencyModules(\XLite\Model\Module $module)
 {
     return $module->getDependencyModules(true);
 }
 /**
  * {@inheritDoc}
  */
 public function getDependencyModules($onlyDisabled = false)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDependencyModules', array($onlyDisabled));
     return parent::getDependencyModules($onlyDisabled);
 }
 /**
  * Get list of all not active module dependencies
  * Returns false if module can not be enabled
  *
  * @param \XLite\Model\Module $module Module model
  *
  * @return array|boolean
  */
 protected function getAllDisabledModuleDependencies($module)
 {
     $list = array();
     $canEnable = true;
     foreach ($module->getDependencyModules(true) as $dep) {
         if (!$this->canEnable($dep)) {
             $canEnable = false;
             break;
         } else {
             $list[$dep->getActualName()] = $dep;
             $deps = $this->getAllDisabledModuleDependencies($dep);
             if (false === $deps) {
                 $canEnable = false;
                 break;
             } else {
                 $list = array_merge($list, $deps);
             }
         }
     }
     return $canEnable ? $list : false;
 }