eZPublish  3.8
eZINI Class Reference

Reads and writes .ini style configuration files. More...

Public Member Functions

 appendOverrideDir ($dir, $globalDir=false, $identifier=false)
 
 assign ($blockName, $varName, &$variable)
 
 eZINI ($fileName, $rootDir="", $useTextCodec=null, $useCache=null, $useLocalOverrides=null, $directAccess=false, $addArrayDefinition=false)
 
fetchFromFile ($fileName, $useTextCodec=null)
 
 filename ()
 
findSettingPlacement ($path)
 
 getNamedArray ()
 
group ($blockName)
 
groupPlacements ()
 
groups ()
 
 hasGroup ($blockName)
 
 hasSection ($sectionName)
 
 hasVariable ($blockName, $varName)
 
 isNoCacheAdviced ()
 
 isSettingReadOnly ($fileName=false, $blockName=false, $settingName=false)
 
 isVariableModified ($blockName, $varName)
 
 load ($reset=true)
 
 loadPlacement ($reset=true)
 
 overrideDirs ()
 
 prependOverrideDir ($dir, $globalDir=false, $identifier=false)
 
 readOnlySettingsCheck ()
 
 removeGroup ($blockName)
 
 removeSetting ($blockName, $settingName)
 
 reset ()
 
 resetCache ()
 
 rootDir ()
 
 save ($fileName=false, $suffix=false, $useOverride=false, $onlyModified=false, $useRootDir=true, $resetArrays=false)
 
 setGroups ($groupArray)
 
 setReadOnlySettingsCheck ($readOnly=true)
 
 settingType ($settingValue)
 
 setVariable ($blockName, $variableName, $variableValue)
 
 variable ($blockName, $varName)
 
variableArray ($blockName, $varName)
 
 variableMulti ($blockName, $varNames, $signatures=array())
 

Static Public Member Functions

create ($fileName="site.ini", $rootDir="settings", $useTextCodec=null, $useCache=null, $useLocalOverrides=null)
 
 exists ($fileName="site.ini", $rootDir="settings")
 
instance ($fileName="site.ini", $rootDir="settings", $useTextCodec=null, $useCache=null, $useLocalOverrides=null, $directAccess=false, $addArrayDefinition=false)
 
 isCacheEnabled ()
 
 isDebugEnabled ()
 
 isLoaded ($fileName="site.ini", $rootDir="settings", $useLocalOverrides=null)
 
 isTextCodecEnabled ()
 
 parameterSet ($fileName= 'site.ini', $rootDir= 'settings', &$section, &$parameter)
 
 setIsCacheEnabled ($cache)
 
 setIsDebugEnabled ($debug)
 
 setIsTextCodecEnabled ($codec)
 

Private Member Functions

 findInputFiles (&$inputFiles, &$iniFile)
 
 loadCache ($reset=true, $placement=false)
 
 parse ($inputFiles=false, $iniFile=false, $reset=true, $placement=false)
 
 parseFile ($file, $placement=false)
 
 saveCache ($cachedDir, $cachedFile, $data)
 

Private Attributes

 $AddArrayDefinition
 If true empty element will be created in the beginning of array if it is defined in this ini file. More...
 
 $BlockValues
 Variable to store the ini file values. More...
 
 $BlockValuesPlacement
 Variable to store the setting placement (which file is the setting in). More...
 
 $CacheFile
 Stores the path and filename of the value cache file. More...
 
 $Charset
 The charset of the ini file. More...
 
 $Codec
 Variable to store the textcodec. More...
 
 $DirectAccess
 If true then all file loads are done directly on the filename. More...
 
 $FileName
 Stores the filename. More...
 
 $LocalOverrideDirArray
 Contains the override dirs, if in local mode. More...
 
 $ModifiedBlockValues
 Variable to store whether variables are modified or not. More...
 
 $PlacementCacheFile
 Stores the path and filename of the placement cache file. More...
 
 $ReadOnlySettingsCheck = true
 If true eZINI will check each setting (before saving) for correspondence of settings in site.ini[eZINISetting].ReadonlySettingList. More...
 
 $RootDir
 The root of all ini files. More...
 
 $UseCache
 true if cache should be used More...
 
 $UseLocalOverrides
 true if the overrides should only be changed locally More...
 
 $UseTextCodec
 Whether to use the text codec when reading the ini file or not. More...
 

