mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Making ProjectTask bake constants with DS instead of hardcoded / or \.
Makes developing/deploying to mixed systems easier. refs #278 Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
parent
d251a1d5ca
commit
c810b3cde4
1 changed files with 2 additions and 2 deletions
|
@ -224,7 +224,7 @@ class ProjectTask extends Shell {
|
|||
$File =& new File($path . 'webroot' . DS . 'index.php');
|
||||
$contents = $File->read();
|
||||
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
|
||||
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
|
||||
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', ". (strpos(CAKE_CORE_INCLUDE_PATH, '/')===0? " DS . '":"'") . str_replace('/', '\' . DS . \'', trim(CAKE_CORE_INCLUDE_PATH, '/')) . "');", $contents);
|
||||
if (!$File->write($result)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ class ProjectTask extends Shell {
|
|||
$File =& new File($path . 'webroot' . DS . 'test.php');
|
||||
$contents = $File->read();
|
||||
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
|
||||
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
|
||||
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', ". (strpos(CAKE_CORE_INCLUDE_PATH, '/')===0? " DS . '":"'") . str_replace('/', '\' . DS . \'', trim(CAKE_CORE_INCLUDE_PATH, '/')) . "');", $contents);
|
||||
if (!$File->write($result)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue