本文整理汇总了PHP中CRM_Logging_Schema::fixSchemaDifferences方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Logging_Schema::fixSchemaDifferences方法的具体用法?PHP CRM_Logging_Schema::fixSchemaDifferences怎么用?PHP CRM_Logging_Schema::fixSchemaDifferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Logging_Schema
的用法示例。
在下文中一共展示了CRM_Logging_Schema::fixSchemaDifferences方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
/**
* Add records of the extension to the database -- and enable it
*
* @param array $keys
* List of extension keys.
* @throws CRM_Extension_Exception
*/
public function install($keys)
{
$origStatuses = $this->getStatuses();
// TODO: to mitigate the risk of crashing during installation, scan
// keys/statuses/types before doing anything
foreach ($keys as $key) {
list($info, $typeManager) = $this->_getInfoTypeHandler($key);
// throws Exception
switch ($origStatuses[$key]) {
case self::STATUS_INSTALLED:
// ok, nothing to do
break;
case self::STATUS_DISABLED:
// re-enable it
$typeManager->onPreEnable($info);
$this->_setExtensionActive($info, 1);
$typeManager->onPostEnable($info);
break;
case self::STATUS_UNINSTALLED:
// install anew
$typeManager->onPreInstall($info);
$this->_createExtensionEntry($info);
$typeManager->onPostInstall($info);
break;
case self::STATUS_UNKNOWN:
default:
throw new CRM_Extension_Exception("Cannot install or enable extension: {$key}");
}
}
$this->statuses = NULL;
$this->mapper->refresh();
CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
$schema = new CRM_Logging_Schema();
$schema->fixSchemaDifferences();
foreach ($keys as $key) {
list($info, $typeManager) = $this->_getInfoTypeHandler($key);
// throws Exception
switch ($origStatuses[$key]) {
case self::STATUS_INSTALLED:
// ok, nothing to do
break;
case self::STATUS_DISABLED:
// re-enable it
break;
case self::STATUS_UNINSTALLED:
// install anew
$typeManager->onPostPostInstall($info);
break;
case self::STATUS_UNKNOWN:
default:
throw new CRM_Extension_Exception("Cannot install or enable extension: {$key}");
}
}
}
示例2: mosaico_civicrm_uninstall
/**
* Implements hook_civicrm_uninstall().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall
*/
function mosaico_civicrm_uninstall()
{
_mosaico_civix_civicrm_uninstall();
$schema = new CRM_Logging_Schema();
$schema->fixSchemaDifferences();
}
示例3: doFinish
public static function doFinish()
{
$upgrade = new CRM_Upgrade_Form();
list($ignore, $latestVer) = $upgrade->getUpgradeVersions();
// Seems extraneous in context, but we'll preserve old behavior
$upgrade->setVersion($latestVer);
// lets rebuild the config array in case we've made a few changes in the
// code base
// this also helps us always store the latest version of civi in the DB
$params = array();
CRM_Core_BAO_ConfigSetting::add($params);
// CRM-12804 comment-51411 : add any missing settings
// at the end of upgrade
CRM_Core_BAO_Setting::updateSettingsFromMetaData();
// cleanup caches CRM-8739
$config = CRM_Core_Config::singleton();
$config->cleanupCaches(1);
// Rebuild all triggers and re-enable logging if needed
$logging = new CRM_Logging_Schema();
$logging->fixSchemaDifferences();
//CRM-16257 update Config.IDS.ini might be an old copy
CRM_Core_IDS::createConfigFile(TRUE);
}
示例4: doFinish
public static function doFinish()
{
$upgrade = new CRM_Upgrade_Form();
list($ignore, $latestVer) = $upgrade->getUpgradeVersions();
// Seems extraneous in context, but we'll preserve old behavior
$upgrade->setVersion($latestVer);
// Clear cached metadata.
Civi::service('settings_manager')->flush();
// cleanup caches CRM-8739
$config = CRM_Core_Config::singleton();
$config->cleanupCaches(1);
// Rebuild all triggers and re-enable logging if needed
$logging = new CRM_Logging_Schema();
$logging->fixSchemaDifferences();
//CRM-16257 update Config.IDS.ini might be an old copy
CRM_Core_IDS::createConfigFile(TRUE);
}