本文整理汇总了PHP中eZINI::removeSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP eZINI::removeSetting方法的具体用法?PHP eZINI::removeSetting怎么用?PHP eZINI::removeSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZINI
的用法示例。
在下文中一共展示了eZINI::removeSetting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onPublish
function onPublish($contentObjectAttribute, $contentObject, $publishedNodes)
{
$contentClassAttribute = $contentObjectAttribute->attribute('contentclass_attribute');
$section = $contentClassAttribute->attribute(self::CLASS_SECTION_FIELD);
$parameter = $contentClassAttribute->attribute(self::CLASS_PARAMETER_FIELD);
$iniInstanceArray = explode(';', $contentClassAttribute->attribute(self::CLASS_INI_INSTANCE_FIELD));
$siteAccessArray = explode(';', $contentClassAttribute->attribute(self::SITE_ACCESS_LIST_FIELD));
$filename = $contentClassAttribute->attribute(self::CLASS_FILE_FIELD);
$makeEmptyArray = $contentObjectAttribute->attribute('data_int');
foreach ($iniInstanceArray as $iniInstance) {
if ($iniInstance == 0) {
$path = 'settings/override';
} else {
$path = 'settings/siteaccess/' . $siteAccessArray[$iniInstance];
}
$config = new eZINI($filename . '.append', $path, null, false, null, true, true);
if ($config == null) {
eZDebug::writeError('Could not open ' . $path . '/' . $filename);
continue;
}
if ($contentClassAttribute->attribute(self::CLASS_TYPE_FIELD) == self::CLASS_TYPE_ARRAY) {
if ($contentObjectAttribute->attribute('data_text') != null) {
$iniArray = array();
eZIniSettingType::parseArrayInput($contentObjectAttribute->attribute('data_text'), $iniArray, $makeEmptyArray);
$config->setVariable($section, $parameter, $iniArray);
} else {
$config->removeSetting($section, $parameter);
}
} else {
$config->setVariable($section, $parameter, $contentObjectAttribute->attribute('data_text'));
eZDebug::writeNotice('Saved ini settings to file: ' . $path . '/' . $filename . "\n" . ' [' . $section . ']' . "\n" . ' ' . $parameter . '=' . $contentObjectAttribute->attribute('data_text'), __METHOD__);
}
$config->save();
}
}
示例2: unset
if ( !$ini->save() )
{
eZDebug::writeError( "Can't save ini file: $iniPath/$fileName.append" );
}
unset( $baseIni );
unset( $ini );
// Remove variable from the global override
if ( $siteAccess != "global_override" )
{
$ini = new eZINI( $fileName . '.append', "settings/override", null, null, null, true, true );
foreach( $settings as $setting )
{
if ( $ini->hasVariable( $setting[0], $setting[1] ) )
$ini->removeSetting( $setting[0], $setting[1] );
}
if ( !$ini->save() )
{
eZDebug::writeError( "Can't save ini file: $iniPath/$fileName.append" );
}
unset($ini);
}
}
$uri = $http->postVariable( 'RedirectURI', $http->sessionVariable( 'LastAccessedModifyingURI', '/' ) );
$module->redirectTo( $uri );
?>