<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,4 +2,5 @@
 define(&quot;CONFIG_FILE_LOCATION&quot;, dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.php');
 define(&quot;TMP_CACHE_LOCATION&quot;, dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'cache');
 define(&quot;TMP_TEMPLATES_C_LOCATION&quot;, dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'templates_c');
+include('version.php'); //More defines
 ?&gt;
\ No newline at end of file</diff>
      <filename>fileloc.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,9 +24,6 @@ require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'cm
 //Where are we?
 $dirname = ROOT_DIR;
 
-//Load the version defines
-require_once(cms_join_path($dirname,'version.php'));
-
 //Load stuff that hasn't been moved to static methods yet
 require_once(cms_join_path($dirname,'lib','misc.functions.php'));
 require_once(cms_join_path($dirname,'lib','page.functions.php'));</diff>
      <filename>include.php</filename>
    </modified>
    <modified>
      <diff>@@ -37,18 +37,23 @@ require_once($dirname.DIRECTORY_SEPARATOR.'fileloc.php');
 list( $usec, $sec ) = explode( ' ', microtime() );
 $start_time = ((float)$usec + (float)$sec);
 
+//Load necessary global functions.  This allows us to load a few
+//things before hand... like the configuration
+require_once($dirname.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'cmsms.api.php');
+
 //If we have a missing or empty config file, then we should think
 //about redirecting to the installer.  Also, check to see if the SITEDOWN
 //file is there.  That means we're probably in mid-upgrade.
-if (!file_exists(CONFIG_FILE_LOCATION) || filesize(CONFIG_FILE_LOCATION) &lt; 800)
+$config_location = CmsConfig::get_config_filename();
+if (!file_exists($config_location) || filesize($config_location) &lt; 800)
 {
-    require_once($dirname.'/lib/cmsms.api.php');
     if (FALSE == is_file($dirname.'/install/install.php'))
 	{
         die ('There is no config.php file or install/install.php please correct one these errors!');
     }
 	else
 	{
+		die('Do a redirect - ' . $config_location);
         CmsResponse::redirect('install/index.php');
     }
 }
@@ -72,10 +77,6 @@ if (!is_writable(TMP_TEMPLATES_C_LOCATION) || !is_writable(TMP_CACHE_LOCATION))
 	exit;
 }
 
-//Load necessary global functions.  This allows us to load a few
-//things before hand... like the configuration
-require_once($dirname.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'cmsms.api.php');
-
 //Start up a profiler for getting render times for this page.  Use
 //the start time we generated way up at the top.
 $profiler = CmsProfiler::get_instance('', $start_time);</diff>
      <filename>index.php</filename>
    </modified>
    <modified>
      <diff>@@ -32,6 +32,7 @@ class CmsConfig extends CmsObject implements ArrayAccess
 {
 	var $params;
 	static private $instance = NULL;
+	static private $config_file_location = '';
 
 	function __construct()
 	{
@@ -49,6 +50,23 @@ class CmsConfig extends CmsObject implements ArrayAccess
 		return self::$instance;
 	}
 	
+	static public function get_config_filename()
+	{
+		if (self::$config_file_location == '')
+		{
+			$filename = dirname(CONFIG_FILE_LOCATION) . DS . 'config-' . CMS_VERSION . '.php';
+			if (file_exists($filename))
+			{
+				self::$config_file_location = $filename;
+			}
+			else
+			{
+				self::$config_file_location = CONFIG_FILE_LOCATION;
+			}
+		}
+		return self::$config_file_location;
+	}
+	
 	static public function exists($key)
 	{
 		$config = CmsConfig::get_instance();
@@ -136,9 +154,9 @@ class CmsConfig extends CmsObject implements ArrayAccess
 		if ($loadLocal == true)
 		{
 			//if (file_exists(CONFIG_FILE_LOCATION) &amp;&amp; !cms_config_check_old_config())
-			if (file_exists(CONFIG_FILE_LOCATION))
+			if (file_exists(self::get_config_filename()))
 			{
-				include(CONFIG_FILE_LOCATION);
+				include(self::get_config_filename());
 			}
 		}
 
@@ -179,8 +197,8 @@ class CmsConfig extends CmsObject implements ArrayAccess
 	
 	function save()
 	{
-		$newfiledir = dirname(CONFIG_FILE_LOCATION);
-		$newfilename = CONFIG_FILE_LOCATION;
+		$newfiledir = dirname(self::get_config_filename());
+		$newfilename = self::get_config_filename();
 		if (is_writable($newfilename) || is_writable($newfiledir))
 		{
 			$handle = fopen($newfilename, &quot;w&quot;);</diff>
      <filename>lib/classes/class.cms_config.php</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,6 @@
 #along with this program; if not, write to the Free Software
 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-
 function smarty_cms_block_tr($params,$content,&amp;$smarty)
 {
   if( is_null($content) ) return;</diff>
      <filename>plugins/block.tr.php</filename>
    </modified>
    <modified>
      <diff>@@ -22,5 +22,9 @@ $CMS_VERSION = &quot;2.0-svn&quot;;
 $CMS_VERSION_NAME = &quot;Jamaica&quot;;
 $CMS_SCHEMA_VERSION = &quot;28&quot;;
 
+define(&quot;CMS_VERSION&quot;, $CMS_VERSION);
+define(&quot;CMS_VERSION_NAME&quot;, $CMS_VERSION_NAME);
+define(&quot;CMS_SCHEMA_VERSION&quot;, $CMS_SCHEMA_VERSION);
+
 # vim:ts=4 sw=4 noet
 ?&gt;
\ No newline at end of file</diff>
      <filename>version.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a11ef674ead2618eb15652709b18c9aa06e5c4f0</id>
    </parent>
  </parents>
  <author>
    <name>wishy</name>
    <email>wishy@3d254a34-79dc-0310-9e5f-be208747d8a0</email>
  </author>
  <url>http://github.com/tedkulp/cmsmadesimple-2-0/commit/4978453c6368fd40690312e742cc2d7c095cec3a</url>
  <id>4978453c6368fd40690312e742cc2d7c095cec3a</id>
  <committed-date>2007-09-09T01:09:55-07:00</committed-date>
  <authored-date>2007-09-09T01:09:55-07:00</authored-date>
  <message>Fixed merge


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4124 3d254a34-79dc-0310-9e5f-be208747d8a0</message>
  <tree>fbf2395a0e194d61b692bdc9467e422e717629fb</tree>
  <committer>
    <name>wishy</name>
    <email>wishy@3d254a34-79dc-0310-9e5f-be208747d8a0</email>
  </committer>
</commit>
