本文整理汇总了PHP中CRM_Logging_Schema::disableLogging方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Logging_Schema::disableLogging方法的具体用法?PHP CRM_Logging_Schema::disableLogging怎么用?PHP CRM_Logging_Schema::disableLogging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Logging_Schema
的用法示例。
在下文中一共展示了CRM_Logging_Schema::disableLogging方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMultilingualAlterSchemaLogging
/**
* Test creating logging schema when database is in multilingual mode.
* Also test altering a multilingual table.
*/
public function testMultilingualAlterSchemaLogging()
{
CRM_Core_I18n_Schema::makeMultilingual('en_US');
$logging = new CRM_Logging_Schema();
$logging->enableLogging();
$value = CRM_Core_DAO::singleValueQuery("SELECT id FROM log_civicrm_contact LIMIT 1", array(), FALSE, FALSE);
$this->assertNotNull($value, 'Logging not enabled successfully');
$logging->disableLogging();
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_option_value` ADD COLUMN `logging_test` INT DEFAULT NULL", array(), FALSE, NULL, FALSE, TRUE);
CRM_Core_I18n_Schema::rebuildMultilingualSchema(array('en_US'));
$logging->enableLogging();
$query = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE `log_civicrm_option_value`", array(), TRUE, NULL, FALSE, FALSE);
$query->fetch();
$create = explode("\n", $query->Create_Table);
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_option_value` DROP COLUMN `logging_test`", array(), FALSE, NULL, FALSE, TRUE);
$this->assertTrue(in_array(" `logging_test` int(11) DEFAULT NULL", $create));
$logging->disableLogging();
}
示例2: postProcess
public function postProcess()
{
parent::postProcess();
// handle logging
// FIXME: do it only if the setting changed
require_once 'CRM/Logging/Schema.php';
$values = $this->exportValues();
$logging = new CRM_Logging_Schema();
$values['logging'] ? $logging->enableLogging() : $logging->disableLogging();
}
示例3: onToggle
/**
* Setting Callback - On Change.
*
* Respond to changes in the "logging" setting. Set up or destroy
* triggers, etal.
*
* @param array $oldValue
* List of component names.
* @param array $newValue
* List of component names.
* @param array $metadata
* Specification of the setting (per *.settings.php).
*/
public static function onToggle($oldValue, $newValue, $metadata)
{
if ($oldValue == $newValue) {
return;
}
$logging = new CRM_Logging_Schema();
if ($newValue) {
$logging->enableLogging();
} else {
$logging->disableLogging();
}
}
示例4: postProcess
public function postProcess()
{
// store the submitted values in an array
$config = CRM_Core_Config::singleton();
$params = $this->controller->exportValues($this->_name);
// get current logging status
$values = $this->exportValues();
parent::postProcess();
if ($config->logging != $values['logging']) {
$logging = new CRM_Logging_Schema();
if ($values['logging']) {
$logging->enableLogging();
} else {
$logging->disableLogging();
}
}
}
示例5: postProcess
public function postProcess()
{
// store the submitted values in an array
$config = CRM_Core_Config::singleton();
$params = $this->controller->exportValues($this->_name);
// update upload max size in DB
$params['maxImportFileSize'] = CRM_Core_Config_Defaults::formatUnitSize(ini_get('upload_max_filesize'));
CRM_Core_BAO_ConfigSetting::create($params);
// get current logging status
$values = $this->exportValues();
parent::postProcess();
if ($config->logging != $values['logging']) {
$logging = new CRM_Logging_Schema();
if ($values['logging']) {
$logging->enableLogging();
} else {
$logging->disableLogging();
}
}
}