Detailed Description

Reads and writes .ini style configuration files.

The most common way of using it is.

// include the file
include_once( "classes/ezinifile.php" );
$ini = eZINI::instance( "site.ini" );
// get a variable from the file.
$iniVar = $ini->variable( "BlockName", "Variable" );

The default ini file is site.ini but others can be passed to the instance() function among with some others. It will create one unique instance for each ini file and rootdir, this means that the next time instance() is used with the same parameters the same object will be returned and no new parsing is required.

The class will by default try to create a cache file in var/cache/ini, however to change this behaviour the static setIsCacheEnabled() function can be used, or use the $useCache parameter in instance() for setting this for one object only.

The class will also handle charset conversion using eZTextCodec, to turn this behaviour off use the static setIsTextCodecEnabled() function or set the $useTextCodec parameter in instance() for a per object basis setting.

Normally the eZINI class will not give out much information about what it's doing, it's only when errors occur that you'll see this. To enable internal debugging use the static setIsDebugEnabled() function. The class will then give information about which files are load, if cache files are used and when cache files are written.

Member Function Documentation

eZINI::appendOverrideDir (   $dir,
  $globalDir = false,
  $identifier = false 
)

Appends the override directory $dir to the override directory list.

eZINI::assign (   $blockName,
  $varName,
$variable 
)

Reads a variable from the ini file and puts it in the parameter $variable.

Note
$variable is not modified if the variable does not exist
& eZINI::create (   $fileName = "site.ini",
  $rootDir = "settings",
  $useTextCodec = null,
  $useCache = null,
  $useLocalOverrides = null 
)
static
eZINI::exists (   $fileName = "site.ini",
  $rootDir = "settings" 
)
static
Returns
true if the INI file $fileName exists in the root dir $rootDir. $fileName defaults to site.ini and rootDir to settings.

Referenced by eZLocale\countryFile(), eZLocale\languageFile(), eZLocale\localeFile(), and parameterSet().

eZINI::eZINI (   $fileName,
  $rootDir = "",
  $useTextCodec = null,
  $useCache = null,
  $useLocalOverrides = null,
  $directAccess = false,
  $addArrayDefinition = false 
)

Initialization of object;

Referenced by create(), fetchFromFile(), and instance().

& eZINI::fetchFromFile (   $fileName,
  $useTextCodec = null 
)

Fetches the ini file $fileName and returns the INI object for it.

Note
This will not use the override system or read cache files, this is a direct fetch from one file.

Referenced by eZFilePackageHandler\install().

eZINI::filename ( )
Returns
the filename.

Referenced by setVariable().

eZINI::findInputFiles ( $inputFiles,
$iniFile 
)
private

Looks trough all known settings and override folders to find relevant INI files. The result is a list with expanded paths to the files.

Returns
the expanded file list.

Referenced by loadCache(), and parse().

& eZINI::findSettingPlacement (   $path)
eZINI::getNamedArray ( )

Returns BlockValues, which is a nicely named Array

& eZINI::group (   $blockName)

Fetches a variable group and returns it as an associative array.

& eZINI::groupPlacements ( )

Fetches all defined placements for every setting and returns them as an associative array

& eZINI::groups ( )

Fetches all defined groups and returns them as an associative array

eZINI::hasGroup (   $blockName)

Checks if group $blockName is set. Returns true if the group exists, false if not.

eZINI::hasSection (   $sectionName)

Check if a block/section is set. Returns true if the section/block is set, false if not

eZINI::hasVariable (   $blockName,
  $varName 
)

Checks if a variable is set. Returns true if the variable exists, false if not.

Referenced by assign().

& eZINI::instance (   $fileName = "site.ini",
  $rootDir = "settings",
  $useTextCodec = null,
  $useCache = null,
  $useLocalOverrides = null,
  $directAccess = false,
  $addArrayDefinition = false 
)
static

Returns the current instance of the given .ini file If $useLocalOverrides is set to true you will get a copy of the current overrides, but changes to the override settings will not be global. Direct access is for accessing the filename directly in the specified path. .append and .append.php is automaticly added to filename

