lib/ezutils/classes/ezini.php

Show: inherited
Table of Contents

\eZINI

Package:

Constants

Constantbool  DEBUG_INTERNALS = false

Constant to signal ini debug mode for ini development

bool
Constantstring  CONFIG_CACHE_DIR = 'var/cache/ini/'

Constant path to directory for configuration cache

string
Constantint  CONFIG_CACHE_REV = 2

Constant integer to check against configuration cache format revision

int

Properties

Propertypublic  $AddArrayDefinition= ''
Details
Type
n/a
Propertypublic  $BlockValues= ''
Details
Type
n/a
Propertypublic  $BlockValuesPlacement= ''
Details
Type
n/a
Propertypublic  $CacheFile= ''
Details
Type
n/a
Propertypublic  $Charset= ''
Details
Type
n/a
Propertypublic  $Codec= ''
Details
Type
n/a
Propertypublic  $DirectAccess= ''
Details
Type
n/a
Propertypublic  $FileName= ''
Details
Type
n/a
Propertyprotected  $GlobalOverrideDirArray= 'null'
static
Default valuenullDetails
Type
n/a
Propertypublic  $LocalOverrideDirArray= ''
Details
Type
n/a
Propertypublic  $ModifiedBlockValues= ''
Details
Type
n/a
Propertypublic  $PlacementCacheFile= ''
Details
Type
n/a
Propertypublic  $ReadOnlySettingsCheck= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $RootDir= ''
Details
Type
n/a
Propertypublic  $UseCache= ''
Details
Type
n/a
Propertypublic  $UseLocalOverrides= ''
Details
Type
n/a
Propertypublic  $UseTextCodec= ''
Details
Type
n/a
Propertyprotected  $checkFileMtime= 'null'
static
Default valuenullDetails
Type
n/a
Propertyprotected  $filePermission= 'null'
static
Default valuenullDetails
Type
n/a

Methods

