本文整理匯總了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();
}
}
}