Note
Use create() if you need to get a unique copy which you can alter.

Referenced by eZDBFileHandlerPgsqlBackend\_connect(), eZDBFileHandlerMysqlBackend\_connect(), accessAllowed(), eZUser\accessArray(), accessDebugEnabled(), accessExtraDebugEnabled(), accessType(), eZExtension\activateExtensions(), eZExtension\activeExtensions(), eZModule\activeModuleRepositories(), eZInstallScriptPackageHandler\add(), eZExtensionPackageHandler\add(), eZSearch\addObject(), eZCodeTemplate\allCodeFiles(), eZTemplateDesignResource\allDesignBases(), eZInformationCollection\allowAnonymous(), eZMail\allowedCharsets(), eZNotificationEventType\allowedTypes(), eZWorkflowType\allowedTypes(), eZDataType\allowedTypes(), eZTemplateCompiler\alwaysGenerate(), eZImageAnalyzer\analyzerData(), eZContentCacheManager\appendRelatingNodeIDs(), eZImage\attribute(), eZInformationCollection\attributeHideList(), eZUser\authenticationMatch(), eZNotificationEventFilter\availableHandlers(), eZWebDAVContentServer\availableSites(), eZExtension\baseDirectory(), eZDBInterface\begin(), eZContentBrowse\browse(), eZSearch\buildSearchArray(), eZSearchEngine\buildTempTablesForFullTextSearch(), eZTranslationCache\cacheDirectory(), eZSys\cacheDirectory(), eZURLAlias\cacheInfo(), eZContentCache\cachePathInfo(), eZContentObject\canCreateClassList(), eZContentObjectTreeNode\canCreateClassList(), eZContentClass\canInstantiateClasses(), eZContentClass\canInstantiateClassList(), Cezpdf\Cezpdf(), changeAccess(), eZImageHandler\changeFilePermissions(), eZPaymentCallbackChecker\checkAmount(), eZSSLZone\checkModuleView(), eZContentObjectTreeNode\checkPath(), eZTipafriendRequest\checkReceiver(), eZDB\checkTransactionCounter(), eZUserLoginHandler\checkUser(), eZUser\checkUser(), eZContentObjectTreeNode\childrenByName(), eZUserType\classAttributeRemovableInformation(), eZDataType\classDisplayInformation(), eZContentClassPackageHandler\classDOMTree(), eZTipafriendRequest\cleanup(), eZContentCache\cleanup(), eZSearch\cleanup(), eZSubtreeCache\cleanupCacheDir(), eZBasket\cleanupCurrentBasket(), eZContentCacheManager\clearAllContentCache(), eZContentCacheManager\clearObjectViewCache(), eZContentCacheManager\clearObjectViewCacheIfNeeded(), eZContentCacheManager\clearTemplateBlockCacheIfNeeded(), eZDBInterface\commit(), eZTemplateCompiler\compileTemplate(), eZLocale\countryFile(), eZExchangeRatesUpdateHandler\create(), eZPDFExport\create(), eZRSSExport\create(), eZLocale\create(), eZImageManager\createAliasFromINI(), eZDiffXMLTextEngine\createDifferenceObject(), eZContentObjectTreeNode\createExtendedAttributeFilterSQLStrings(), eZWebDAVContentServer\createFolder(), eZImageShellHandler\createFromINI(), eZImageGDHandler\createFromINI(), eZContentObject\createNewVersion(), eZTemplateDesignResource\createOverrideCache(), eZHTTPTool\createRedirectUrl(), eZPackageCreationHandler\creatorList(), eZOrder\customerList(), eZObjectRelationType\customObjectAttributeHTTPAction(), eZObjectRelationListType\customObjectAttributeHTTPAction(), eZApproveType\customWorkflowEventHTTPAction(), eZWebDAVServer\dataCharset(), eZTemplateLocaleOperator\dateTimeTransformation(), eZContentObject\defaultLanguage(), eZContentCacheManager\dependencyInfo(), eZTemplateDesignResource\designSetting(), eZContentUpload\detectClassIdentifier(), eZContentUpload\detectLocations(), eZDir\directoryPermission(), eZStepFinal\display(), eZStepSiteTemplates\display(), eZStepSiteDetails\display(), eZInformationCollection\displayHandling(), eZXMLTextType\domString(), eZObjectRelationListType\domString(), eZMatrix\domString(), eZVatType\dynamicVatTypeName(), eZXMLInputType\editorName(), eZHTTPHeader\enabled(), eZSSLZone\enabled(), eZSimpleShippingType\execute(), eZApproveType\execute(), eZFunctionHandler\executeAlias(), eZCodeMapper\executeCommandCode(), eZContentObjectEditHandler\executeInputHandlers(), eZContentObjectEditHandler\executePublish(), eZCheckUser(), eZCheckValidity(), eZCodeTemplate\eZCodeTemplate(), eZSys\ezcrc32(), eZDBFileHandler\eZDBFileHandler(), eZDBInterface\eZDBInterface(), eZDisplayDebug(), eZFetchActiveSessionCount(), eZFetchActiveSessions(), eZImageManager\eZImageManager(), eZMail\eZMail(), eZPaymentCallbackChecker\eZPaymentCallbackChecker(), eZPDF\eZPDF(), eZPostgreSQLDB\eZPostgreSQLDB(), eZSessionRead(), eZSessionStart(), eZSetupConfigVariable(), eZSetupConfigVariableArray(), eZSetupCriticalTests(), eZSetupImageConfigVariableArray(), eZSetupOptionalTests(), eZSetupTestDirectoryPermissions(), eZSetupTestFilePermissions(), eZSimplifiedXMLInput\eZSimplifiedXMLInput(), eZStaticCache\eZStaticCache(), eZStepInstaller\eZStepInstaller(), eZStepSiteTypes\eZStepSiteTypes(), eZTemplate\eZTemplate(), eZTemplateImageOperator\eZTemplateImageOperator(), eZUpdateDebugSettings(), eZUpdateTextCodecSettings(), eZXHTMLXMLOutput\eZXHTMLXMLOutput(), eZXMLInputParser\eZXMLInputParser(), eZXMLSchema\eZXMLSchema(), eZUser\fetchAnonymousCount(), eZCache\fetchList(), eZNavigationPart\fetchList(), eZUser\fetchLoggedInCount(), eZUser\fetchLoggedInList(), eZContentClass\fetchMatchGroupIDList(), eZContentObjectTreeNode\fetchNode(), eZWebDAVContentServer\fetchNodeInfo(), eZUserType\fetchObjectAttributeHTTPInput(), eZClassFunctionCollection\fetchOverrideTemplateList(), eZProductCategory\fetchProductCountByCategory(), eZRSSExport\fetchRSS1_0(), eZRSSExport\fetchRSS2_0(), eZLayoutFunctionCollection\fetchSitedesignList(), eZTemplateExecuteOperator\fetchTransform(), eZRSSImport\fieldMap(), eZFilePackageHandler\fileExists(), eZTemplateDesignResource\fileMatchingRules(), eZExtensionPackageCreator\finalize(), eZExtension\findExtensionType(), eZContentUpload\findHandler(), eZSiteAccess\findPathToSiteAccess(), eZImageVariation\fullPath(), eZContentObjectPackageHandler\generateFetchAliasArray(), eZNodeviewfunctions\generateNodeView(), eZContentCacheManager\generateObjectViewCache(), eZContentObjectPackageHandler\generateOverrideSettingsArray(), eZNodeviewfunctions\generateViewCacheFile(), eZUser\getCacheFilename(), eZDir\getPathFromFilename(), eZDefaultVATHandler\getProductCategory(), eZSSLZone\getSSLZones(), eZVATManager\getUserCountryAttributeName(), getVariable(), eZCharTransform\groupCommands(), eZGeneralDigestHandler\handle(), eZExtensionPackageHandler\handleAddParameters(), eZContentUpload\handleLocalFile(), eZContentObjectPackageHandler\handleParameters(), eZSubTreeHandler\handlePublishEvent(), handleRelationTemplate(), eZContentUpload\handleUpload(), eZImage\hasAttribute(), eZImageInterface\hasGD2(), eZUser\hashType(), eZHTTPHeader\headerOverrideArray(), eZLocale\httpLocaleCode(), eZi18nOperator\i18nTrans(), eZImageAliasHandler\imagePath(), eZImageAliasHandler\imagePathByNode(), eZContentCache\inCleanupThresholdRange(), eZSys\indexFile(), eZCollaborationViewHandler\ini(), eZCollaborationItemHandler\ini(), eZTemplate\ini(), eZStepCreateSites\init(), eZStepDatabaseInit\init(), eZPDFTable\initFrameMargins(), eZECBHandler\initialize(), eZModule\initialize(), eZContentObjectEditHandler\initialize(), eZScript\initialize(), eZSimpleTagsOperator\initializeIncludes(), eZIniSettingType\initializeObjectAttribute(), eZContentObjectPackageCreator\initializeObjectLimits(), eZContentObjectPackageInstaller\initializeSiteAccess(), eZContentObjectPackageInstaller\initializeTopNodes(), eZURLOperator\iniTrans(), eZINIAddonPackageHandler\install(), eZExtensionPackageHandler\install(), eZContentObjectPackageHandler\installFetchAliases(), eZContentObjectPackageHandler\installOverrides(), eZContentObjectPackageHandler\installTemplates(), eZClusterFileHandler\instance(), eZDbSchema\instance(), eZNotificationTransport\instance(), eZXMLInputType\instance(), eZUserLoginHandler\instance(), eZDB\instance(), eZArchiveHandler\instance(), eZBinaryFileHandler\instance(), eZUser\instance(), eZFileHandler\instance(), eZLocale\instance(), eZTextCodec\internalCharset(), eZTemplateTreeCache\internalKey(), eZTemplateCompiler\isAccumulatorsEnabled(), eZTemplateTreeCache\isCacheEnabled(), eZTemplateCompiler\isCommentsEnabled(), eZTemplateCompiler\isCompilationEnabled(), eZContentObject\isComplexViewMode(), eZTemplateCompiler\isDevelopmentModeEnabled(), eZTemplateCompiler\isExecutionEnabled(), eZTemplateCompiler\isFallbackResourceCodeEnabled(), eZSSLZone\isKeepModeView(), eZWebDAVServer\isLoggingEnabled(), eZTemplate\isMethodDebugEnabled(), eZTemplateCompiler\isNodePlacementEnabled(), eZWebDAVContentServer\isObjectFolder(), isSettingReadOnly(), eZSys\isSSLNow(), eZTemplate\isTemplatesUsageStatisticsEnabled(), eZTemplateCompiler\isTimingPointsEnabled(), eZTemplateCompiler\isTreeEnabled(), eZVATManager\isUserCountryRequired(), eZUser\isUserLoggedIn(), eZTemplate\isXHTMLCodeIncluded(), eZLocale\languageFile(), eZLintSchema\lintCheckSchema(), eZPaymentGatewayType\loadAndRegisterBuiltInGateways(), eZPaymentGatewayType\loadAndRegisterExtensionGateways(), eZNotificationEventType\loadAndRegisterType(), eZWorkflowType\loadAndRegisterType(), eZDataType\loadAndRegisterType(), eZExtensionPackageCreator\loadExtensionName(), eZNotificationEventFilter\loadHandler(), eZContentObjectPackageCreator\loadObjectLimits(), eZDBSchemaInterface\loadSchemaTransformationRules(), eZShippingManager\loadShippingHandler(), eZCodeMapper\loadTransformationFiles(), eZTSTranslator\loadTranslationFile(), eZVATManager\loadVATHandler(), eZLocale\localeFile(), eZLDAPUser\loginUser(), eZTextFileUser\loginUser(), eZUser\loginUser(), eZContentObjectTreeNode\makeObjectsArray(), eZContentObject\matchIngroupIDList(), eZCurrencyConverter\mathHandler(), eZContentBrowseRecent\maximumRecentItems(), eZBinaryFile\metaData(), eZPDF\modify(), eZSimpleTagsOperator\modify(), eZTopMenuOperator\modify(), eZTemplateImageOperator\modify(), eZTemplateLocaleOperator\modify(), eZTemplateUnitOperator\modify(), eZTemplateStringOperator\modify(), eZURLOperator\modify(), eZContentObjectTreeNodeOperations\move(), eZContentBrowse\nodeAliasID(), eZContentUpload\nodeAliasID(), eZContentObjectAssignmentHandler\nodeID(), eZSearch\normalizeText(), eZIniSettingType\objectAttributeContent(), eZDataType\objectDisplayInformation(), eZContentUpload\objectFileInfo(), eZIniSettingType\onPublish(), eZPHPCreator\open(), eZTemplateUnitOperator\operatorTransform(), eZMail\outputCharset(), eZTemplateDesignResource\overrideArray(), eZTemplateDesignResource\overrideKeys(), parameterSet(), eZPDFParser\parseFile(), eZWordParser\parseFile(), eZUser\passwordCharacterTable(), eZContentObjectTreeNode\pathWithNames(), precheckAllowed(), eZShopFunctions\preferredCurrencyCode(), eZSearchEngine\prepareWordIDArrays(), eZExtension\prependSiteAccess(), eZContentLanguage\prioritizedLanguages(), eZTemplateMenuFunction\process(), eZTemplateToolbarFunction\process(), eZTemplateCacheFunction\process(), eZStepSiteTemplates\processPostData(), eZWebDAVContentServer\putContentData(), eZImageAnalyzer\readAnalyzerSettingsFromINI(), eZImageManager\readConversionRuleSettingsFromINI(), eZImageManager\readImageAliasesFromINI(), eZImageManager\readImageHandlersFromINI(), eZImageManager\readMIMETypeQualitySettingFromINI(), eZImageManager\readMIMETypeSettingFromINI(), eZImageManager\readMIMETypeSettingsFromINI(), eZImageManager\readSupportedFormatsFromINI(), eZInformationCollection\redirectURL(), eZContentOperationCollection\registerSearchObject(), eZProductCategory\remove(), eZContentObjectTreeNode\remove(), eZSearch\removeObject(), removeRelatedCache(), eZSubtreeCache\renameDir(), eZPDFXMLOutput\renderPDFTag(), eZXHTMLXMLOutput\renderXHTMLTag(), eZDBInterface\reportError(), eZImageVariation\requestVariation(), eZUser\requireUniqueEmail(), eZContentBrowse\result(), eZDBInterface\rollback(), eZCurrencyConverter\roundingPrecision(), eZCurrencyConverter\roundingTarget(), eZCurrencyConverter\roundingType(), save(), eZSearch\search(), eZSearchEngine\search(), eZClusterFileHandler\searchPathArray(), eZMailNotificationTransport\send(), eZMailTransport\send(), eZSMTPTransport\sendMail(), eZSendmailTransport\sendMail(), eZShopOperationCollection\sendOrderEmails(), eZInformationCollection\sendOutEmail(), eZSys\serverURL(), eZUserLoginHandler\sessionCleanup(), eZTemplateTreeCache\setCachedTree(), eZContentOperationCollection\setObjectStatusPublished(), eZIniSettingType\setSiteAccessList(), eZContentObjectAssignmentHandler\setupAssignments(), eZURI\setURIString(), eZContentObjectTreeNode\showInvisibleNodes(), eZUser\site(), eZSiteAccess\siteAccessList(), eZScript\startup(), eZSys\storageDirectory(), eZHTTPFile\store(), eZContentCache\store(), eZImageInterface\store(), eZTemplateImageOperator\storeImage(), eZPackageType\storeObjectAttribute(), eZRSSEditFunction\storeRSSExport(), eZContentObjectTreeNode\subTreeCount(), eZSSLZone\switchIfNeeded(), templateInit(), eZTemplateCacheFunction\templateNodeTransformation(), eZTemplateMenuFunction\templateNodeTransformation(), eZTemplateToolbarFunction\templateNodeTransformation(), eZTemplateCompiler\TemplatePrefix(), eZURLTranslator\translate(), eZURLAlias\translateByWildcard(), eZInformationCollection\typeForObject(), eZExtensionPackageHandler\uninstall(), eZIniSettingType\unserializeContentClassAttribute(), eZBinaryFileType\unserializeContentObjectAttribute(), eZMediaType\unserializeContentObjectAttribute(), eZShopFunctions\updateAutoRates(), eZScript\updateDebugSettings(), eZScript\updateTextCodecSettings(), upgradeMenuINI(), eZContentUpload\upload(), eZURLOperator\urlTransformation(), eZInformationCollection\userDataHandling(), eZIniSettingType\validateObjectAttributeHTTPInput(), eZUserType\validateObjectAttributeHTTPInput(), eZSys\varDirectory(), eZXMLInputParser\wordMatchSupport(), eZLog\write(), and eZLog\writeStorageLog().