methodpublicappendOverrideDir( 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.

Parameters
Name Type Description
$dir string
$globalDir bool
$identifier string | false

Will overwrite existing directory with same identifier if set

$scope string | null
Returns
Type Description
bool True if new dir was appended, false if there was a $identifier match and a overwrite
methodpublicassign(  $blockName,  $varName,  $variable ) : void

Parameters
Name Type Description
$blockName
$varName
$variable
methodprotectedcacheFileName(  $placement = false ) : void

Parameters
Name Type Description
$placement
methodpubliccreate(  $fileName = 'site.ini',  $rootDir = 'settings',  $useTextCodec = null,  $useCache = null,  $useLocalOverrides = null ) : void
static

Parameters
Name Type Description
$fileName
$rootDir
$useTextCodec
$useCache
$useLocalOverrides
methodpublicdefaultOverrideDirs( ) : array
static

Default override directories as raw array data

Returns
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.
methodpubliceZINI(  $fileName = 'site.ini',  $rootDir = '',  $useTextCodec = null,  $useCache = null,  $useLocalOverrides = null,  $directAccess = false,  $addArrayDefinition = false ) : void

Parameters
Name Type Description
$fileName
$rootDir
$useTextCodec
$useCache
$useLocalOverrides
$directAccess
$addArrayDefinition
methodpublicexists(  $fileName = "site.ini",  $rootDir = "settings" ) : void
static

Parameters
Name Type Description
$fileName
$rootDir
methodpublicfetchFromFile(  $fileName,  $useTextCodec = null ) : void
static

Parameters
Name Type Description
$fileName
$useTextCodec
methodpublicfilename( ) : void

methodpublicfindInputFiles(  $inputFiles,  $iniFile ) : void

Parameters
Name Type Description
$inputFiles
$iniFile
methodpublicfindSettingPlacement(  $path ) : void

Parameters
Name Type Description
$path
methodpublicgetNamedArray( ) : void

methodpublicgetSiteAccessIni( string $siteAccess, string $iniFile ) : \eZINI
static

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.

Parameters
Name Type Description
$siteAccess string
$iniFile string
Returns
Type Description
\eZINI
methodpublicglobalOverrideDirs( string | false | null $scope = null ) : array
static

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
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.

Returns
Type Description
array
methodpublicgroup(  $blockName ) : void

Parameters
Name Type Description
$blockName
methodpublicgroupPlacements( ) : void

methodpublicgroups( ) : void

methodpublichasGroup(  $blockName ) : void

Parameters
Name Type Description
$blockName
methodpublichasSection(  $sectionName ) : void

Parameters
Name Type Description
$sectionName
methodpublichasVariable(  $blockName,  $varName ) : void

Parameters
Name Type Description
$blockName
$varName
methodpublicinstance( \$fileName $fileName = 'site.ini', \$rootDir $rootDir = 'settings', \$useTextCodec $useTextCodec = null, \$useCache $useCache = null, \$useLocalOverrides $useLocalOverrides = null, \$directAccess $directAccess = false, \$addArrayDefinition $addArrayDefinition = false ) : \eZINI
static

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.

Parameters
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

Returns
Type Description
\eZINI
methodpublicisCacheEnabled( ) : void
static

methodpublicisDebugEnabled( ) : void
static

methodpublicisLoaded(  $fileName = 'site.ini',  $rootDir = 'settings',  $useLocalOverrides = null ) : void
static

Parameters
Name Type Description
$fileName
$rootDir
$useLocalOverrides
methodpublicisNoCacheAdviced( ) : void

methodpublicisSettingReadOnly(  $fileName = false,  $blockName = false,  $settingName = false ) : void

Parameters
Name Type Description
$fileName
$blockName
$settingName
methodpublicisTextCodecEnabled( ) : void
static

methodpublicisVariableModified(  $blockName,  $varName ) : void

Parameters
Name Type Description
$blockName
$varName
methodpublicload(  $reset = true ) : void

Parameters
Name Type Description
$reset
methodpublicloadCache(  $reset = true,  $placement = false ) : void

Parameters
Name Type Description
$reset
$placement
methodpublicloadPlacement(  $reset = true ) : void

Parameters
Name Type Description
$reset
methodpublicoverrideDirs( 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.

Parameters
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.

Returns
Type Description
array
methodprotectedoverrideDirsByScope( array $dirs, string | null | false $scope = null ) : array
static

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
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.

Returns
Type Description
array
methodpublicparameterSet( string $fileName = 'site.ini', string $rootDir = 'settings', string $section, string $parameter ) : bool
static

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

Parameters
Name Type Description
$fileName string

fileName file name (optional)

$rootDir string

rootDir directory (optional)

$section string

section section name

$parameter string

parameter parameter name

Returns
Type Description
bool True if the the parameter is set.
Details
Deprecated
Since 4.4  
methodpublicparse(  $inputFiles = false,  $iniFile = false,  $reset = true,  $placement = false ) : void

Parameters
Name Type Description
$inputFiles
$iniFile
$reset
$placement
methodpublicparseFile(  $file,  $placement = false ) : void

Parameters
Name Type Description
$file
$placement
methodpublicprependOverrideDir( 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.

Parameters
Name Type Description
$dir string
$globalDir bool
$identifier string | false

Will overwrite existing directory with same identifier if set

$scope string | null
Returns
Type Description
bool True if new dir was prepended, false if there was a $identifier match and a overwrite
methodpublicreadOnlySettingsCheck( ) : void

methodpublicremoveGroup(  $blockName ) : void

Parameters
Name Type Description
$blockName
methodpublicremoveOverrideDir( string $identifier, string $scope = 'extension' ) : bool

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

Parameters
Name Type Description
$identifier string

Will remove existing directory with identifier it it exists

$scope string

By default 'extension'

Returns
Type Description
bool True if new dir was appended, false if there was a $identifier match and a overwrite
methodpublicremoveSetting(  $blockName,  $settingName ) : void

Parameters
Name Type Description
$blockName
$settingName
methodpublicreset( ) : void

methodpublicresetAllGlobals(  $resetGlobalOverrideDirs = true ) : void
static

Reset all eZINI instances as well override dirs ( optional )

Parameters
Name Type Description
$resetGlobalOverrideDirs
methodpublicresetCache( ) : void

methodpublicresetGlobalOverrideDirs( ) : void
static

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

methodpublicresetGlobals(  $fileName = 'site.ini',  $rootDir = 'settings',  $useLocalOverrides = null ) : void
static

Parameters
Name Type Description
$fileName
$rootDir
$useLocalOverrides
methodpublicresetOverrideDirs( ) : void

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

methodpublicrootDir( ) : void

methodpublicsave(  $fileName = false,  $suffix = false,  $useOverride = false,  $onlyModified = false,  $useRootDir = true,  $resetArrays = false,  $encapsulateInPHP = true ) : void

Parameters
Name Type Description
$fileName
$suffix
$useOverride
$onlyModified
$useRootDir
$resetArrays
$encapsulateInPHP
methodprotectedsaveCache( string $cachedDir, string $cachedFile, array $data, array $inputFiles, string $iniFile ) : bool

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

Parameters
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

Returns
Type Description
bool
methodprotectedselectOverrideScope( string | null $scope, string $identifier, string $dir, string $default ) : string
static

Function to handle bc with code from pre 4.4 that does not know about scopes

Parameters
Name Type Description
$scope string | null
$identifier string
$dir string
$default string
Returns
Type Description
string
Details
Since
4.4  
methodpublicsetGroups(  $groupArray ) : void

Parameters
Name Type Description
$groupArray
methodpublicsetIsCacheEnabled(  $cache ) : void
static

Parameters
Name Type Description
$cache
methodpublicsetIsDebugEnabled(  $debug ) : void
static

Parameters
Name Type Description
$debug
methodpublicsetIsTextCodecEnabled(  $codec ) : void
static

Parameters
Name Type Description
$codec
methodpublicsetOverrideDirs( 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.

Parameters
Name Type Description
$newDirs array
$scope string | false

See {@link eZINI::defaultOverrideDirs()} for possible scope values

methodpublicsetReadOnlySettingsCheck(  $readOnly = true ) : void

Parameters
Name Type Description
$readOnly
methodpublicsetVariable(  $blockName,  $variableName,  $variableValue ) : void

Parameters
Name Type Description
$blockName
$variableName
$variableValue
methodpublicsetVariables(  $variables ) : void

Parameters
Name Type Description
$variables
methodpublicsettingType(  $settingValue ) : void

Parameters
Name Type Description
$settingValue
methodpublicvariable(  $blockName,  $varName ) : void

Parameters
Name Type Description
$blockName
$varName
methodpublicvariableArray(  $blockName,  $varName ) : void

Parameters
Name Type Description
$blockName
$varName
methodpublicvariableMulti(  $blockName,  $varNames,  $signatures = array() ) : void

Parameters
Name Type Description
$blockName
$varNames
$signatures
Documentation was generated by DocBlox 0.18.1.