lib/ezutils/classes/ezini.php
\eZINI
Constants
Properties
Methods


appendOverrideDir(
string $dir, bool $globalDir
=
false, string | false $identifier
=
false, string | null $scope
=
null
)
:
bool
Appends the override directory $dir to the override directory list.
Appends override dir to 'override' scope if scope is not defined, meaning above anything else. See {@link eZINI::defaultOverrideDirs()} for how these parameters are used.
Name | Type | Description |
---|---|---|
$dir | string | |
$globalDir | bool | |
$identifier | string | false | Will overwrite existing directory with same identifier if set |
$scope | string | null |
Type | Description |
---|---|
bool | True if new dir was appended, false if there was a $identifier match and a overwrite |


assign(
$blockName, $varName, $variable
)
:
void
Name | Type | Description |
---|---|---|
$blockName | ||
$varName | ||
$variable |


create(
$fileName
=
'site.ini', $rootDir
=
'settings', $useTextCodec
=
null, $useCache
=
null, $useLocalOverrides
=
null
)
:
void
Name | Type | Description |
---|---|---|
$fileName | ||
$rootDir | ||
$useTextCodec | ||
$useCache | ||
$useLocalOverrides |


defaultOverrideDirs(
)
:
array
Default override directories as raw array data
Type | Description |
---|---|
array | An associated array of associated arrays of arrays.. First level keys are the scope and values are arrays Second level keys are identifier (numberic if not defined by caller) and value is arrays Third level contains (string) override dir, (bool) global flag if false then relative to {@link $RootDir} and (string|false) optional identifier as used by {@link eZINI::prependOverrideDir()} to match and replace values on. |


eZINI(
$fileName
=
'site.ini', $rootDir
=
'', $useTextCodec
=
null, $useCache
=
null, $useLocalOverrides
=
null, $directAccess
=
false, $addArrayDefinition
=
false
)
:
void
Name | Type | Description |
---|---|---|
$fileName | ||
$rootDir | ||
$useTextCodec | ||
$useCache | ||
$useLocalOverrides | ||
$directAccess | ||
$addArrayDefinition |


exists(
$fileName
=
"site.ini", $rootDir
=
"settings"
)
:
void
Name | Type | Description |
---|---|---|
$fileName | ||
$rootDir |


fetchFromFile(
$fileName, $useTextCodec
=
null
)
:
void
Name | Type | Description |
---|---|---|
$fileName | ||
$useTextCodec |


findInputFiles(
$inputFiles, $iniFile
)
:
void
Name | Type | Description |
---|---|---|
$inputFiles | ||
$iniFile |


getSiteAccessIni(
string $siteAccess, string $iniFile
)
:
\eZINI
Get ini file for a specific siteaccess (not incl extesnions or overrides) use {@link eZSiteAccess::getIni()} instead if you want to have full ini env.
Name | Type | Description |
---|---|---|
$siteAccess | string | |
$iniFile | string |
Type | Description |
---|---|
\eZINI |


globalOverrideDirs(
string | false | null $scope
=
null
)
:
array
Return the global override directories witch raw override dir data, or within a scope if $scope is set, see {@link eZINI::defaultOverrideDirs()} for how the raw data looks like.
Name | Type | Description |
---|---|---|
$scope | string | false | null | See {@link eZINI::defaultOverrideDirs()} for possible scope values If false then you'll get raw override dir structure, null (default) is a simplified variant withouth scopes that is easy to iterate over. |
Type | Description |
---|---|
array |


instance(
\$fileName $fileName
=
'site.ini', \$rootDir $rootDir
=
'settings', \$useTextCodec $useTextCodec
=
null, \$useCache $useCache
=
null, \$useLocalOverrides $useLocalOverrides
=
null, \$directAccess $directAccess
=
false, \$addArrayDefinition $addArrayDefinition
=
false
)
:
\eZINI
Returns a shared instance of the eZINI class pr $fileName, $rootDir and $useLocalOverrides param combinations.
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.
Name | Type | Description |
---|---|---|
$fileName | \$fileName | string |
$rootDir | \$rootDir | string |
$useTextCodec | \$useTextCodec | null|bool default system setting if null |
$useCache | \$useCache | null|bool default system setting if null |
$useLocalOverrides | \$useLocalOverrides | null|bool default system setting if null |
$directAccess | \$directAccess | bool |
$addArrayDefinition | \$addArrayDefinition | bool |
Type | Description |
---|---|
\eZINI |


isLoaded(
$fileName
=
'site.ini', $rootDir
=
'settings', $useLocalOverrides
=
null
)
:
void
Name | Type | Description |
---|---|---|
$fileName | ||
$rootDir | ||
$useLocalOverrides |


isSettingReadOnly(
$fileName
=
false, $blockName
=
false, $settingName
=
false
)
:
void
Name | Type | Description |
---|---|---|
$fileName | ||
$blockName | ||
$settingName |


isVariableModified(
$blockName, $varName
)
:
void
Name | Type | Description |
---|---|---|
$blockName | ||
$varName |


loadCache(
$reset
=
true, $placement
=
false
)
:
void
Name | Type | Description |
---|---|---|
$reset | ||
$placement |


overrideDirs(
string | null | false $scope
=
null
)
:
array
Return the override directories witch raw override dir data, or within a scope if $scope is set, see {@link eZINI::defaultOverrideDirs()} for how the raw data looks like.
Name | Type | Description |
---|---|---|
$scope | string | null | false | See {@link eZINI::defaultOverrideDirs()} for possible scope values If false then you'll get raw override dir structure, null (default) is a simplified variant withouth scopes that is easy to iterate over. |
Type | Description |
---|---|
array |