eZINI::isCacheEnabled ( )
static
Returns
true if INI cache is enabled globally, the default value is true. Change this setting with setIsCacheEnabled.

Referenced by eZINI().

eZINI::isDebugEnabled ( )
static
Returns
true if debugging of internals is enabled, this will display which files are loaded and when cache files are created. Set the option with setIsDebugEnabled().

Referenced by appendOverrideDir(), loadCache(), parseFile(), prependOverrideDir(), and saveCache().

eZINI::isLoaded (   $fileName = "site.ini",
  $rootDir = "settings",
  $useLocalOverrides = null 
)
static
Returns
true if the ini file $fileName has been loaded yet.
eZINI::isNoCacheAdviced ( )
Returns
true if cache is not adviced to be used.
Note
The no-cache-adviced flag might not be modified in time for site.ini and some other important files to be affected.

Referenced by eZINI().

eZINI::isSettingReadOnly (   $fileName = false,
  $blockName = false,
  $settingName = false 
)

Referenced by setGroups(), and setVariable().

eZINI::isTextCodecEnabled ( )
static
Returns
true if textcodecs is to be used, this will use the eZTextCodec class in the eZI18N library for text conversion. Set the option with setIsTextCodecEnabled().

Referenced by eZINI().

eZINI::isVariableModified (   $blockName,
  $varName 
)
Returns
true if the variable $varName in group $blockName has been modified.
eZINI::load (   $reset = true)

