Jelix 1.7.18

jConfigCompiler
in package

jConfigCompiler merge two ini file in a single array and store it in a temporary file This is a static class.

Tags
subpackage

core

static

Table of Contents

findServerName()  : mixed
getCacheFilename()  : string
return the path of file where to store the cache of the configuration.
getPaths()  : mixed
calculate miscellaneous path, depending of the server configuration and other information in the given array : script path, script name, documentRoot .
read()  : object
read the given ini file, for the current entry point, or for the entrypoint given in $pseudoScriptName. Merge it with the content of other config files It also calculates some options.
readAndCache()  : object
Identical to read(), but also stores the result in a temporary file.
_loadModuleInfo()  : mixed
Analyse and check the "lib:" and "app:" path.
_loadPluginsPathList()  : mixed
Analyse plugin paths.
checkCoordPluginsPath()  : mixed
checkMiscParameters()  : mixed
getCoordPluginConfValue()  : mixed
prepareConfig()  : mixed
fill some config properties with calculated values.
runConfigCompilerPlugins()  : mixed
__construct()  : mixed

Methods

findServerName()

public static findServerName([mixed $ext = '.php' ][, mixed $isCli = false ]) : mixed
Parameters
$ext : mixed = '.php'
$isCli : mixed = false
Return values
mixed

getCacheFilename()

return the path of file where to store the cache of the configuration.

public static getCacheFilename(string $configFile) : string
Parameters
$configFile : string

the name of the configuration file of the entry point into var/config/

Tags
since
1.6.26
Return values
string

the full path of the cache

getPaths()

calculate miscellaneous path, depending of the server configuration and other information in the given array : script path, script name, documentRoot .

public static getPaths(array<string|int, mixed> &$urlconf[, string $pseudoScriptName = '' ][, bool $isCli = false ]) : mixed

.

Parameters
$urlconf : array<string|int, mixed>

urlengine configuration. scriptNameServerVariable, basePath, jelixWWWPath and jqueryPath should be present

$pseudoScriptName : string = ''
$isCli : bool = false
Tags
throws
Exception
Return values
mixed

read()

read the given ini file, for the current entry point, or for the entrypoint given in $pseudoScriptName. Merge it with the content of other config files It also calculates some options.

public static read(string $configFile[, bool $allModuleInfo = false ][, bool $isCli = false ][, string $pseudoScriptName = '' ]) : object

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.

Merge of configuration files are made in this order:

  • core/defaultconfig.ini.php
  • app/system/mainconfig.ini.php
  • app/system/$configFile
  • var/config/localconfig.ini.php
  • var/config/$configFile
  • var/config/liveconfig.ini.php
Parameters
$configFile : string

the config file name

$allModuleInfo : bool = false

may be true for the installer, which needs all informations else should be false, these extra informations are not needed to run the application

$isCli : bool = false

indicate if the configuration to read is for a CLI script or no

$pseudoScriptName : string = ''

the name of the entry point, relative to the base path, corresponding to the readed configuration

Tags
throws
Exception
Return values
object

an object which contains configuration values

readAndCache()

Identical to read(), but also stores the result in a temporary file.

public static readAndCache(string $configFile[, bool $isCli = null ][, string $pseudoScriptName = '' ]) : object
Parameters
$configFile : string

the config file name

$isCli : bool = null
$pseudoScriptName : string = ''
Tags
throws
Exception
Return values
object

an object which contains configuration values

_loadModuleInfo()

Analyse and check the "lib:" and "app:" path.

protected static _loadModuleInfo(object $config, bool $allModuleInfo) : mixed
Parameters
$config : object

the config object

$allModuleInfo : bool

may be true for the installer, which needs all informations else should be false, these extra informations are not needed to run the application

Tags
throws
Exception
Return values
mixed

_loadPluginsPathList()

Analyse plugin paths.

protected static _loadPluginsPathList(object $config) : mixed
Parameters
$config : object

the config container

Return values
mixed

checkCoordPluginsPath()

protected static checkCoordPluginsPath(mixed $config) : mixed
Parameters
$config : mixed
Return values
mixed

checkMiscParameters()

protected static checkMiscParameters(mixed $config) : mixed
Parameters
$config : mixed
Return values
mixed

getCoordPluginConfValue()

protected static getCoordPluginConfValue(mixed $name, mixed $conf) : mixed
Parameters
$name : mixed
$conf : mixed
Return values
mixed

prepareConfig()

fill some config properties with calculated values.

protected static prepareConfig(object $config, bool $allModuleInfo, bool $isCli, string $pseudoScriptName) : mixed
Parameters
$config : object

the config object

$allModuleInfo : bool

may be true for the installer, which needs all informations else should be false, these extra informations are not needed to run the application

$isCli : bool

indicate if the configuration to read is for a CLI script or no

$pseudoScriptName : string

the name of the entry point, relative to the base path, corresponding to the readed configuration

Return values
mixed

runConfigCompilerPlugins()

protected static runConfigCompilerPlugins(mixed $config) : mixed
Parameters
$config : mixed
Return values
mixed

Search results