/** * Searches for and returnes installed extensions. * * @access private * @param boolean $fullInfo provide full info (read XML files) if true, otherwise only DB stored data * @return array list of extensions */ private function _discoverInstalled($fullInfo = FALSE) { require_once 'CRM/Core/OptionValue.php'; require_once 'CRM/Core/Extensions/Extension.php'; $result = array(); $groupParams = array('name' => self::OPTION_GROUP_NAME); $links = array(); $ov = CRM_Core_OptionValue::getRows($groupParams, $links); foreach ($ov as $id => $entry) { $ext = new CRM_Core_Extensions_Extension($entry['value'], $entry['grouping'], $entry['name'], $entry['label'], $entry['description'], $entry['is_active']); $ext->setId($id); if ($fullInfo) { $ext->readXMLInfo(); } $result[$id] = $ext; } return $result; }
/** * Searches for and returnes installed extensions. * * @access private * * @param boolean $fullInfo provide full info (read XML files) if true, otherwise only DB stored data * * @return array list of extensions */ private function _discoverInstalled($fullInfo = FALSE) { $result = array(); $dao = new CRM_Core_DAO_Extension(); $dao->find(); // TODO need bool? while ($dao->fetch()) { $ext = new CRM_Core_Extensions_Extension($dao->full_name, $dao->type, $dao->name, $dao->label, $dao->file, $dao->is_active); $ext->setInstalled(); $ext->setId((int) $dao->id); if ($fullInfo) { if ($ext->hasXMLInfo()) { $ext->readXMLInfo(); } else { $ext->setMissing(); CRM_Core_Session::setStatus(ts('The extension %1 (%2) is listed as installed, but expected files(s) including info.xml are missing. Has this site been moved to a different server location?', array(1 => $dao->label, 2 => $dao->full_name)) . '<br/>'); } } $result[(int) $dao->id] = $ext; } return $result; }