本文整理汇总了PHP中CRM_Utils_System::version方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_System::version方法的具体用法?PHP CRM_Utils_System::version怎么用?PHP CRM_Utils_System::version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_System
的用法示例。
在下文中一共展示了CRM_Utils_System::version方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGroupIds
/**
* Returns the group IDs corresponding to the group information returned
* by the CiviCRM API.
*
* The behaviour of the API changed in CiviCRM 4.7.11, see issue #240.
*
* @param string $api_group_result As output by the CiviCRM api for a contact
* when you request the 'group' output (which comes in a key called 'groups').
* @param array $group_details As from CRM_Mailchimp_Utils::getGroupsToSync
* but only including groups you're interested in.
* @return array CiviCRM groupIds.
*/
public static function getGroupIds($api_group_result, $group_details)
{
if (version_compare(CRM_Utils_System::version(), '4.7.11', '<')) {
return self::splitGroupTitles($api_group_result, $group_details);
}
return array_filter(explode(',', $api_group_result));
}
示例2: verifyPreDBState
function verifyPreDBState(&$errorMessage)
{
$latestVer = CRM_Utils_System::version();
$errorMessage = ts('Pre-condition failed for upgrade to %1.', array(1 => $latestVer));
// check table, if the db is 3.1
if (CRM_Core_DAO::checkTableExists('civicrm_acl_contact_cache')) {
$errorMessage = ts("Database check failed - it looks like you have already upgraded to the latest version (v%1) of the database. OR If you think this message is wrong, it is very likely that this a partially upgraded db and you will need to reload the correct db on which upgrade was never tried.", array(1 => $latestVer));
return false;
}
// check table-column, if the db is 3.1
if (CRM_Core_DAO::checkFieldExists('civicrm_custom_field', 'date_format')) {
$errorMessage = ts("Database check failed - it looks like you have already upgraded to the latest version (v%1) of the database. OR If you think this message is wrong, it is very likely that this a partially upgraded db and you will need to reload the correct db on which upgrade was never tried.", array(1 => $latestVer));
return false;
}
//check previous version table e.g 3.0.*
if (!CRM_Core_DAO::checkTableExists('civicrm_participant_status_type') || !CRM_Core_DAO::checkTableExists('civicrm_navigation')) {
$errorMessage .= ' Few important tables were found missing.';
return false;
}
// check fields which MUST be present if a proper 3.0.* db
if (!CRM_Core_DAO::checkFieldExists('civicrm_relationship_type', 'label_a_b') || !CRM_Core_DAO::checkFieldExists('civicrm_mapping_field', 'im_provider_id') || !CRM_Core_DAO::checkFieldExists('civicrm_contact', 'email_greeting_id')) {
// db looks to have stuck somewhere between 2.2 & 3.0
$errorMessage .= ' Few important fields were found missing in some of the tables.';
return false;
}
return true;
}
示例3: acquireLock
/**
* Will acquire a lock with the given name,
* if no other lock has been acquired by this process.
*
* If the same lock has been acquired before (and not been released),
* in internal counter is increased. Therefore you can acquire the same
* lock multiple times, but you will then have to release them
* the same amount of times
*
* @return a SafeLock instance or NULL if timed out
*/
public static function acquireLock($name, $timeout = 60)
{
if (self::$_acquired_lock == NULL) {
// it's free, we'll try to take it
$lock = new CRM_Core_Lock($name, $timeout);
if (version_compare(CRM_Utils_System::version(), '4.6', '>=')) {
// before 4.6, a new lock would be automatically acquired
$lock->acquire();
}
if ($lock != NULL && $lock->isAcquired()) {
// we got it!
self::$_acquired_lock = new CRM_Utils_SepaSafeLock($lock, $name);
//error_log('acquired ' . getmypid());
return self::$_acquired_lock;
} else {
// timed out
return NULL;
}
} elseif (self::$_acquired_lock->getName() == $name) {
// this means acquiring 'our' lock again:
$lock = self::$_acquired_lock;
$lock->counter += 1;
//error_log('acquired ' . getmypid() . "[{$lock->counter}]");
return $lock;
} else {
// this is the BAD case: somebody's trying to acquire ANOTHER LOCK,
// while we still own another one
$lock_name = $self::$_acquired_lock->getName();
throw new Exception("This process cannot acquire more than one lock! It still owns lock '{$lock_name}'.");
}
}
示例4: verifyPreDBState
function verifyPreDBState(&$errorMessage)
{
$latestVer = CRM_Utils_System::version();
$errorMessage = ts('Pre-condition failed for upgrade to %1.', array(1 => $latestVer));
// check table, if the db is 3.0
if (CRM_Core_DAO::checkTableExists('civicrm_navigation') && CRM_Core_DAO::checkTableExists('civicrm_participant_status_type')) {
$errorMessage = ts("Database check failed - it looks like you have already upgraded to the latest version (v%1) of the database. OR If you think this message is wrong, it is very likely that this a partially upgraded db and you will need to reload the correct db on which upgrade was never tried.", array(1 => $latestVer));
return false;
}
// check table-column, if the db is 3.0
if (CRM_Core_DAO::checkFieldExists('civicrm_menu', 'domain_id') && CRM_Core_DAO::checkFieldExists('civicrm_event', 'created_id') && CRM_Core_DAO::checkFieldExists('civicrm_event', 'is_template') && CRM_Core_DAO::checkFieldExists('civicrm_uf_field', 'is_reserved') && CRM_Core_DAO::checkFieldExists('civicrm_contact', 'email_greeting_id') && CRM_Core_DAO::checkFieldExists('civicrm_payment_processor_type', 'payment_type')) {
$errorMessage = ts("Database check failed - it looks like you have already upgraded to the latest version (v%1) of the database. OR If you think this message is wrong, it is very likely that this a partially upgraded db and you will need to reload the correct db on which upgrade was never tried.", array(1 => $latestVer));
return false;
}
//check previous version table e.g 2.2.*
if (!CRM_Core_DAO::checkTableExists('civicrm_cache') || !CRM_Core_DAO::checkTableExists('civicrm_pcp_block') || !CRM_Core_DAO::checkTableExists('civicrm_menu') || !CRM_Core_DAO::checkTableExists('civicrm_discount') || !CRM_Core_DAO::checkTableExists('civicrm_pcp') || !CRM_Core_DAO::checkTableExists('civicrm_pledge_block') || !CRM_Core_DAO::checkTableExists('civicrm_contribution_soft')) {
$errorMessage .= ' Few important tables were found missing.';
return false;
}
// check fields which MUST be present if a proper 2.2.* db
if (!CRM_Core_DAO::checkFieldExists('civicrm_activity', 'due_date_time') || !CRM_Core_DAO::checkFieldExists('civicrm_contact', 'greeting_type_id') || !CRM_Core_DAO::checkFieldExists('civicrm_contribution', 'check_number')) {
// db looks to have stuck somewhere between 2.1 & 2.2
$errorMessage .= ' Few important fields were found missing in some of the tables.';
return false;
}
return true;
}
示例5: pdf_shared_token
/**
* This hook is called once for every batch before the pdf template is rendered.
* You should use this for performance reasons when the token can be shared between chunk items (for example a contact
* address that is the same for all files)
*
* You can implement this hook to add/modify template tokens
* e.g. in your hook implementation call $template->assign('myCustomToken', 'my custom token');
* and place a token called {$myCustomToken} in the template.
*
* @param object $template
*
* @return mixed based on op. pre-hooks return a boolean or
* an error message which aborts the operation
* @access public
*/
static function pdf_shared_token(&$template, &$chunk)
{
if (version_compare(CRM_Utils_System::version(), '4.5', '<')) {
return CRM_Utils_Hook::singleton()->invoke(1, $template, $chunk_item, self::$null, self::$null, self::$null, 'civicrm_pdf_shared_token');
} else {
return CRM_Utils_Hook::singleton()->invoke(1, $template, $chunk_item, self::$null, self::$null, self::$null, self::$null, 'civicrm_pdf_shared_token');
}
}
示例6: readActiveConfig
/**
* @return array
*/
public function readActiveConfig()
{
if (!defined('CIVICRM_SETTINGS_PATH') || CIVICRM_SETTINGS_PATH !== $this->settingsFile) {
return array();
}
$paths = is_callable(array('Civi', 'paths')) ? \Civi::paths() : NULL;
$data = array('CMS_DB_DSN' => CIVICRM_UF_DSN, 'CMS_VERSION' => \CRM_Core_Config::singleton()->userSystem->getVersion(), 'CIVI_DB_DSN' => CIVICRM_DSN, 'CIVI_SITE_KEY' => CIVICRM_SITE_KEY, 'CIVI_VERSION' => \CRM_Utils_System::version(), 'CIVI_SETTINGS' => CIVICRM_SETTINGS_PATH, 'CIVI_TEMPLATEC' => \CRM_Core_Config::singleton()->templateCompileDir, 'CIVI_UF' => \CRM_Core_Config::singleton()->userFramework, 'IS_INSTALLED' => '1', 'SITE_TYPE' => 'cv-auto', 'CMS_URL' => $paths ? \Civi::paths()->getUrl('[cms.root]/', 'absolute') : \CRM_Utils_System::languageNegotiationURL(\CRM_Utils_System::baseCMSURL(), FALSE, TRUE), 'CMS_ROOT' => $paths ? \Civi::paths()->getPath('[cms.root]/.') : \CRM_Core_Config::singleton()->userSystem->cmsRootPath(), 'CIVI_CORE' => $paths ? \Civi::paths()->getPath('[civicrm.root]/.') : $GLOBALS['civicrm_root'], 'CIVI_URL' => $paths ? \Civi::paths()->getUrl('[civicrm.root]/', 'absolute') : '', 'CIVI_FILES' => $paths ? \Civi::paths()->getPath('[civicrm.root]/.') : dirname(\CRM_Core_Config::singleton()->templateCompileDir));
return $data;
}
示例7: mapAccountsData
/**
* This hook data transforms data stored in accounts_data to be formatted into a standard format.
*
* The called hook is expected to add a key 'civicrm_formatted' to the accountsData array
* with the data using the same field names as the relevant CiviCRM api.
*
* @param array $accountsData data from accounts system
* @param string $entity entity - eg. 'AccountContact'
* @param string $plugin plugin in use
*
* @return mixed
* Ignore value.
*/
public static function mapAccountsData(&$accountsData, $entity, $plugin)
{
$codeVersion = explode('.', CRM_Utils_System::version());
if (version_compare($codeVersion[0] . '.' . $codeVersion[1], 4.5) >= 0) {
return CRM_Utils_Hook::singleton()->invoke(3, $accountsData, $entity, $plugin, CRM_Core_DAO::$_nullObject, CRM_Core_DAO::$_nullObject, CRM_Core_DAO::$_nullObject, 'civicrm_mapAccountsData');
} else {
return CRM_Utils_Hook::singleton()->invoke(3, $accountsData, $entity, $plugin, CRM_Core_DAO::$_nullObject, CRM_Core_DAO::$_nullObject, 'civicrm_mapAccountsData');
}
}
示例8: add
/**
* Add civicrm settings.
*
* @param array $params
* Associated array of civicrm variables.
*
* @return void
*/
public static function add(&$params)
{
self::fixParams($params);
// also set a template url so js files can use this
// CRM-6194
$params['civiRelativeURL'] = CRM_Utils_System::url('CIVI_BASE_TEMPLATE');
$params['civiRelativeURL'] = str_replace('CIVI_BASE_TEMPLATE', '', $params['civiRelativeURL']);
// also add the version number for use by template / js etc
$params['civiVersion'] = CRM_Utils_System::version();
$domain = new CRM_Core_DAO_Domain();
$domain->id = CRM_Core_Config::domainID();
$domain->find(TRUE);
if ($domain->config_backend) {
$values = unserialize($domain->config_backend);
self::formatParams($params, $values);
}
// CRM-6151
if (isset($params['localeCustomStrings']) && is_array($params['localeCustomStrings'])) {
$domain->locale_custom_strings = serialize($params['localeCustomStrings']);
}
// unset any of the variables we read from file that should not be stored in the database
// the username and certpath are stored flat with _test and _live
// check CRM-1470
$skipVars = self::skipVars();
foreach ($skipVars as $var) {
unset($params[$var]);
}
CRM_Core_BAO_Setting::fixAndStoreDirAndURL($params);
// also skip all Dir Params, we dont need to store those in the DB!
foreach ($params as $name => $val) {
if (substr($name, -3) == 'Dir') {
unset($params[$name]);
}
}
//keep user preferred language upto date, CRM-7746
$session = CRM_Core_Session::singleton();
$lcMessages = CRM_Utils_Array::value('lcMessages', $params);
if ($lcMessages && $session->get('userID')) {
$languageLimit = CRM_Utils_Array::value('languageLimit', $params);
if (is_array($languageLimit) && !in_array($lcMessages, array_keys($languageLimit))) {
$lcMessages = $session->get('lcMessages');
}
$ufm = new CRM_Core_DAO_UFMatch();
$ufm->contact_id = $session->get('userID');
if ($lcMessages && $ufm->find(TRUE)) {
$ufm->language = $lcMessages;
$ufm->save();
$session->set('lcMessages', $lcMessages);
$params['lcMessages'] = $lcMessages;
}
}
$domain->config_backend = serialize($params);
$domain->save();
}
示例9: smarty_function_crmVersion
/**
* Display the CiviCRM version
*
* @code
* The version is {crmVersion}.
*
* {crmVersion redact=auto assign=ver}The version is {$ver}.
* @endcode
*
* @param $params
* @param $smarty
*
* @return string
*/
function smarty_function_crmVersion($params, &$smarty)
{
$version = CRM_Utils_System::version();
if (!CRM_Core_Permission::check('access CiviCRM')) {
$version = CRM_Utils_System::majorVersion();
}
if (isset($params['assign'])) {
$smarty->assign($params['assign'], $version);
} else {
return $version;
}
}
示例10: __construct
/**
* Construct the basic widget object.
*/
public function __construct()
{
// Widget actual processes.
parent::__construct('civicontribute-widget', __('CiviCRM Contribution Page Widget', 'civicontribute-widget'), array('description' => __('Displays contribution page widgets from CiviContribute as native WordPress widgets.', 'civicontribute-widget')));
if (!function_exists('civicrm_initialize')) {
return;
}
civicrm_initialize();
require_once 'CRM/Utils/System.php';
$this->_civiversion = CRM_Utils_System::version();
$this->_civiBasePage = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'wpBasePage');
}
示例11:
/**
* Static instance provider.
*
* Method providing static instance of SmartTemplate, as
* in Singleton pattern.
*/
public static function &singleton()
{
if (version_compare(CRM_Utils_System::version(), '4.6', '<')) {
// < 4.6: we need to create a wrapper
$smarty = CRM_Core_Smarty::singleton();
$smarty_wrapper = new CRM_Banking_Helpers_Smarty($smarty);
return $smarty_wrapper;
} else {
// >= 4.6: just use the core smarty implementation
return CRM_Core_Smarty::singleton();
}
}
示例12: registerResources
/**
* Register resources required by Angular.
*/
public function registerResources($region = 'html-header', $includeExtras = true)
{
$modules = $this->angular->getModules();
$page = $this;
// PHP 5.3 does not propagate $this to inner functions.
$page->res->addSettingsFactory(function () use(&$modules, $page) {
// TODO optimization; client-side caching
return array_merge($page->angular->getResources(array_keys($modules), 'settings', 'settings'), array('resourceUrls' => \CRM_Extension_System::singleton()->getMapper()->getActiveModuleUrls(), 'angular' => array('modules' => array_merge(array('ngRoute'), array_keys($modules)), 'cacheCode' => $page->res->getCacheCode())));
});
$page->res->addScriptFile('civicrm', 'bower_components/angular/angular.min.js', -100, $region, FALSE);
if ($includeExtras) {
//Civi vs 4.7 and above has reworked how wysiwyg works and we don't
//have to side load ckeditor anymore
$version = substr(CRM_Utils_System::version(), 0, 3);
if ($version <= 4.6) {
//crmUi depends on loading ckeditor, but ckeditor doesn't work properly with aggregation.
//Add a basepath so that CKEditor works when Drupal (or other extension/cms) does the aggregation
$basePath = $page->res->getUrl("civicrm") . "packages/ckeditor/";
$page->res->addScript("window.CKEDITOR_BASEPATH = '{$basePath}';", 119, $region, FALSE);
$page->res->addScriptFile('civicrm', 'packages/ckeditor/ckeditor.js', 120, $region, FALSE);
}
//Add jquery Notify
$page->res->addScriptFile('civicrm', 'packages/jquery/plugins/jquery.notify.min.js', 10, $region, FALSE);
$page->assign("includeNotificationTemplate", true);
}
$headOffset = 1;
$config = \CRM_Core_Config::singleton();
if ($config->debug) {
foreach ($modules as $moduleName => $module) {
foreach ($page->angular->getResources($moduleName, 'css', 'cacheUrl') as $url) {
$page->res->addStyleUrl($url, self::DEFAULT_MODULE_WEIGHT + ++$headOffset, $region);
}
foreach ($page->angular->getResources($moduleName, 'js', 'cacheUrl') as $url) {
$page->res->addScriptUrl($url, self::DEFAULT_MODULE_WEIGHT + ++$headOffset, $region);
// addScriptUrl() bypasses the normal string-localization of addScriptFile(),
// but that's OK because all Angular strings (JS+HTML) will load via crmResource.
}
}
} else {
// Note: addScriptUrl() bypasses the normal string-localization of addScriptFile(),
// but that's OK because all Angular strings (JS+HTML) will load via crmResource.
$aggScriptUrl = \CRM_Utils_System::url('civicrm/ajax/volunteer-angular-modules', 'format=js&r=' . $page->res->getCacheCode(), FALSE, NULL, FALSE);
$page->res->addScriptUrl($aggScriptUrl, 1, $region);
// FIXME: The following CSS aggregator doesn't currently handle path-adjustments - which can break icons.
//$aggStyleUrl = \CRM_Utils_System::url('civicrm/ajax/angular-modules', 'format=css&r=' . $page->res->getCacheCode(), FALSE, NULL, FALSE);
//$page->res->addStyleUrl($aggStyleUrl, 1, $region);
foreach ($page->angular->getResources(array_keys($modules), 'css', 'cacheUrl') as $url) {
$page->res->addStyleUrl($url, self::DEFAULT_MODULE_WEIGHT + ++$headOffset, $region);
}
}
}
示例13: smarty_function_crmVersion
/**
* Display the CiviCRM version
*
* @code
* The version is {crmVersion}.
*
* {crmVersion redact=auto assign=ver}The version is {$ver}.
* @endcode
*
* @param $params
* @param $smarty
*
* @return string
*/
function smarty_function_crmVersion($params, &$smarty)
{
$version = CRM_Utils_System::version();
$redact = !CRM_Core_Permission::check('access CiviCRM');
if ($redact) {
$parts = explode('.', $version);
$version = $parts[0] . '.' . $parts[1] . '.x';
}
if (isset($params['assign'])) {
$smarty->assign($params['assign'], $version);
} else {
return $version;
}
}
示例14: verifyPreDBState
function verifyPreDBState(&$errorMessage)
{
$latestVer = CRM_Utils_System::version();
$errorMessage = ts('Pre-condition failed for upgrade to %1.', array(1 => $latestVer));
// check tables and table-columns, if the db is already 3.1
if (CRM_Core_DAO::checkTableExists('civicrm_acl_contact_cache') || CRM_Core_DAO::checkTableExists('civicrm_contact_type') || CRM_Core_DAO::checkTableExists('civicrm_dashboard') || CRM_Core_DAO::checkTableExists('civicrm_dashboard_contact') || CRM_Core_DAO::checkFieldExists('civicrm_country', 'is_province_abbreviated') || CRM_Core_DAO::checkFieldExists('civicrm_custom_field', 'date_format') || CRM_Core_DAO::checkFieldExists('civicrm_custom_field', 'time_format') || CRM_Core_DAO::checkFieldExists('civicrm_mail_settings', 'domain_id') || CRM_Core_DAO::checkFieldExists('civicrm_msg_template', 'workflow_id') || CRM_Core_DAO::checkFieldExists('civicrm_msg_template', 'is_default') || CRM_Core_DAO::checkFieldExists('civicrm_msg_template', 'is_reserved') || CRM_Core_DAO::checkFieldExists('civicrm_option_value', 'domain_id') || CRM_Core_DAO::checkFieldExists('civicrm_preferences', 'contact_autocomplete_options') || CRM_Core_DAO::checkFieldExists('civicrm_preferences_date', 'date_format') || CRM_Core_DAO::checkFieldExists('civicrm_preferences_date', 'time_format') || CRM_Core_DAO::checkFieldExists('civicrm_price_set', 'domain_id') || CRM_Core_DAO::checkFieldExists('civicrm_price_set', 'extends') || CRM_Core_DAO::checkFieldExists('civicrm_relationship_type', 'contact_sub_type_a') || CRM_Core_DAO::checkFieldExists('civicrm_relationship_type', 'contact_sub_type_b') || CRM_Core_DAO::checkFieldExists('civicrm_report_instance', 'domain_id')) {
$errorMessage = ts("Database check failed - it looks like you have already upgraded to the latest version (v%1) of the database. OR If you think this message is wrong, it is very likely that this a partially upgraded database and you will need to reload the correct database from backup on which upgrade was never tried.", array(1 => $latestVer));
return false;
}
//check previous version tables e.g 3.0.*
if (!CRM_Core_DAO::checkTableExists('civicrm_participant_status_type') || !CRM_Core_DAO::checkTableExists('civicrm_navigation')) {
$errorMessage .= ' Few important tables were found missing.';
return false;
}
// check fields which MUST be present if a proper 3.0.* db
if (!CRM_Core_DAO::checkFieldExists('civicrm_contact', 'email_greeting_id') || !CRM_Core_DAO::checkFieldExists('civicrm_contribution_page', 'created_id') || !CRM_Core_DAO::checkFieldExists('civicrm_custom_group', 'created_date') || !CRM_Core_DAO::checkFieldExists('civicrm_event', 'is_template') || !CRM_Core_DAO::checkFieldExists('civicrm_event', 'created_id') || !CRM_Core_DAO::checkFieldExists('civicrm_mailing', 'created_date') || !CRM_Core_DAO::checkFieldExists('civicrm_mapping_field', 'im_provider_id') || !CRM_Core_DAO::checkFieldExists('civicrm_membership_type', 'domain_id') || !CRM_Core_DAO::checkFieldExists('civicrm_menu', 'domain_id') || !CRM_Core_DAO::checkFieldExists('civicrm_participant', 'fee_currency') || !CRM_Core_DAO::checkFieldExists('civicrm_payment_processor', 'domain_id') || !CRM_Core_DAO::checkFieldExists('civicrm_payment_processor_type', 'payment_type') || !CRM_Core_DAO::checkFieldExists('civicrm_preferences', 'domain_id') || !CRM_Core_DAO::checkFieldExists('civicrm_preferences', 'navigation') || !CRM_Core_DAO::checkFieldExists('civicrm_relationship_type', 'label_a_b') || !CRM_Core_DAO::checkFieldExists('civicrm_report_instance', 'navigation_id') || !CRM_Core_DAO::checkFieldExists('civicrm_uf_field', 'is_reserved') || !CRM_Core_DAO::checkFieldExists('civicrm_uf_group', 'created_id') || !CRM_Core_DAO::checkFieldExists('civicrm_uf_match', 'domain_id')) {
// db looks to have stuck somewhere between 3.0 & 3.1
$errorMessage .= ' Few important fields were found missing in some of the tables.';
return false;
}
return true;
}
示例15: tryEnable
/**
* Attempt to enable the extension on the linked CiviCRM site
*
* @return bool TRUE on success; FALSE if there's no site or if there's an error
*/
protected function tryEnable(InputInterface $input, OutputInterface $output, $key)
{
$civicrm_api3 = $this->getContainer()->get('civicrm_api3');
if ($civicrm_api3 && $civicrm_api3->local && version_compare(\CRM_Utils_System::version(), '4.3.dev', '>=')) {
$siteName = \CRM_Utils_System::baseURL();
// \CRM_Core_Config::singleton()->userSystem->cmsRootPath();
$output->writeln("<info>Refresh extension list for \"{$siteName}\"</info>");
if (!$civicrm_api3->Extension->refresh(array('local' => TRUE, 'remote' => FALSE))) {
$output->writeln("<error>Refresh error: " . $civicrm_api3->errorMsg() . "</error>");
return FALSE;
}
if ($this->confirm($input, $output, "Enable extension ({$key}) in \"{$siteName}\"? [Y/n] ")) {
$output->writeln("<info>Enable extension ({$key}) in \"{$siteName}\"</info>");
if (!$civicrm_api3->Extension->install(array('key' => $key))) {
$output->writeln("<error>Install error: " . $civicrm_api3->errorMsg() . "</error>");
}
}
return TRUE;
}
// fallback
$output->writeln("NOTE: This might be a good time to refresh the extension list and install \"{$key}\".");
return FALSE;
}