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:
Josh Sherman 2008-09-19 02:52:59 +00:00
parent 0fa204a6ad
commit cbcfc9cc4f
3 changed files with 15 additions and 9 deletions

View file

@ -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;