+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
* Component stores all the static and dynamic information of the various
* CiviCRM components
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
$cr->find(FALSE);
while ($cr->fetch()) {
$infoClass = $cr->namespace . '_' . self::COMPONENT_INFO_CLASS;
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $infoClass) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $infoClass) . '.php';
$infoObject = new $infoClass($cr->name, $cr->namespace, $cr->id);
if ($infoObject->info['name'] !== $cr->name) {
CRM_Core_Error::fatal("There is a discrepancy between name in component registry and in info file ({$cr->name}).");
return $_cache;
}
+ /**
+ * @return array
+ * Array(string $name => int $id).
+ */
+ public static function &getComponentIDs() {
+ $componentIDs = array();
+
+ $cr = new CRM_Core_DAO_Component();
+ $cr->find(FALSE);
+ while ($cr->fetch()) {
+ $componentIDs[$cr->name] = $cr->id;
+ }
+
+ return $componentIDs;
+ }
+
+
/**
* @param bool $force
*
/**
* @param $config
* @param bool $oldMode
+ *
+ * @return null
*/
public static function addConfig(&$config, $oldMode = FALSE) {
$info = self::_info();
$cfg = $comp->getConfigObject();
$cfg->add($config, $oldMode);
}
- return;
+ return NULL;
}
/**
$fields = array();
foreach ($info as $name => $comp) {
if ($comp->usesSearch()) {
- $bqr = $comp->getBAOQueryObject();
- $flds = $bqr->getFields();
+ $bqr = $comp->getBAOQueryObject();
+ $flds = $bqr->getFields();
$fields = array_merge($fields, $flds);
}
}
*
* @return null
*/
- static function &defaultReturnProperties($mode,
+ public static function &defaultReturnProperties(
+ $mode,
$includeCustomFields = TRUE
) {
$info = self::_info();
}
/**
- * Handle table dependencies of components
+ * Handle table dependencies of components.
*
- * @param array $tables array of tables
+ * @param array $tables
+ * Array of tables.
*
- * @return null
- * @static
*/
public static function tableNames(&$tables) {
$info = self::_info();
}
/**
- * Get components info from info file
- *
+ * Get components info from info file.
*/
public static function getComponentsFromFile($crmFolderDir) {
$components = array();
$infoFile = $crmFolderDir . "/{$subDir}/" . self::COMPONENT_INFO_CLASS . '.php';
if (file_exists($infoFile)) {
$infoClass = 'CRM_' . $subDir . '_' . self::COMPONENT_INFO_CLASS;
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $infoClass) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $infoClass) . '.php';
$infoObject = new $infoClass(NULL, NULL, NULL);
$components[$infoObject->info['name']] = $infoObject;
unset($infoObject);
return $components;
}
+
}