From b71eede16879d802e8545233f555aa2d40c38ca0 Mon Sep 17 00:00:00 2001 From: gwoo Date: Sat, 12 May 2007 23:44:37 +0000 Subject: [PATCH] updating bake setCake git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5064 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/console/libs/bake.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index 43d60393d..81a636d6c 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -1980,16 +1980,18 @@ class BakeShell extends Shell { } function __setCake(){ - $file = file_get_contents(APP.'webroot'.DS.'index.php'); - if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $file, $match)) { - $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $file); - if(file_put_contents(APP.'webroot'.DS.'index.php', $result)){ - return true; + if(ROOT !== CAKE_CORE_INCLUDE_PATH) { + $file = file_get_contents(APP.'webroot'.DS.'index.php'); + if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $file, $match)) { + $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $file); + if(file_put_contents(APP.'webroot'.DS.'index.php', $result)){ + return true; + } else { + return false; + } } else { return false; } - } else { - return false; } } /**