Tries to load the ini file specified in the constructor or instance() function. If cache files should be used and a cache file is found it loads that instead. Set $reset to false if you don't want to reset internal data.

Referenced by eZINI().

eZINI::loadCache (   $reset = true,
  $placement = false 
)
private

Will load a cached version of the ini file if it exists, if not it will parse the original file and create the cache file.

Referenced by load(), and loadPlacement().

eZINI::loadPlacement (   $reset = true)

Tries to load the ini file placement specified in the constructor or instance() function. If cache files should be used and a cache file is found it loads that instead. Set $reset to false if you don't want to reset internal data.

Referenced by groupPlacements().

eZINI::overrideDirs ( )
Returns
the override directories, if no directories has been set "override" is returned.

The override directories are returned as an array of arrays. The first value in the array is the override directory, the second is a boolean which defines if the directory is relative to the rootDir() or not. If the second value is false the override dir is relative, true means that the override dir is relative to the eZ publish root directory. The third value of the array will contain the identifier of the override, if it exists. Identifiers are useful if you want to overwrite the current override setting.

Referenced by findInputFiles().

eZINI::parameterSet (   $fileName = 'site.ini',
  $rootDir = 'settings',
$section,
$parameter 
)
static

Check wether a specified parameter in a specified section is set in a specified file

Parameters
filename(optional)
directory(optional)
sectionname
parametername
Returns
true if the the parameter is set.

Referenced by eZIniSettingType\initializeObjectAttribute(), and eZIniSettingType\objectAttributeContent().

eZINI::parse (   $inputFiles = false,
  $iniFile = false,
  $reset = true,
  $placement = false 
)
private

Parses either the override ini file or the standard file and then the append override file if it exists.

Referenced by load(), loadCache(), and loadPlacement().

eZINI::parseFile (   $file,
  $placement = false 
)
private

Will parse the INI file and store the variables in the variable $this->BlockValues

Referenced by parse().

eZINI::prependOverrideDir (   $dir,
  $globalDir = false,
  $identifier = false 
)

Appends the override directory $dir to the override directory list. If global dir is set top

eZINI::readOnlySettingsCheck ( )
Returns
ReadonlySettingsCheck variable.

Referenced by isSettingReadOnly().

eZINI::removeGroup (   $blockName)

Removes the group and all it's settings from the .ini file

Referenced by removeSetting().

eZINI::removeSetting (   $blockName,
  $settingName 
)
eZINI::reset ( )

Removes all read data from .ini files.

Referenced by loadCache(), and parse().

eZINI::resetCache ( )

the cache file if it exists.

eZINI::rootDir ( )
Returns
the root directory from where all .ini and override files are read.

