コード例 #1
0
ファイル: module.php プロジェクト: Satariall/izurit
 function _GetCache()
 {
     return \Bitrix\Main\ModuleManager::getInstalledModules();
 }
コード例 #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;
 }