OXID eShop CE  4.9.7
 All Classes Files Functions Variables Pages
OxConfigFile Class Reference

Public Member Functions

 __construct ($sFileName)
 getVar ($sVarName)
 setVar ($sVarName, $sValue)
 isVarSet ($sVarName)
 getVars ()
 setFile ($sFileName)

Private Member Functions

 _loadVars ($sFileName)

Detailed Description

Wraps and provides getters for configuration constants stored in configuration file (usually config.inc.php).

Definition at line 6 of file oxconfigfile.php.

Constructor & Destructor Documentation

OxConfigFile::__construct (   $sFileName)

Initializes the instance. Loads config variables from the file.

Parameters
string$sFileNameConfiguration file name

Definition at line 27 of file oxconfigfile.php.

Member Function Documentation

OxConfigFile::_loadVars (   $sFileName)
private

Performs variable loading from configuration file by including the php file. It works with current configuration file format well, however in case the variable storage format is not satisfactory this method is a subject to be changed.

Parameters
string$sFileNameConfiguration file name

Definition at line 17 of file oxconfigfile.php.

OxConfigFile::getVar (   $sVarName)

Returns loaded variable value by name.

Parameters
string$sVarNameVariable name
Returns
mixed

Definition at line 39 of file oxconfigfile.php.

OxConfigFile::getVars ( )

Returns all loaded vars as an array

Returns
array[string]mixed

Definition at line 76 of file oxconfigfile.php.

OxConfigFile::isVarSet (   $sVarName)

Checks by name if variable is set

Parameters
string$sVarNameVariable name
Returns
bool

Definition at line 66 of file oxconfigfile.php.

OxConfigFile::setFile (   $sFileName)

Sets custom config file to include

Parameters
string$sFileNamecustom configuration file name

Definition at line 88 of file oxconfigfile.php.

OxConfigFile::setVar (   $sVarName,
  $sValue 
)

Set config variable.

Parameters
string$sVarNameVariable name
string$sValueVariable value

Definition at line 54 of file oxconfigfile.php.


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