mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 18:14:42 +00:00
small fixes in config
This commit is contained in:
parent
264c28d1e3
commit
5114af5368
@ -230,7 +230,11 @@ class Config extends Singleton
|
||||
throw new ConfigException('empty file') ;
|
||||
}
|
||||
|
||||
set_error_handler(function(){throw new ConfigException("invalid config xml") ;}) ;
|
||||
set_error_handler(
|
||||
function() {
|
||||
throw new ConfigException("invalid config xml") ;
|
||||
}
|
||||
);
|
||||
|
||||
$this->configxml = new \DOMDocument('1.0');
|
||||
$this->configxml->loadXML($xml);
|
||||
@ -265,9 +269,11 @@ class Config extends Singleton
|
||||
$target_dir = dirname($this->config_file)."/backup/";
|
||||
$target_filename = "config-".time().".xml";
|
||||
|
||||
if (file_exists($target_dir)) {
|
||||
copy($this->config_file, $target_dir.$target_filename);
|
||||
if (!file_exists($target_dir)) {
|
||||
// create backup directory if it's missing
|
||||
mkdir($target_dir);
|
||||
}
|
||||
copy($this->config_file, $target_dir.$target_filename);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user