overrideDirsByScope(
array $dirs, string | null | false $scope
=
null
)
:
array
Return the override directories witch raw override dir data, or within a scope if $scope is set, see {@link eZINI::defaultOverrideDirs()} for how the raw data looks like.
Name | Type | Description |
---|---|---|
$dirs | array | Directories directly from internal raw structure (see above). |
$scope | string | null | false | See {@link eZINI::defaultOverrideDirs()} for possible scope values If false then you'll get raw override dir structure, null (default) is a simplified variant withouth scopes that is easy to iterate over. |
Type | Description |
---|---|
array |


parameterSet(
string $fileName
=
'site.ini', string $rootDir
=
'settings', string $section, string $parameter
)
:
bool
Check whether a specified parameter in a specified section is set in a specified file
Name | Type | Description |
---|---|---|
$fileName | string | fileName file name (optional) |
$rootDir | string | rootDir directory (optional) |
$section | string | section section name |
$parameter | string | parameter parameter name |
Type | Description |
---|---|
bool | True if the the parameter is set. |
- Deprecated
- Since 4.4


parse(
$inputFiles
=
false, $iniFile
=
false, $reset
=
true, $placement
=
false
)
:
void
Name | Type | Description |
---|---|---|
$inputFiles | ||
$iniFile | ||
$reset | ||
$placement |


prependOverrideDir(
string $dir, bool $globalDir
=
false, string | false $identifier
=
false, string | null $scope
=
null
)
:
bool
Prepends the override directory $dir to the override directory list.
Prepends override dir to 'extension' scope by default, bellow siteaccess and override settings. See {@link eZINI::defaultOverrideDirs()} for how these parameters are used.
Name | Type | Description |
---|---|---|
$dir | string | |
$globalDir | bool | |
$identifier | string | false | Will overwrite existing directory with same identifier if set |
$scope | string | null |
Type | Description |
---|---|
bool | True if new dir was prepended, false if there was a $identifier match and a overwrite |


removeOverrideDir(
string $identifier, string $scope
=
'extension'
)
:
bool
Removes an override dir by identifier See {@link eZINI::defaultOverrideDirs()} for how these parameters are used.
Name | Type | Description |
---|---|---|
$identifier | string | Will remove existing directory with identifier it it exists |
$scope | string | By default 'extension' |
Type | Description |
---|---|
bool | True if new dir was appended, false if there was a $identifier match and a overwrite |


removeSetting(
$blockName, $settingName
)
:
void
Name | Type | Description |
---|---|---|
$blockName | ||
$settingName |


resetAllGlobals(
$resetGlobalOverrideDirs
=
true
)
:
void
Reset all eZINI instances as well override dirs ( optional )
Name | Type | Description |
---|---|---|
$resetGlobalOverrideDirs |


resetGlobalOverrideDirs(
)
:
void
Reset the global override directories with data from {@link eZINI::defaultOverrideDirs()}


resetGlobals(
$fileName
=
'site.ini', $rootDir
=
'settings', $useLocalOverrides
=
null
)
:
void
Name | Type | Description |
---|---|---|
$fileName | ||
$rootDir | ||
$useLocalOverrides |


resetOverrideDirs(
)
:
void
Reset the override directories with data from {@link eZINI::defaultOverrideDirs()}


save(
$fileName
=
false, $suffix
=
false, $useOverride
=
false, $onlyModified
=
false, $useRootDir
=
true, $resetArrays
=
false, $encapsulateInPHP
=
true
)
:
void
Name | Type | Description |
---|---|---|
$fileName | ||
$suffix | ||
$useOverride | ||
$onlyModified | ||
$useRootDir | ||
$resetArrays | ||
$encapsulateInPHP |


saveCache(
string $cachedDir, string $cachedFile, array $data, array $inputFiles, string $iniFile
)
:
bool
Stores the content of the INI object to the cache file \a $cachedFile.
Name | Type | Description |
---|---|---|
$cachedDir | string | Cache dir, usually "var/cache/ini/" |
$cachedFile | string | Name of cache file as returned by cacheFileName() |
$data | array | Configuration data as an associative array structure |
$inputFiles | array | List of input files used as basis for cache (for use in load cache to check mtime) |
$iniFile | string | Ini file path string returned by findInputFiles() for main ini file |
Type | Description |
---|---|
bool |


selectOverrideScope(
string | null $scope, string $identifier, string $dir, string $default
)
:
string
Function to handle bc with code from pre 4.4 that does not know about scopes
Name | Type | Description |
---|---|---|
$scope | string | null | |
$identifier | string | |
$dir | string | |
$default | string |
Type | Description |
---|---|
string |
- Since
- 4.4


setOverrideDirs(
array $newDirs, string | false $scope
=
false
)
:
void
Set the override directories witch raw override dir data, or within a scope if $scope is set, see {@link eZINI::defaultOverrideDirs()} for how the raw data looks like.
Name | Type | Description |
---|---|---|
$newDirs | array | |
$scope | string | false | See {@link eZINI::defaultOverrideDirs()} for possible scope values |


setVariable(
$blockName, $variableName, $variableValue
)
:
void
Name | Type | Description |
---|---|---|
$blockName | ||
$variableName | ||
$variableValue |