1
0
mirror of https://github.com/pierre42100/ComunicAPI synced 2025-07-07 10:32:54 +00:00
Files
3rdparty
RestControllers
bin
classes
components
models
.htaccess
APIClients.php
Components.php
DBLibrary.php
URLanalyzer.php
comunicAPI.php
config.php
config
functions
helpers
.gitignore
.htaccess
LICENSE
README.md
db_struct.sql
index.php
init.php
ComunicAPI/classes/config.php
2017-05-17 14:01:36 +02:00

49 lines
1.1 KiB
PHP

<?php
/**
* Main configuration object
*
* @author Pierre HUBERT
*/
class config{
/**
* @var Array $config Configuration informations
*/
private $config = array();
/**
* Public constructor
*/
public function __construct(){
//Does nothing now
}
/**
* Set a new configuration value
*
* @param String $name The name of the configuration element
* @param Mixed $value The value of the configuration element
* @return Boolean True for a success
*/
public function set($name, $value){
//Set the new value
$this->config[$name] = $value;
//Success
return true;
}
/**
* Get a configuration value
*
* @param String $name The name of the required value
* @return Mixed False if the value doesn't exists otherwise the value is returned
*/
public function get($name){
if(isset($this->config[$name]))
return $this->config[$name];
else
return false; // The value doesn't exists
}
}