|
| | __construct (array $prm=array()) |
| |
| | __toString () |
| |
| | checkCfg ($throw=true) |
| |
| | init (array $prm) |
| |
| | overInit (array $prm) |
| |
| | overload ($className, $parent=false) |
| |
| & | getVars () |
| |
| | get ($name) |
| |
| | getInArray ($name, $key) |
| |
| | __get ($name) |
| |
| & | getRef ($name) |
| |
| | getAll () |
| |
| | setA (array $vars) |
| |
| | setARef (array $vars) |
| |
| | set ($name, $val) |
| |
| | setInArray ($name, $key, $val) |
| |
| | setInArrayA ($name, array $values) |
| |
| | setRef ($name, &$val) |
| |
| | __set ($name, $val) |
| |
| | check ($name) |
| |
| | checkInArray ($name, $key) |
| |
| | __isset ($name) |
| |
| | del ($name) |
| |
| | delInArray ($name, $key) |
| |
| | __unset ($name) |
| |
|
| static | initTab (array &$vars, array $init) |
| |
| static | initTabNum (array &$vars, array $varsNum, $nameOther='other', $rtl=true) |
| |
Configuration for all the class
Definition at line 10 of file config.class.php.
◆ __construct()
| __construct |
( |
array |
$prm = array() | ) |
|
Initialize the configuration variables
- Parameters
-
| array | $prm | Initial variables |
Definition at line 26 of file config.class.php.
◆ __get()
Get a configuration variable, with a convenient way $config->name
- Parameters
-
| string | $name | Value requested |
- Returns
- mixed The value requested, null if it doesn't exists
- See also
- get
Definition at line 163 of file config.class.php.
◆ __isset()
Check if a variable is set, with a convenient way isset($config->name)
- Parameters
-
| string | $name | variable name to check |
- Returns
- bool
- See also
- check
Definition at line 298 of file config.class.php.
◆ __set()
Set a variable, with a convenient way $config->name = $value
- Parameters
-
| string | $name | Name to set |
| mixed | $value | Value to set |
- See also
- set
Definition at line 266 of file config.class.php.
◆ __toString()
- Returns
- string Configuration in string to debug
Definition at line 33 of file config.class.php.
◆ __unset()
Delete a variable, with a convenient way unset($config->name)
- Parameters
-
| string | $name | Variable name to delete |
- See also
- del
Definition at line 329 of file config.class.php.
◆ check()
check if a variable is set
- Parameters
-
| string | $name | variable name to check |
- Returns
- bool
Definition at line 276 of file config.class.php.
◆ checkCfg()
| checkCfg |
( |
|
$throw = true | ) |
|
Check if the configuration has all the required field
- Parameters
-
| bool | $trow | True to throw exception instead of only return false |
- Returns
- bool True if good
- Exceptions
-
| nException | If argument missing and parameter $throw set to true |
Definition at line 44 of file config.class.php.
◆ checkInArray()
| checkInArray |
( |
|
$name, |
|
|
|
$key |
|
) |
| |
check if a variable is set in an array
- Parameters
-
| string | $name | variable name to check |
| string | $key | Key on the array |
- Returns
- bool
Definition at line 287 of file config.class.php.
◆ del()
Delete a variable
- Parameters
-
| string | $name | Variable name to delete |
Definition at line 307 of file config.class.php.
◆ delInArray()
| delInArray |
( |
|
$name, |
|
|
|
$key |
|
) |
| |
Delete a variable to the config in an array
- Parameters
-
| string | $name | Variable name |
| string | $key | Key on the array |
Definition at line 318 of file config.class.php.
◆ get()
Get a variable
- Parameters
-
- Returns
- mixed|null The value requested if exists or null
- See also
- getRef
Definition at line 136 of file config.class.php.
◆ getAll()
Get the whole configuration array
- Returns
- array
Definition at line 188 of file config.class.php.
◆ getInArray()
| getInArray |
( |
|
$name, |
|
|
|
$key |
|
) |
| |
Get a variable inside an array
- Parameters
-
| string | $name | Variable name |
| string | $key | Key requested |
- Returns
- mixed|null The value requested if exists or null
Definition at line 150 of file config.class.php.
◆ getRef()
Get a variable by reference
- Parameters
-
- Returns
- mixed The value requested if exists or null
- See also
- get
Definition at line 174 of file config.class.php.
◆ getVars()
Get all the actual configuration
- Returns
- array The configuration
Definition at line 125 of file config.class.php.
◆ init()
Create and verify all the variables needed for this config. A required variable is indicate by a value null
- Parameters
-
| array | $prm | All the variables needed for this config |
- Exceptions
-
| nExecption | If one required parameter isn't present |
Definition at line 70 of file config.class.php.
◆ initTab()
| static initTab |
( |
array & |
$vars, |
|
|
array |
$init |
|
) |
| |
|
static |
Initialize an array with an init array. Return a boolean to indicate if all required variable are present. A required variable is indicate by a value null
- Parameters
-
| array | $vars | Variable array to initialize |
| array | $init | Init array |
- Returns
- bool True if all required variables are present
Definition at line 342 of file config.class.php.
◆ initTabNum()
| static initTabNum |
( |
array & |
$vars, |
|
|
array |
$varsNum, |
|
|
|
$nameOther = 'other', |
|
|
|
$rtl = true |
|
) |
| |
|
static |
Transform a numeric array to a string key array
- Parameters
-
| array | $vars | Variable array to transfer |
| array | $varsNum | Numeric Array to indicate the key |
| string | $nameOther | Name for value non indicate in the $varsNum array, if needed |
| bool | $rtl | True to init Right to Left or false to init Left to Right |
Definition at line 362 of file config.class.php.
◆ overInit()
Add to the actual config by merge (array) or create an array with the initial variable followed by the adding elements
- Parameters
-
| array | $prm | All the variables to add |
Definition at line 91 of file config.class.php.
◆ overload()
| overload |
( |
|
$className, |
|
|
|
$parent = false |
|
) |
| |
Overload a config from an other class. The class could not exists
- Parameters
-
| string | $className | |
| bool | $parent | Indicate if the search should load the parent config (if virtual, should be false!) |
Definition at line 116 of file config.class.php.
◆ set()
◆ setA()
Set an array of variable to the config
- Parameters
-
| array | $vars | Variables to set |
- See also
- set
Definition at line 198 of file config.class.php.
◆ setARef()
Set an array of variable to the config by reference
- Parameters
-
| array | $vars | Variables to set |
- See also
- setRef
Definition at line 209 of file config.class.php.
◆ setInArray()
| setInArray |
( |
|
$name, |
|
|
|
$key, |
|
|
|
$val |
|
) |
| |
Set a variable to the config in an array
- Parameters
-
| string | $name | Variable name |
| string | $key | Key on the array |
| mixed | $val | Value |
- See also
- setA,setRef,setARef
Definition at line 233 of file config.class.php.
◆ setInArrayA()
| setInArrayA |
( |
|
$name, |
|
|
array |
$values |
|
) |
| |
Set variables to the config in an array
- Parameters
-
| string | $name | Variable name |
| array | $values | the Values |
- See also
- setInArray
Definition at line 244 of file config.class.php.
◆ setRef()
Set a variable to the config by reference
- Parameters
-
| string | $name | Variable name |
| mixed | $val | Value |
- See also
- setARef,set,setA
Definition at line 255 of file config.class.php.
◆ $vars
◆ REQUIRED
| const REQUIRED = 'REQUIRED' |
The documentation for this class was generated from the following file: