当前位置: 首页>>代码示例>>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;未经允许,请勿转载。