getInstalledModules() private method

private getInstalledModules ( ContainerBuilder $container ) : array
$container Symfony\Component\DependencyInjection\ContainerBuilder
return array
Beispiel #1
0
$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.');
Beispiel #2
0
 /**
  * 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);
 }
Beispiel #3
0
 /**
  * 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;
 }