OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Core\ConfigFile Class Reference

Public Member Functions

 __construct ($fileName)
 
 getVar ($varName)
 
 setVar ($varName, $value)
 
 isVarSet ($varName)
 
 getVars ()
 
 setFile ($fileName)
 

Private Member Functions

 _loadVars ($fileName)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

OxidEsales\EshopCommunity\Core\ConfigFile::__construct (   $fileName)

Initializes the instance. Loads config variables from the file.

Parameters
string$fileNameConfiguration file name

Member Function Documentation

◆ _loadVars()

OxidEsales\EshopCommunity\Core\ConfigFile::_loadVars (   $fileName)
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$fileNameConfiguration file name

◆ getVar()

OxidEsales\EshopCommunity\Core\ConfigFile::getVar (   $varName)

Returns loaded variable value by name.

Parameters
string$varNameVariable name
Returns
mixed

◆ getVars()

OxidEsales\EshopCommunity\Core\ConfigFile::getVars ( )

Returns all loaded vars as an array

Returns
array[string]mixed

◆ isVarSet()

OxidEsales\EshopCommunity\Core\ConfigFile::isVarSet (   $varName)

Checks by name if variable is set

Parameters
string$varNameVariable name
Returns
bool

◆ setFile()

OxidEsales\EshopCommunity\Core\ConfigFile::setFile (   $fileName)

Sets custom config file to include

Parameters
string$fileNamecustom configuration file name

◆ setVar()

OxidEsales\EshopCommunity\Core\ConfigFile::setVar (   $varName,
  $value 
)

Set config variable.

Parameters
string$varNameVariable name
string$valueVariable value

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