コード例 #1
0
 /**
  * gets the module list
  * @param boolean $restrictedList true if we only wants the installed modules.
  * @return array
  */
 function getList($restrictedList = true)
 {
     $toReturn = array();
     if ($restrictedList === false) {
         $dir = opendir(COPIX_MODULE_PATH);
         while (false !== ($file = readdir($dir))) {
             $complete = COPIX_MODULE_PATH . $file;
             if (CopixModule::isValid($file)) {
                 $toReturn[] = $file;
             }
         }
         closedir($dir);
         clearstatcache();
     } else {
         $cacheFile = CopixModule::_getCompiledFileName();
         if (is_readable($cacheFile)) {
             include $cacheFile;
             $toReturn = $arModules;
         } else {
             CopixModule::_loadPHPCacheFromDatabase();
             if (is_readable($cacheFile)) {
                 include $cacheFile;
                 $toReturn = $arModules;
             }
         }
     }
     return $toReturn;
 }