當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kernel::getInstalledModules方法代碼示例

本文整理匯總了PHP中Kernel::getInstalledModules方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kernel::getInstalledModules方法的具體用法?PHP Kernel::getInstalledModules怎麽用?PHP Kernel::getInstalledModules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Kernel的用法示例。


在下文中一共展示了Kernel::getInstalledModules方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

$tab_test = KernelTest::askForDependencies('core/', 'modules/dbi/', 'DBI');
$t->is($tab_test, null, 'TEST OF: Kernel::askForDependencies method for the dbi module');
$tab_test = KernelTest::askForDependencies('core/', 'modules/ihm/', 'ihm  ');
$t->is($tab_test, null, 'TEST OF: Kernel::askForDependencies method for the ihm module');
$tab_test = KernelTest::askForDependencies('mgmt/', 'modules/act/', '--act');
$t->is($tab_test, null, 'TEST OF: Kernel::askForDependencies method for the act module');
$tab_test = KernelTest::askForDependencies('mgmt/', 'modules/moderator/', 'modera()tor');
$t->is($tab_test, null, 'TEST OF: Kernel::askForDependencies method for the moderator module');
$tab_test = KernelTest::askForDependencies('mgmt/', 'modules/user/', 'use56r');
$t->is($tab_test, null, 'TEST OF: Kernel::askForDependencies method for the user module');
$tab_test = KernelTest::askForDependencies('mgmt/', 'modules/struct/', 'struct  _8');
$t->is($tab_test, null, 'TEST OF: Kernel::askForDependencies method for the struct module');
/*-------------------------------------------F20501---------------------------------------------------------*/
/*F20501-T02*/
Kernel::initialize('');
$t->is(Kernel::getInstalledModules(), null, 'TEST OF: Kernel::initialize method with wrong path.');
$t->isnt(Kernel::getErrors(), null, 'TEST OF: Getting errors after Kernel::initialize method with wrong path.');
/*--------------------------------------------F20503--------------------------------------------------------*/
/*F20503-T01*/
Kernel::buildInstalledModules();
$t->isnt(Kernel::getErrors(), null, 'TEST OF: Instanciating modules without initializing kernel and dependencies table.');
/*F20503-T02*/
Kernel::initialize(dirname(__FILE__) . '/../../apps/');
$modules = Kernel::buildInstalledModules();
$t->is(Kernel::getErrors(), null, 'TEST OF: Instanciating modules with initializing kernel but without initializing dependencies table.');
$t->is($modules, false, 'TEST OF: Instanciating modules with initializing kernel but without initializing dependencies table.');
/*F20503-T03*/
Kernel::initialize(dirname(__FILE__) . '/../../apps/');
Kernel::buildDependenciesTable();
$modules = Kernel::buildInstalledModules();
$t->is(Kernel::getErrors(), null, 'TEST OF: Instanciating modules with initializing kernel and dependencies table.');
開發者ID:xmasclaux,項目名稱:OpenGenepi,代碼行數:31,代碼來源:KernelTest.php

示例2: buildDependenciesTable

 /**
  * This method is charged to build the dependencies table of the application.
  * The dependencies table is an array, indexed by the modules names, of arrays
  * of the other modules which are necessary to the first.
  */
 public static function buildDependenciesTable()
 {
     $table = array();
     if (is_null($installed_apps = Kernel::getInstalledModules())) {
         return null;
     }
     foreach ($installed_apps as $app_path => $modules) {
         foreach ($modules as $module_name => $module_path) {
             if (!is_null($dep = self::askForDependencies($app_path, $module_path, $module_name))) {
                 $table[$module_name] = $dep;
             }
         }
     }
     parent::setDependenciesTable($table);
 }
開發者ID:xmasclaux,項目名稱:OpenGenepi,代碼行數:20,代碼來源:Kernel.class.php

示例3: isInstalled

 /**
  * This method checks whether a module is installed or not.
  * @param $module_name: a string that represents the name of the module.
  */
 public static function isInstalled($module)
 {
     $table = Kernel::getInstalledModules();
     foreach ($table as $app_name => $modules) {
         foreach ($modules as $module_name => $module_path) {
             if ($module_name == $module) {
                 return true;
             }
         }
     }
     return false;
 }
開發者ID:xmasclaux,項目名稱:OpenGenepi,代碼行數:16,代碼來源:Module.class.php


注:本文中的Kernel::getInstalledModules方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。