This is set by the instance() or eZINI() functions.

eZINI::save (   $fileName = false,
  $suffix = false,
  $useOverride = false,
  $onlyModified = false,
  $useRootDir = true,
  $resetArrays = false 
)

Saves the file to disk. If filename is given the file is saved with that name if not the current name is used. If $useOverride is true then the file will be placed in the override directory, if $useOverride is "append" it will append ".append" to the filename.

eZINI::saveCache (   $cachedDir,
  $cachedFile,
  $data 
)
private

Stores the content of the INI object to the cache file $cachedFile.

Referenced by loadCache().

eZINI::setGroups (   $groupArray)

Sets all groups overwriting the current values

eZINI::setIsCacheEnabled (   $cache)
static

Sets whether caching is enabled for INI files or not. This setting is global and can be overriden in the instance() function.

eZINI::setIsDebugEnabled (   $debug)
static

Sets whether internal debugging is enabled or not.

eZINI::setIsTextCodecEnabled (   $codec)
static

Sets whether textcodec conversion is enabled or not.

eZINI::setReadOnlySettingsCheck (   $readOnly = true)

Sets ReadonlySettingsCheck variable.

eZINI::settingType (   $settingValue)
eZINI::setVariable (   $blockName,
  $variableName,
  $variableValue 
)

