eZ Publish Community Project (Legacy Stack) 2013.4
Class

eZINI

class eZINI

Constants

CONFIG_CACHE_DIR

Constant path to directory for configuration cache

CONFIG_CACHE_REV

Constant integer to check against configuration cache format revision

INJECTED_PATH

Fake path of injected settings used to differentiate those from default, override, extension, ...

Properties

$Charset
$Codec
$BlockValues
$BlockValuesPlacement
$ModifiedBlockValues
$FileName
$RootDir
$UseTextCodec
$CacheFile
$PlacementCacheFile
$UseCache
$UseLocalOverrides
$LocalOverrideDirArray
$DirectAccess
$AddArrayDefinition
$ReadOnlySettingsCheck

Methods

eZINI(string $fileName = 'site.ini', string $rootDir = '', null|bool $useTextCodec = null, null|bool $useCache = null, null|bool $useLocalOverrides = null, bool $directAccess = false, bool $addArrayDefinition = false, bool $load = true)

Initialization of eZINI object

filename()

load(bool $reset = true)

Tries to load the ini file specified in the constructor or instance() function.

loadPlacement(bool $reset = true)

Tries to load the ini file placement specified in the constructor or instance() function.

findInputFiles($inputFiles, $iniFile)

loadCache(bool $reset = true, bool $placement = false)

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.

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

parseFile($file, $placement = false)

resetCache()

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

reset()

rootDir()

array overrideDirs(string|null|false $scope = null)

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.

static array globalOverrideDirs(string|false|null $scope = null)

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.

static array defaultOverrideDirs()

Default override directories as raw array data

setOverrideDirs(array $newDirs, string|false $scope = false)

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.

static  resetGlobalOverrideDirs()

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

resetOverrideDirs()

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

bool removeOverrideDir(string $identifier, string $scope = 'extension')

Removes an override dir by identifier See {@link eZINI::defaultOverrideDirs()} for how these parameters are used.

bool prependOverrideDir(string $dir, bool $globalDir = false, string|false $identifier = false, string|null $scope = null)

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

bool appendOverrideDir(string $dir, bool $globalDir = false, string|false $identifier = false, string|null $scope = null)

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

assign($blockName, $varName, $variable)

mixed variable(string $blockName, string $varName)

Reads a variable from the ini file.

false|array variableMulti(string $blockName, string $varNames, array $signatures = array())

Reads multiple variables from the ini file.

bool hasVariable(string $blockName, string $varName)

Checks if a variable is set.

boolean hasSection($sectionName)

Checks if the group $blockName exists

isVariableModified($blockName, $varName)

array variableArray(string $blockName, string $varName)

Reads a variable from the ini file or injected settings.

boolean hasGroup(string $blockName)

Checks if the group $blockName exists

array group(string $blockName)

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

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

removeGroup($blockName)

removeSetting($blockName, $settingName)

array groups()

Fetches all defined groups and returns them as an associative array

groupPlacements()

string findSettingPlacement(string $path)

Gives you the location of a ini file based on it's path, format is same as used internally for $identifer for override dirs- Eg: default / ext-siteaccess: / siteaccess / extension: / override / injected

settingType($settingValue)

setGroups($groupArray)

setVariables($variables)

setVariable($blockName, $variableName, $variableValue)

array getNamedArray()

Returns BlockValues, which is a nicely named Array

setReadOnlySettingsCheck($readOnly = true)

readOnlySettingsCheck()

Details

at line 141
public eZINI(string $fileName = 'site.ini', string $rootDir = '', null|bool $useTextCodec = null, null|bool $useCache = null, null|bool $useLocalOverrides = null, bool $directAccess = false, bool $addArrayDefinition = false, bool $load = true)

Initialization of eZINI object

Enter description here ...

Parameters

string $fileName
string $rootDir
null|bool $useTextCodec
null|bool $useCache
null|bool $useLocalOverrides
bool $directAccess
bool $addArrayDefinition
bool $load @since 4.5 Lets you disable automatic loading of ini values in cases where changes on instance will be done first.

at line 199
public filename()

