Class \Scrivo\Config

Class to hold Scrivo configuration data.

Scrivo configuration data is stored in instances of this class. Scrivo configuration data comes from two different sources:

  • Default configuration data: entries that always exist and which have values that can be overwritten by entries in the Scrivo configuration file.
  • Optional configuration data: all entries in the Scrivo configuration file that are no part of the default set will also become members of the configuration class.

There are also id-label pairs: certain id's can be labbelled in the database, this configuration data can be accessed through the class \Scrivo\IdLabel.

When instantiating this class it will search up the directory tree for a Scrivo config file named ".htscrivo". Alternatively you can specify a file when instantiating a configuration data object.

Note that only string and numeric values can be specified. These will be converted to a \Scrivo\String, int or float value. It is not possible to specify boolean values due to limitations of the php function parse_ini_file. So also note that specifing values like true, false, yes, no, on and off without quotes might not give you the expected results. When you need boolean values it is preferred to use the numeric values 0 or 1.

Defined in: Config.php.


Constructor summary

Attr. Name / Description
public

Config($path)

Create a configuration data object.

Properties

Attr. Type Name Description
read-only \..\String $ADMIN_IP_ADDRESSES
read-only \..\String $CACHE_DIR
read-only int $CACHE_DIR_GC
read-only \..\String $CACHE_TYPE
read-only \..\String $DB_API
read-only int $HTML_TIDY
read-only \..\String $HTTP_PROTOCOL
read-only int $JS_DEBUG
read-only \..\String $KEY_PREFIX
read-only int $ROOT_FOLDER_ID
read-only int $ROOT_PAGE_ID
read-only \..\String $SESSION_PREFIX
read-only \..\String $UI_LANG
read-only \..\String $WEBSERVICE_SPELL
read-only \..\String $WEBSERVICE_TIDY

Member summary

Attr. Type Name Description
protected array $ini Array to hold all data from the config file.

Method summary

Attr. Type Name / Description
public \..\String

__get($name)

Accessor method for configuration data members.

public boolean

__isset($name)

Test if a particular property was set.

private int

convertStr($val)

Convert a string read from an ini file to its most likely type.

private string

findConfigFile($cfgFile)

Try to find a Scrivo config file higher up the directory tree.

 


Constructor

public Config(\Scrivo\String $path=null)

Create a configuration data object.

As input the constructor will look for an Scrivo config file at expected locations or at an alternative location if provided.

Parameters:

Type Name Def. Description
\Scrivo\String $path null

If you don't want/can't use the standard Scrivo configuration file you can provide the location of an alternative file.


Members


				
protected array $ini

Array to hold all data from the config file.


Methods

public \Scrivo\String __get(string $name)

Accessor method for configuration data members.

Parameters:

Type Name Def. Description
string $name

The configuration property name to retrieve for which to retrieve it's value.

Returns:

\Scrivo\String Accessor method for configuration data members.

public boolean __isset(string $name)

Test if a particular property was set.

Parameters:

Type Name Def. Description
string $name

The name of the configuration property to test.

Returns:

boolean Test if a particular property was set.

private int convertStr(string $val)

Convert a string read from an ini file to its most likely type.

Parameters:

Type Name Def. Description
string $val

The value read from the ini file.

Returns:

int Convert a string read from an ini file to its most likely type.

private string findConfigFile(string $cfgFile)

Try to find a Scrivo config file higher up the directory tree.

Parameters:

Type Name Def. Description
string $cfgFile

The name of the configuration file to locate.

Returns:

string Try to find a Scrivo config file higher up the directory tree.


Documentation generated by phpDocumentor 2.0.0a12 and ScrivoDocumentor on August 29, 2013