Sets multiple variables from the array $variables.

Parameters
$variablesContains an associative array with groups as first key, variable names as second key and variable values as values.
$ini->setVariables( array( 'SiteSettings' => array( 'SiteName' => 'mysite',
'SiteURL' => 'http://mysite.com' ) ) );
\encode
*/
function setVariables( $variables )
{
foreach ( $variables as $blockName => $blockVariables )
{
foreach ( $blockVariables as $variableName => $variableValue )
{
$this->setVariable( $blockName, $variableName, $variableValue );
}
}
}
/*!
Sets an INI file variable.
\code
$ini->setVariable( 'SiteSettings', 'SiteName', 'mysite' );
See Also
setVariables
eZINI::variable (   $blockName,
  $varName 
)

Reads a variable from the ini file. false is returned if the variable was not found.

Referenced by assign(), and variableArray().

& eZINI::variableArray (   $blockName,
  $varName 
)

Reads a variable from the ini file. The variable will be returned as an array. ; is used as delimiter.

eZINI::variableMulti (   $blockName,
  $varNames,
  $signatures = array() 
)

Reads multiple variables from the ini file. false is returned if the variable was not found.

Member Data Documentation

eZINI::$AddArrayDefinition
private

If true empty element will be created in the beginning of array if it is defined in this ini file.

eZINI::$BlockValues
private

Variable to store the ini file values.

Referenced by getNamedArray(), and groups().

eZINI::$BlockValuesPlacement
private

Variable to store the setting placement (which file is the setting in).

Referenced by groupPlacements().

eZINI::$CacheFile
private

Stores the path and filename of the value cache file.

eZINI::$Charset
private

The charset of the ini file.

eZINI::$Codec
private

Variable to store the textcodec.

eZINI::$DirectAccess
private

If true then all file loads are done directly on the filename.

eZINI::$FileName
private

Stores the filename.

Referenced by filename(), and save().

eZINI::$LocalOverrideDirArray
private

Contains the override dirs, if in local mode.

Referenced by appendOverrideDir(), overrideDirs(), and prependOverrideDir().

eZINI::$ModifiedBlockValues
private

Variable to store whether variables are modified or not.

eZINI::$PlacementCacheFile
private

Stores the path and filename of the placement cache file.

eZINI::$ReadOnlySettingsCheck = true
private

If true eZINI will check each setting (before saving) for correspondence of settings in site.ini[eZINISetting].ReadonlySettingList.

Referenced by readOnlySettingsCheck().

eZINI::$RootDir
private

The root of all ini files.

Referenced by rootDir(), and save().

eZINI::$UseCache
private

true if cache should be used

eZINI::$UseLocalOverrides
private

true if the overrides should only be changed locally

eZINI::$UseTextCodec
private

Whether to use the text codec when reading the ini file or not.


The documentation for this class was generated from the following file: