Exemplo n.º 1
0
 /**
  * Replicates module_list($refresh, $bootstrap_refresh, $sort, NULL)
  *
  * @see module_list()
  *
  * @param bool $refresh
  * @param bool $bootstrap_refresh
  * @param bool $sort
  *
  * @return string[]
  */
 function moduleList($refresh = FALSE, $bootstrap_refresh = FALSE, $sort = FALSE)
 {
     if (empty($this->list) || $refresh) {
         $this->list = array();
         $sorted_list = NULL;
         if ($refresh) {
             // For the $refresh case, make sure that system_list() returns fresh
             // data.
             $this->drupalStatic->resetKey('system_list');
         }
         if ($bootstrap_refresh) {
             $this->list = $this->systemList->systemListBootstrap();
         } else {
             // Not using drupal_map_assoc() here as that requires common.inc.
             $this->list = array_keys($this->systemList->systemListModuleEnabled());
             $this->list = !empty($this->list) ? array_combine($this->list, $this->list) : array();
         }
     }
     if ($sort) {
         return $this->moduleListSorted();
     }
     if (count($this->list)) {
         # HackyLog::log($this->list);
     }
     return $this->list;
 }