eZPublishCommunityProject  2013.6
eZ\Publish\Core\Base\Configuration\Parser\Ini Class Reference

Configuration Ini Parser / writer. More...

+ Inheritance diagram for eZ\Publish\Core\Base\Configuration\Parser\Ini:
+ Collaboration diagram for eZ\Publish\Core\Base\Configuration\Parser\Ini:

Public Member Functions

 __construct (array $settings)
 Construct an instance of Ini Parser. More...
 
 parse ($fileName, $fileContent)
 Parse file and return raw configuration data. More...
 
 write ($fileName, array $configurationData)
 Store raw configuration data to file. More...
 

Public Attributes

const TEMP_INI_FALSE_VAR = '__FALSE__'
 
const TEMP_INI_KEY_VAR = '__KEY__'
 
const TEMP_INI_QUOTE_VAR = '__QUOTE__'
 
const TEMP_INI_TRUE_VAR = '__TRUE__'
 

Protected Member Functions

 parseFileEzc ($fileContent)
 Parse configuration file using ezcConfigurationIniReader. More...
 
 parseFilePhp ($fileContent)
 Parse configuration file using parse_ini_string (only supported on php 5.3 and up) More...
 
 parserClearArraySupport ($fileContent)
 Common pre processing needed for both ezc and php parsers. More...
 
 parserPhpDimensionArraySupport ($fileContent)
 Pre processing needed for php ini parsers to support three dimensional arrays. More...
 
 parserPhpQuoteSupport ($fileContent)
 Pre processing needed for php ini parsers to support quotes in values. More...
 

Static Protected Member Functions

static parsePhpPostArrayFilter (array $array)
 Transform temporary array values the php equivalent to make sure parsed ini settings are the same as with ezcConfigurationIniReader. More...
 
static parsePhpPostFilter ($iniValue)
 Transform temporary values the php equivalent to make sure parsed ini settings are the same as with ezcConfigurationIniReader. More...
 

Protected Attributes

 $dirPermission = 0755
 
 $filePermission = 0644
 
 $strictMode = true
 

Detailed Description

Constructor & Destructor Documentation

eZ\Publish\Core\Base\Configuration\Parser\Ini::__construct ( array  $settings)

Construct an instance of Ini Parser.

Parameters
array$settings

Implements eZ\Publish\Core\Base\Configuration\Parser.

Member Function Documentation

eZ\Publish\Core\Base\Configuration\Parser\Ini::parse (   $fileName,
  $fileContent 
)

Parse file and return raw configuration data.

Todo:
Change impl to use exceptions instead of trigger_error in most cases
Parameters
string$fileNameA valid file name
string$fileContent
Returns
array

Implements eZ\Publish\Core\Base\Configuration\Parser.

eZ\Publish\Core\Base\Configuration\Parser\Ini::parseFileEzc (   $fileContent)
protected

Parse configuration file using ezcConfigurationIniReader.

Todo:
Change impl to use exceptions instead of trigger_error
Parameters
string$fileContent
Returns
array Data structure for parsed ini file

Referenced by eZ\Publish\Core\Base\Configuration\Parser\Ini\parse().

eZ\Publish\Core\Base\Configuration\Parser\Ini::parseFilePhp (   $fileContent)
protected

Parse configuration file using parse_ini_string (only supported on php 5.3 and up)

This parser is stricter then ezcConfigurationIniReader and does not support many of the ini files eZ Publish use because things like regex as ini variable and so on.

Parameters
string$fileContent
Returns
array|false Data structure for parsed ini file or false if it fails

Referenced by eZ\Publish\Core\Base\Configuration\Parser\Ini\parse().

static eZ\Publish\Core\Base\Configuration\Parser\Ini::parsePhpPostArrayFilter ( array  $array)
staticprotected

Transform temporary array values the php equivalent to make sure parsed ini settings are the same as with ezcConfigurationIniReader.

Deals specifically with post parse fixes for three dimensional arrays.

Parameters
array$array
Returns
array
static eZ\Publish\Core\Base\Configuration\Parser\Ini::parsePhpPostFilter (   $iniValue)
staticprotected

Transform temporary values the php equivalent to make sure parsed ini settings are the same as with ezcConfigurationIniReader.

Parameters
mixed$iniValue
Returns
mixed
eZ\Publish\Core\Base\Configuration\Parser\Ini::parserClearArraySupport (   $fileContent)
protected

Common pre processing needed for both ezc and php parsers.

Marks array clearing, so post parser code in Configuration::parse() can detect it

Parameters
string$fileContent
Returns
string

Referenced by eZ\Publish\Core\Base\Configuration\Parser\Ini\parseFileEzc(), and eZ\Publish\Core\Base\Configuration\Parser\Ini\parseFilePhp().

eZ\Publish\Core\Base\Configuration\Parser\Ini::parserPhpDimensionArraySupport (   $fileContent)
protected

Pre processing needed for php ini parsers to support three dimensional arrays.

Injects constants which is later cleaned up in parsePhpPostArrayFilter().

Parameters
string$fileContent
Returns
string

Referenced by eZ\Publish\Core\Base\Configuration\Parser\Ini\parseFilePhp().

eZ\Publish\Core\Base\Configuration\Parser\Ini::parserPhpQuoteSupport (   $fileContent)
protected

Pre processing needed for php ini parsers to support quotes in values.

Injects constants which is later cleaned up in parsePhpPostArrayFilter().

Parameters
string$fileContent
Returns
string

Referenced by eZ\Publish\Core\Base\Configuration\Parser\Ini\parseFilePhp().

eZ\Publish\Core\Base\Configuration\Parser\Ini::write (   $fileName,
array  $configurationData 
)

Store raw configuration data to file.

See Also
eZ::parse() For $configurationData definition
Todo:
Test..
Parameters
string$fileNameA valid file name, will be overwritten if it exists
array$configurationData

Implements eZ\Publish\Core\Base\Configuration\Parser.

Member Data Documentation

eZ\Publish\Core\Base\Configuration\Parser\Ini::$dirPermission = 0755
protected
eZ\Publish\Core\Base\Configuration\Parser\Ini::$filePermission = 0644
protected
eZ\Publish\Core\Base\Configuration\Parser\Ini::$strictMode = true
protected
const eZ\Publish\Core\Base\Configuration\Parser\Ini::TEMP_INI_FALSE_VAR = '__FALSE__'
const eZ\Publish\Core\Base\Configuration\Parser\Ini::TEMP_INI_KEY_VAR = '__KEY__'
const eZ\Publish\Core\Base\Configuration\Parser\Ini::TEMP_INI_QUOTE_VAR = '__QUOTE__'
const eZ\Publish\Core\Base\Configuration\Parser\Ini::TEMP_INI_TRUE_VAR = '__TRUE__'

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