mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Added fix for Ticket #1019.
bake.php on windows adding slash before filepath when creating unit test files git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3134 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
965874ccae
commit
e7b26eed83
1 changed files with 9 additions and 4 deletions
|
@ -1350,20 +1350,25 @@ class Bake {
|
|||
}
|
||||
}
|
||||
$path = implode(DS, $path);
|
||||
$unixPath = DS;
|
||||
if (strpos( PHP_OS, ÔWINÕ ) === 0){
|
||||
$unixPath = null;
|
||||
}
|
||||
|
||||
if (!is_dir(DS.$path)) {
|
||||
if (!is_dir($unixPath.$path)) {
|
||||
$create = $this->getInput("Unit test directory does not exist. Create it?", array('y','n'), 'y');
|
||||
if (low($create) == 'y' || low($create) == 'yes') {
|
||||
$build = array();
|
||||
|
||||
foreach(explode(DS, $path) as $i => $dir) {
|
||||
$build[] = $dir;
|
||||
if (!is_dir(DS.implode(DS, $build))) {
|
||||
mkdir(DS.implode(DS, $build));
|
||||
if (!is_dir($unixPath.implode(DS, $build))) {
|
||||
mkdir($unixPath.implode(DS, $build));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->createFile(DS.$path.DS.$filename, $out);
|
||||
$this->createFile($unixPath.$path.DS.$filename, $out);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue