mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
fixes #4495. updating cake.php and cake.test.php
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6890 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
52037d15e4
commit
17379fff80
2 changed files with 9 additions and 7 deletions
|
@ -455,7 +455,7 @@ class ShellDispatcher {
|
|||
}
|
||||
|
||||
if (!empty($this->params['app'])) {
|
||||
if($this->params['app']{0} == '/' || preg_match('/([a-z])(:)/i', $this->params['app'])) {
|
||||
if($this->params['app']{0} == '/' || preg_match('/([a-z])(:)/i', $this->params['app'], $matches)) {
|
||||
$root = dirname($this->params['app']);
|
||||
}
|
||||
$app = basename($this->params['app']);
|
||||
|
@ -466,9 +466,11 @@ class ShellDispatcher {
|
|||
$this->params['webroot'] = 'webroot';
|
||||
}
|
||||
|
||||
$working = str_replace(DS . DS, DS, $root . DS . $app);
|
||||
$this->params = array_merge($this->params, array('app'=> $app, 'root'=> $root, 'working'=> $root . '/' . $app));
|
||||
|
||||
$this->params = array_merge($this->params, array('app'=> $app, 'root'=> $root, 'working'=> $working));
|
||||
if (!empty($matches[0])) {
|
||||
$this->params = str_replace('/', "\\", $this->params);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Helper for recursively paraing params
|
||||
|
|
|
@ -245,8 +245,8 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
$expected = array(
|
||||
'app' => 'app',
|
||||
'webroot' => 'webroot',
|
||||
'working' => 'C:/wamp/www/apps/cake/app',
|
||||
'root' => 'C:/wamp/www/apps/cake'
|
||||
'working' => 'C:\wamp\www\apps\cake\app',
|
||||
'root' => 'C:\wamp\www\apps\cake'
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
|
@ -265,8 +265,8 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
$expected = array(
|
||||
'app' => 'app',
|
||||
'webroot' => 'webroot',
|
||||
'working' => 'C:/wamp/www/apps/cake/app',
|
||||
'root' => 'C:/wamp/www/apps/cake'
|
||||
'working' => 'C:\wamp\www\apps\cake\app',
|
||||
'root' => 'C:\wamp\www\apps\cake'
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
|
|
Loading…
Reference in a new issue