Removed the final hardcoded paths, changed the reload logic in the Config class, and updated the controller to pass the config file name, not the config file short name.
git-svn-id: http://svn.cleancode.org/svn/pickles@54 4d10bc64-7434-11dc-a737-d2d0f8310089
This commit is contained in:
parent
0fa204a6ad
commit
cbcfc9cc4f
3 changed files with 15 additions and 9 deletions
|
@ -23,11 +23,17 @@ class Config extends Singleton {
|
|||
return self::$instance;
|
||||
}
|
||||
|
||||
public function load($site) {
|
||||
// @todo getting warnings on the filemtime
|
||||
if (!isset($this->file) || @filemtime($this->file) > $this->timestamp) {
|
||||
$file = PICKLES_PATH . 'config/' . $site . '.xml';
|
||||
|
||||
public function load($file) {
|
||||
$load = true;
|
||||
if (isset($this->file)) {
|
||||
if (file_exists($this->file) && isset($this->timestamp)) {
|
||||
if (filemtime($this->file) < $this->timestamp) {
|
||||
$load = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($load) {
|
||||
if (file_exists($file)) {
|
||||
$this->file = $file;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue