updating bake setCake

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5064 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-05-12 23:44:37 +00:00
parent 9b39236117
commit b71eede168

View file

@ -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;
}
}
/**