Ejemplo n.º 1
0
 function _GetCache()
 {
     return \Bitrix\Main\ModuleManager::getInstalledModules();
 }
Ejemplo n.º 2
0
 /**
  * Gets console commands from modules.
  *
  * @return Command[]
  *
  * @throws \Bitrix\Main\LoaderException
  */
 protected function getModulesCommands()
 {
     $commands = [];
     foreach (ModuleManager::getInstalledModules() as $module) {
         $cliFile = getLocalPath('modules/' . $module['ID'] . '/cli.php');
         if ($cliFile === false) {
             continue;
         } elseif (!Loader::includeModule($module['ID'])) {
             continue;
         }
         $config = (include_once $this->getDocumentRoot() . $cliFile);
         if (isset($config['commands']) && is_array($config['commands'])) {
             $commands = array_merge($commands, $config['commands']);
         }
     }
     return $commands;
 }