mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
fixed failing shell dispatcher test
This commit is contained in:
parent
467ee851bf
commit
92e380737d
1 changed files with 12 additions and 2 deletions
|
@ -322,7 +322,7 @@ class ShellDispatcher {
|
||||||
$params['working'] .= '/' . $params['app'];
|
$params['working'] .= '/' . $params['app'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DS == '\\' || !empty($isWin)) {
|
if ($this->_isWindowsPath($params['app']) || !empty($isWin)) {
|
||||||
$params = str_replace('/', '\\', $params);
|
$params = str_replace('/', '\\', $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,7 +336,17 @@ class ShellDispatcher {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
protected function _isAbsolutePath($path) {
|
protected function _isAbsolutePath($path) {
|
||||||
return $path[0] === '/' || preg_match('/([a-z])(:)/i', $path);
|
return $path[0] === '/' || $this->_isWindowsPath($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the given path is Window OS path.
|
||||||
|
*
|
||||||
|
* @param string $path absolute path.
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
protected function _isWindowsPath($path) {
|
||||||
|
return preg_match('/([a-z])(:)/i', $path) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue