PHP Class Jelix\Core\Config\Compiler

Show file Open project: jelix/jelix Class Usage Examples

Protected Properties

Property Type Description
$commonConfig
$config StdClass
$configFileName
$isCli
$modulesInfos Jelix\Core\Infos\ModuleInfos[]
$pseudoScriptName

Public Methods

Method Description
__construct ( string $configFile = '', string $pseudoScriptName = '', boolean $isCli = null )
findServerName ( $ext = '.php', $isCli = false )
getModulesInfos ( )
read ( boolean $allModuleInfo = false, array $additionalOptions = null ) : StdClass read the ini file given to the constructor. It Merges it with the content of mainconfig.ini.php. It also calculates some options.
readAndCache ( ) : object Identical to read(), but also stores the result in a temporary file

Protected Methods

Method Description
_loadModulesInfo ( object $config, boolean $allModuleInfo ) : Jelix\Core\Infos\ModuleInfos[] Find all activated modules and check their status
_loadPluginsPathList ( object $config ) Analyse plugin paths
_readModuleInfo ( $config, $allModuleInfo, $path, &$installation, $section ) : Jelix\Core\Infos\ModuleInfos
checkCoordPluginsPath ( $config )
checkMiscParameters ( $config )
getPaths ( array &$urlconf, $pseudoScriptName = '', $isCli = false ) calculate miscelaneous path, depending of the server configuration and other informations in the given array : script path, script name, documentRoot .
prepareConfig ( boolean $allModuleInfo ) fill some config properties with calculated values
readConfigFiles ( $configFile, $additionalOptions )
runConfigCompilerPlugins ( StdClass $config, Jelix\Core\Infos\ModuleInfos[] $modules )

Method Details

__construct() public method

public __construct ( string $configFile = '', string $pseudoScriptName = '', boolean $isCli = null )
$configFile string the name and path of the config file related to config dir of the app
$pseudoScriptName string the name of the entry point, relative to the base path, corresponding to the readed configuration. It should start with a leading / for non cli script.
$isCli boolean indicate if the configuration to read is for a CLI script or no

_loadModulesInfo() protected method

Find all activated modules and check their status
protected _loadModulesInfo ( object $config, boolean $allModuleInfo ) : Jelix\Core\Infos\ModuleInfos[]
$config object the config object
$allModuleInfo boolean may be true for the installer, which needs all informations else should be false, these extra informations are not needed to run the application
return Jelix\Core\Infos\ModuleInfos[]

_loadPluginsPathList() protected method

Analyse plugin paths
protected _loadPluginsPathList ( object $config )
$config object the config container

_readModuleInfo() protected method

protected _readModuleInfo ( $config, $allModuleInfo, $path, &$installation, $section ) : Jelix\Core\Infos\ModuleInfos
return Jelix\Core\Infos\ModuleInfos

checkCoordPluginsPath() protected method

protected checkCoordPluginsPath ( $config )

checkMiscParameters() protected method

protected checkMiscParameters ( $config )

findServerName() public static method

public static findServerName ( $ext = '.php', $isCli = false )

getModulesInfos() public method

public getModulesInfos ( )

getPaths() protected method

.
protected getPaths ( array &$urlconf, $pseudoScriptName = '', $isCli = false )
$urlconf array urlengine configuration. scriptNameServerVariable, basePath, jelixWWWPath and jqueryPath should be present

prepareConfig() protected method

fill some config properties with calculated values
protected prepareConfig ( boolean $allModuleInfo )
$allModuleInfo boolean may be true for the installer, which needs all informations else should be false, these extra informations are not needed to run the application

read() public method

If you are in a CLI script but you want to load a configuration file for a web entry point or vice-versa, you need to indicate the $pseudoScriptName parameter with the name of the entry point
public read ( boolean $allModuleInfo = false, array $additionalOptions = null ) : StdClass
$allModuleInfo boolean may be true for the installer, which needs all informations else should be false, these extra informations are not needed to run the application
$additionalOptions array some options to add to the configuration
return StdClass an object which contains configuration values

readAndCache() public method

Identical to read(), but also stores the result in a temporary file
public readAndCache ( ) : object
return object an object which contains configuration values

readConfigFiles() protected method

protected readConfigFiles ( $configFile, $additionalOptions )

runConfigCompilerPlugins() protected method

protected runConfigCompilerPlugins ( StdClass $config, Jelix\Core\Infos\ModuleInfos[] $modules )
$config StdClass
$modules Jelix\Core\Infos\ModuleInfos[]

Property Details

$commonConfig protected property

protected $commonConfig

$config protected property

protected StdClass $config
return StdClass

$configFileName protected property

protected $configFileName

$isCli protected property

protected $isCli

$modulesInfos protected property

protected ModuleInfos[],Jelix\Core\Infos $modulesInfos
return Jelix\Core\Infos\ModuleInfos[]

$pseudoScriptName protected property

protected $pseudoScriptName