mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-10-06 10:02:21 +02:00
remove empty or null values from the config-table
This commit is contained in:
parent
14bc5239b7
commit
12cdb8820d
@ -115,11 +115,11 @@ class config
|
||||
*
|
||||
* Can be used static, if $app given!
|
||||
*
|
||||
* @param $name string name of the config-value
|
||||
* @param $value mixed content
|
||||
* @param $app string app-name, defaults to $this->appname set via the constructor
|
||||
* @param string $name name of the config-value
|
||||
* @param mixed $value content, empty or null values are not saved, but deleted
|
||||
* @param string $app=null app-name, defaults to $this->appname set via the constructor
|
||||
*/
|
||||
/* static */ function save_value($name,$value,$app=False)
|
||||
/* static */ function save_value($name,$value,$app=null)
|
||||
{
|
||||
if (!$app && !isset($this))
|
||||
{
|
||||
@ -149,6 +149,11 @@ class config
|
||||
{
|
||||
self::init_db();
|
||||
}
|
||||
if (empty($value))
|
||||
{
|
||||
if (isset(self::$configs[$app])) unset(self::$configs[$app][$name]);
|
||||
return self::$db->delete(config::TABLE,array('config_value'=>$value),__LINE__,__FILE__);
|
||||
}
|
||||
return self::$db->insert(config::TABLE,array('config_value'=>$value),array('config_app'=>$app,'config_name'=>$name),__LINE__,__FILE__);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user