From 1959b97ba3834cc413c9497ad3e9f3a4adeeb2e0 Mon Sep 17 00:00:00 2001 From: ptica Date: Mon, 8 Sep 2014 11:57:01 +0200 Subject: [PATCH] hardcode a relative path to core installed via composer as book suggests --- lib/Cake/Console/Command/Task/ProjectTask.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index c3345ffa7..4763b2876 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -340,6 +340,11 @@ class ProjectTask extends AppShell { $root = strpos(CAKE_CORE_INCLUDE_PATH, '/') === 0 ? " DS . '" : "'"; $corePath = $root . str_replace(DS, "' . DS . '", trim(CAKE_CORE_INCLUDE_PATH, DS)) . "'"; + $composer = ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib'; + if (file_exists($composer)) { + $corePath = " ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib'"; + } + $result = str_replace('__CAKE_PATH__', $corePath, $contents, $count); if ($hardCode) { $result = str_replace('//define(\'CAKE_CORE', 'define(\'CAKE_CORE', $result);