public this repo is viewable by everyone
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Fixed merge


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4124 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
8 months ago
commit  4978453c6368fd40690312e742cc2d7c095cec3a
tree    fbf2395a0e194d61b692bdc9467e422e717629fb
parent  a11ef674ead2618eb15652709b18c9aa06e5c4f0
...
2
3
4
 
5
6
...
2
3
4
5
6
7
0
@@ -2,4 +2,5 @@
0
 define("CONFIG_FILE_LOCATION", dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.php');
0
 define("TMP_CACHE_LOCATION", dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'cache');
0
 define("TMP_TEMPLATES_C_LOCATION", dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'templates_c');
0
+include('version.php'); //More defines
0
 ?>
0
\ No newline at end of file
...
24
25
26
27
28
29
30
31
32
...
24
25
26
 
 
 
27
28
29
0
@@ -24,9 +24,6 @@ require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'cm
0
 //Where are we?
0
 $dirname = ROOT_DIR;
0
 
0
-//Load the version defines
0
-require_once(cms_join_path($dirname,'version.php'));
0
-
0
 //Load stuff that hasn't been moved to static methods yet
0
 require_once(cms_join_path($dirname,'lib','misc.functions.php'));
0
 require_once(cms_join_path($dirname,'lib','page.functions.php'));
...
37
38
39
 
 
 
 
40
41
42
43
 
 
44
45
46
47
48
49
50
51
 
52
53
54
...
72
73
74
75
76
77
78
79
80
81
...
37
38
39
40
41
42
43
44
45
46
 
47
48
49
 
50
51
52
53
54
55
56
57
58
59
...
77
78
79
 
 
 
 
80
81
82
0
@@ -37,18 +37,23 @@ require_once($dirname.DIRECTORY_SEPARATOR.'fileloc.php');
0
 list( $usec, $sec ) = explode( ' ', microtime() );
0
 $start_time = ((float)$usec + (float)$sec);
0
 
0
+//Load necessary global functions. This allows us to load a few
0
+//things before hand... like the configuration
0
+require_once($dirname.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'cmsms.api.php');
0
+
0
 //If we have a missing or empty config file, then we should think
0
 //about redirecting to the installer. Also, check to see if the SITEDOWN
0
 //file is there. That means we're probably in mid-upgrade.
0
-if (!file_exists(CONFIG_FILE_LOCATION) || filesize(CONFIG_FILE_LOCATION) < 800)
0
+$config_location = CmsConfig::get_config_filename();
0
+if (!file_exists($config_location) || filesize($config_location) < 800)
0
 {
0
- require_once($dirname.'/lib/cmsms.api.php');
0
     if (FALSE == is_file($dirname.'/install/install.php'))
0
   {
0
         die ('There is no config.php file or install/install.php please correct one these errors!');
0
     }
0
   else
0
   {
0
+    die('Do a redirect - ' . $config_location);
0
         CmsResponse::redirect('install/index.php');
0
     }
0
 }
0
@@ -72,10 +77,6 @@ if (!is_writable(TMP_TEMPLATES_C_LOCATION) || !is_writable(TMP_CACHE_LOCATION))
0
   exit;
0
 }
0
 
0
-//Load necessary global functions. This allows us to load a few
0
-//things before hand... like the configuration
0
-require_once($dirname.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'cmsms.api.php');
0
-
0
 //Start up a profiler for getting render times for this page. Use
0
 //the start time we generated way up at the top.
0
 $profiler = CmsProfiler::get_instance('', $start_time);
...
32
33
34
 
35
36
37
...
49
50
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
53
54
...
136
137
138
139
 
140
141
 
142
143
144
...
179
180
181
182
183
 
 
184
185
186
...
32
33
34
35
36
37
38
...
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
154
155
156
 
157
158
 
159
160
161
162
...
197
198
199
 
 
200
201
202
203
204
0
@@ -32,6 +32,7 @@ class CmsConfig extends CmsObject implements ArrayAccess
0
 {
0
   var $params;
0
   static private $instance = NULL;
0
+  static private $config_file_location = '';
0
 
0
   function __construct()
0
   {
0
@@ -49,6 +50,23 @@ class CmsConfig extends CmsObject implements ArrayAccess
0
     return self::$instance;
0
   }
0
   
0
+  static public function get_config_filename()
0
+  {
0
+    if (self::$config_file_location == '')
0
+    {
0
+      $filename = dirname(CONFIG_FILE_LOCATION) . DS . 'config-' . CMS_VERSION . '.php';
0
+      if (file_exists($filename))
0
+      {
0
+        self::$config_file_location = $filename;
0
+      }
0
+      else
0
+      {
0
+        self::$config_file_location = CONFIG_FILE_LOCATION;
0
+      }
0
+    }
0
+    return self::$config_file_location;
0
+  }
0
+  
0
   static public function exists($key)
0
   {
0
     $config = CmsConfig::get_instance();
0
@@ -136,9 +154,9 @@ class CmsConfig extends CmsObject implements ArrayAccess
0
     if ($loadLocal == true)
0
     {
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
       {
0
-        include(CONFIG_FILE_LOCATION);
0
+        include(self::get_config_filename());
0
       }
0
     }
0
 
0
@@ -179,8 +197,8 @@ class CmsConfig extends CmsObject implements ArrayAccess
0
   
0
   function save()
0
   {
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
     {
0
       $handle = fopen($newfilename, "w");
...
16
17
18
19
20
21
22
...
16
17
18
 
19
20
21
0
@@ -16,7 +16,6 @@
0
 #along with this program; if not, write to the Free Software
0
 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0
 
0
-
0
 function smarty_cms_block_tr($params,$content,&$smarty)
0
 {
0
   if( is_null($content) ) return;
...
22
23
24
 
 
 
 
25
26
27
...
22
23
24
25
26
27
28
29
30
31
0
@@ -22,5 +22,9 @@ $CMS_VERSION = "2.0-svn";
0
 $CMS_VERSION_NAME = "Jamaica";
0
 $CMS_SCHEMA_VERSION = "28";
0
 
0
+define("CMS_VERSION", $CMS_VERSION);
0
+define("CMS_VERSION_NAME", $CMS_VERSION_NAME);
0
+define("CMS_SCHEMA_VERSION", $CMS_SCHEMA_VERSION);
0
+
0
 # vim:ts=4 sw=4 noet
0
 ?>
0
\ No newline at end of file

Comments

    No one has commented yet.