0
@@ -32,6 +32,7 @@ class CmsConfig extends CmsObject implements ArrayAccess
0
static private $instance = NULL;
0
+ static private $config_file_location = '';
0
@@ -49,6 +50,23 @@ class CmsConfig extends CmsObject implements ArrayAccess
0
return self::$instance;
0
+ static public function get_config_filename()
0
+ if (self::$config_file_location == '')
0
+ $filename = dirname(CONFIG_FILE_LOCATION) . DS . 'config-' . CMS_VERSION . '.php';
0
+ if (file_exists($filename))
0
+ self::$config_file_location = $filename;
0
+ self::$config_file_location = CONFIG_FILE_LOCATION;
0
+ return self::$config_file_location;
0
static public function exists($key)
0
$config = CmsConfig::get_instance();
0
@@ -136,9 +154,9 @@ class CmsConfig extends CmsObject implements ArrayAccess
0
if ($loadLocal == true)
0
//if (file_exists(CONFIG_FILE_LOCATION) && !cms_config_check_old_config())
0
- if (file_exists(CONFIG_FILE_LOCATION))
0
+ if (file_exists(self::get_config_filename()))
0
- include(CONFIG_FILE_LOCATION);
0
+ include(self::get_config_filename());
0
@@ -179,8 +197,8 @@ class CmsConfig extends CmsObject implements ArrayAccess
0
- $newfiledir = dirname(CONFIG_FILE_LOCATION);
0
- $newfilename = CONFIG_FILE_LOCATION;
0
+ $newfiledir = dirname(self::get_config_filename());
0
+ $newfilename = self::get_config_filename();
0
if (is_writable($newfilename) || is_writable($newfiledir))
0
$handle = fopen($newfilename, "w");
Comments
No one has commented yet.