at line 342
public load(bool $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.

Parameters

bool $reset Reset ini values on instance

at line 361
public loadPlacement(bool $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.

Parameters

bool $reset Reset ini values on instance

at line 399
public findInputFiles($inputFiles, $iniFile)

Parameters

$inputFiles
$iniFile

at line 507
public loadCache(bool $reset = true, bool $placement = false)

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.

Parameters

bool $reset Reset ini values on instance
bool $placement Load cache for placment info, not the ini values themself.

at line 680
public parse($inputFiles = false, $iniFile = false, $reset = true, $placement = false)

Parameters

$inputFiles
$iniFile
$reset
$placement

at line 706
public parseFile($file, $placement = false)

Parameters

$file
$placement

at line 854
public resetCache()

at line 869
public save($fileName = false, $suffix = false, $useOverride = false, $onlyModified = false, $useRootDir = true, $resetArrays = false, $encapsulateInPHP = true)

Parameters

$fileName
$suffix
$useOverride
$onlyModified
$useRootDir
$resetArrays
$encapsulateInPHP

at line 1069
public reset()

at line 1080
public rootDir()

at line 1094
public array overrideDirs(string|null|false $scope = null)

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.

Parameters

string|null|false $scope 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.

Return Value

array

at line 1113
static public array globalOverrideDirs(string|false|null $scope = null)

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.

Parameters

string|false|null $scope 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.

Return Value

array

at line 1152
static public array defaultOverrideDirs()

Default override directories as raw array data

Return Value

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.

at line 1170
public setOverrideDirs(array $newDirs, string|false $scope = false)

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.

Parameters

array $newDirs
string|false $scope See {@link eZINI::defaultOverrideDirs()} for possible scope values

at line 1190
static public resetGlobalOverrideDirs()

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

at line 1198
public resetOverrideDirs()

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

at line 1211
public bool removeOverrideDir(string $identifier, string $scope = 'extension')

Removes an override dir by identifier See {@link eZINI::defaultOverrideDirs()} for how these parameters are used.

Parameters

string $identifier Will remove existing directory with identifier it it exists
string $scope By default 'extension'

Return Value

bool True if new dir was appended, false if there was a $identifier match and a overwrite

at line 1252
public bool prependOverrideDir(string $dir, bool $globalDir = false, string|false $identifier = false, string|null $scope = null)

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.

Parameters

string $dir
bool $globalDir
string|false $identifier Will overwrite existing directory with same identifier if set
string|null $scope

Return Value

bool True if new dir was prepended, false if there was a $identifier match and a overwrite

at line 1296
public bool appendOverrideDir(string $dir, bool $globalDir = false, string|false $identifier = false, string|null $scope = null)

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.

Parameters

string $dir
bool $globalDir
string|false $identifier Will overwrite existing directory with same identifier if set
string|null $scope

Return Value

bool True if new dir was appended, false if there was a $identifier match and a overwrite

at line 1363
public assign($blockName, $varName, $variable)

Parameters

$blockName
$varName
$variable

at line 1381
public mixed variable(string $blockName, string $varName)

Reads a variable from the ini file.

Returns false, if the variable was not found.

Parameters

string $blockName
string $varName

Return Value

mixed

at line 1404
public false|array variableMulti(string $blockName, string $varNames, array $signatures = array())

Reads multiple variables from the ini file.

Returns false, if the block does not exist.

Parameters

string $blockName
string $varNames
array $signatures

Return Value

false|array

at line 1452
public bool hasVariable(string $blockName, string $varName)

Checks if a variable is set.

Parameters

string $blockName
string $varName

Return Value

bool

at line 1465
public boolean hasSection($sectionName)

Checks if the group $blockName exists

Parameters

$sectionName

Return Value

boolean

at line 1474
public isVariableModified($blockName, $varName)

Parameters

$blockName
$varName

at line 1488
public array variableArray(string $blockName, string $varName)

Reads a variable from the ini file or injected settings.

The variable will be returned as an array. ; is used as delimiter.

Parameters

string $blockName
string $varName

Return Value

array

at line 1520
public boolean hasGroup(string $blockName)

Checks if the group $blockName exists

Parameters

string $blockName

Return Value

boolean

at line 1533
public array group(string $blockName)

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

Parameters

string $blockName

Return Value

array

at line 1556
public isSettingReadOnly($fileName = false, $blockName = false, $settingName = false)

Parameters

$fileName
$blockName
$settingName

at line 1584
public removeGroup($blockName)

Parameters

$blockName

at line 1590
public removeSetting($blockName, $settingName)

Parameters

$blockName
$settingName

at line 1605
public array groups()

Fetches all defined groups and returns them as an associative array

Return Value

array

at line 1640
public groupPlacements()

at line 1658
public string findSettingPlacement(string $path)

Gives you the location of a ini file based on it's path, format is same as used internally for $identifer for override dirs- Eg: default / ext-siteaccess: / siteaccess / extension: / override / injected

Parameters

string $path

Return Value

string

at line 1702
public settingType($settingValue)

Parameters

$settingValue

at line 1725
public setGroups($groupArray)

Parameters

$groupArray

at line 1751
public setVariables($variables)

Parameters

$variables

at line 1769
public setVariable($blockName, $variableName, $variableValue)

Parameters

$blockName
$variableName
$variableValue

at line 1783
public array getNamedArray()

Returns BlockValues, which is a nicely named Array

Return Value

array

at line 1878
public setReadOnlySettingsCheck($readOnly = true)

Parameters

$readOnly

at line 1886
public readOnlySettingsCheck()