mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-17 06:59:51 +00:00
bake fix for root path
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3633 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
8a64ba93fc
commit
1a977a2053
1 changed files with 11 additions and 1 deletions
|
@ -76,9 +76,11 @@
|
||||||
$projectPath = $app;
|
$projectPath = $app;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($project) {
|
if($project) {
|
||||||
$app = $projectPath;
|
$app = $projectPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
$shortPath = str_replace($root, '', $app);
|
$shortPath = str_replace($root, '', $app);
|
||||||
$shortPath = str_replace('../', '', $shortPath);
|
$shortPath = str_replace('../', '', $shortPath);
|
||||||
$shortPath = str_replace('//', '/', $shortPath);
|
$shortPath = str_replace('//', '/', $shortPath);
|
||||||
|
@ -87,8 +89,16 @@
|
||||||
$rootDir = str_replace($appDir, '', $shortPath);
|
$rootDir = str_replace($appDir, '', $shortPath);
|
||||||
$rootDir = str_replace('//', '', $rootDir);
|
$rootDir = str_replace('//', '', $rootDir);
|
||||||
|
|
||||||
|
if(!$rootDir) {
|
||||||
|
$rootDir = $root;
|
||||||
|
$projectPath = $root.DS.$appDir;
|
||||||
|
}
|
||||||
define ('ROOT', $rootDir);
|
define ('ROOT', $rootDir);
|
||||||
define ('APP_DIR', $appDir);
|
define ('APP_DIR', $appDir);
|
||||||
|
|
||||||
|
echo ROOT;
|
||||||
|
|
||||||
|
echo APP_DIR;
|
||||||
define ('DEBUG', 1);;
|
define ('DEBUG', 1);;
|
||||||
define('CAKE_CORE_INCLUDE_PATH', $root);
|
define('CAKE_CORE_INCLUDE_PATH', $root);
|
||||||
|
|
||||||
|
@ -2098,7 +2108,7 @@ class Bake {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ($this->__checkPath($projectPath) === true || $projectPath == '') {
|
while ($this->__checkPath($projectPath) === true || $projectPath == '') {
|
||||||
$projectPath = $this->getInput('Directory path exists please choose another:');
|
$projectPath = $this->getInput('Directory path exists please choose another:');
|
||||||
while ($projectPath == '') {
|
while ($projectPath == '') {
|
||||||
$projectPath = $this->getInput('The directory path you supplied was empty. Please try again.');
|
$projectPath = $this->getInput('The directory path you supplied was empty. Please try again.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue