mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
9b39236117
commit
b71eede168
1 changed files with 9 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue