Browse Source

Merging fixes and enhancements into trunk.

Revision: [2158]
Changing vendors() to user require_once().

Revision: [2157]
Fixed missing directory separator.

Revision: [2156]
Added a few more fixes for Ticket #447

Revision: [2155]
Reverting changes in [2153]
Adding fix for Ticket #447

Revision: [2154]
Adding patch from Ticket #448


git-svn-id: https://svn.cakephp.org/repo/trunk/cake@2159 3807eeeb-6ff5-0310-8944-8be069107fe0
phpnut 20 years ago
parent
commit
2cb80a132f
6 changed files with 40 additions and 21 deletions
  1. 1 1
      VERSION.txt
  2. 15 8
      app/webroot/index.php
  3. 2 2
      cake/basics.php
  4. 3 3
      cake/config/paths.php
  5. 1 1
      cake/libs/view/view.php
  6. 18 6
      index.php

+ 1 - 1
VERSION.txt

@@ -6,4 +6,4 @@
 // +---------------------------------------------------------------------------------------------------+ //
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-0.10.8.2152
+0.10.8.2159

+ 15 - 8
app/webroot/index.php

@@ -75,18 +75,25 @@ if (!defined('WEBROOT_DIR'))
 {
     define ('WEBROOT_DIR', basename(dirname(__FILE__)));
 }
-define('WWW_ROOT', dirname(__FILE__));
 
-if(function_exists('ini_set'))
+if (!defined('WWW_ROOT'))
 {
-    ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.CAKE_CORE_INCLUDE_PATH.PATH_SEPARATOR.ROOT.DS.APP_DIR.DS);
-    define('APP_PATH', null);
-    define('CORE_PATH', null);
+    define('WWW_ROOT', dirname(__FILE__).DS);
 }
-else
+
+if(!defined('CORE_PATH'))
 {
-    define('APP_PATH', ROOT.DS.APP_DIR.DS);
-    define('CORE_PATH', CAKE_CORE_INCLUDE_PATH.DS);
+    if(function_exists('ini_set'))
+    {
+        ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.CAKE_CORE_INCLUDE_PATH.PATH_SEPARATOR.ROOT.DS.APP_DIR.DS);
+        define('APP_PATH', null);
+        define('CORE_PATH', null);
+    }
+    else
+    {
+        define('APP_PATH', ROOT.DS.APP_DIR.DS);
+        define('CORE_PATH', CAKE_CORE_INCLUDE_PATH.DS);
+    }
 }
 
 require CORE_PATH.'cake'.DS.'bootstrap.php';

+ 2 - 2
cake/basics.php

@@ -406,11 +406,11 @@ function vendor($name)
     {
         if(file_exists(APP.'vendors'.DS.$arg.'.php'))
         {
-            require(APP.'vendors'.DS.$arg.'.php');
+            require_once(APP.'vendors'.DS.$arg.'.php');
         }
         else
         {
-            require(VENDORS.$arg.'.php');
+            require_once(VENDORS.$arg.'.php');
         }
     }
 }

+ 3 - 3
cake/config/paths.php

@@ -134,17 +134,17 @@ define ('TESTS', APP.'tests'.DS);
 /**
  * Path to the controller test directory.
  */
-define ('CONTROLLER_TESTS', TESTS.APP_DIR.DS.'controllers'.DS);
+define ('CONTROLLER_TESTS', TESTS.APP_DIR.DS.'cases'.DS.'controllers'.DS);
 
 /**
  * Path to the helpers test directory.
  */
-define ('HELPER_TESTS', TESTS.APP_DIR.DS.'helpers'.DS);
+define ('HELPER_TESTS', TESTS.APP_DIR.DS.'cases'.DS.'views'.DS.'helpers'.DS);
 
 /**
  * Path to the models' test directory.
  */
-define ('MODEL_TESTS', TESTS.APP_DIR.DS.'models'.DS);
+define ('MODEL_TESTS', TESTS.APP_DIR.DS.'cases'.DS.'models'.DS);
 
 /**
  * Path to the lib test directory.

+ 1 - 1
cake/libs/view/view.php

@@ -417,7 +417,7 @@ class View extends Object
 
     function element($name)
     {
-
+        return ELEMENTS.$name.$this->ext;
     }
 
 /**

+ 18 - 6
index.php

@@ -35,7 +35,9 @@
 define ('APP_DIR', 'app');
 define ('DS', DIRECTORY_SEPARATOR);
 define ('ROOT', dirname(__FILE__).DS);
+define ('WEBROOT_DIR', 'webroot');
 
+define('WWW_ROOT', ROOT.APP_DIR.DS.WEBROOT_DIR.DS);
 /**
  * This only needs to be changed if the cake installed libs are located
  * outside of the distributed directory structure.
@@ -46,11 +48,21 @@ if (!defined('CAKE_CORE_INCLUDE_PATH'))
     define('CAKE_CORE_INCLUDE_PATH', ROOT);
 }
 
-ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.CAKE_CORE_INCLUDE_PATH.PATH_SEPARATOR.ROOT.DS.APP_DIR.DS);
+if(function_exists('ini_set'))
+{
+    ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.CAKE_CORE_INCLUDE_PATH.PATH_SEPARATOR.ROOT.DS.APP_DIR.DS);
+    define('APP_PATH', null);
+    define('CORE_PATH', null);
+}
+else
+{
+    define('APP_PATH', ROOT.DS.APP_DIR.DS);
+    define('CORE_PATH', CAKE_CORE_INCLUDE_PATH.DS);
+}
 
-require 'cake'.DS.'basics.php';
-require 'config'.DS.'core.php';
-require 'cake'.DS.'config'.DS.'paths.php';
+require CORE_PATH.'cake'.DS.'basics.php';
+require APP_PATH.'config'.DS.'core.php';
+require CORE_PATH.'cake'.DS.'config'.DS.'paths.php';
 $bootstrap = true;
 
 $uri = setUri();
@@ -62,7 +74,7 @@ $uri = setUri();
 if ($uri === '/' || $uri === '/index.php')
 {
     $_GET['url'] = '/';
-    require ROOT.APP_DIR.DS.WEBROOT_DIR.DS.'index.php';
+    require APP_DIR.DS.WEBROOT_DIR.DS.'index.php';
 }
 else
 {
@@ -79,6 +91,6 @@ else
 
     $_GET['url'] = $path;
 
-    require ROOT.APP_DIR.DS.WEBROOT_DIR.DS.'index.php';
+    require APP_DIR.DS.WEBROOT_DIR.DS.'index.php';
 }
 ?>