Fix ServerShell not being able to handle plugin assets.

Fixes #3575
This commit is contained in:
mark_story 2013-01-28 22:21:58 -05:00
parent d3fdd2c911
commit 410981296c
3 changed files with 11 additions and 2 deletions

View file

@ -24,6 +24,7 @@
if (!defined('DS')) { if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR); define('DS', DIRECTORY_SEPARATOR);
} }
/** /**
* These defines should only be edited if you have cake installed in * These defines should only be edited if you have cake installed in
* a directory layout other than the way it is distributed. * a directory layout other than the way it is distributed.
@ -72,6 +73,9 @@ if (!defined('WWW_ROOT')) {
// for built-in server // for built-in server
if (php_sapi_name() == 'cli-server') { if (php_sapi_name() == 'cli-server') {
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['REQUEST_URI'])) {
return false;
}
$_SERVER['PHP_SELF'] = '/' . basename(__FILE__); $_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
} }
@ -93,5 +97,6 @@ if (!empty($failed)) {
App::uses('Dispatcher', 'Routing'); App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher(); $Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse()); $Dispatcher->dispatch(new CakeRequest(), new CakeResponse());

View file

@ -125,10 +125,11 @@ class ServerShell extends AppShell {
return; return;
} }
$command = sprintf("php -S %s:%d -t %s", $command = sprintf("php -S %s:%d -t %s %s",
$this->_host, $this->_host,
$this->_port, $this->_port,
$this->_documentRoot $this->_documentRoot,
WEBROOT_DIR . '/index.php'
); );
$port = ($this->_port == self::DEFAULT_PORT) ? '' : ':' . $this->_port; $port = ($this->_port == self::DEFAULT_PORT) ? '' : ':' . $this->_port;

View file

@ -74,6 +74,9 @@ if (!defined('WWW_ROOT')) {
// for built-in server // for built-in server
if (php_sapi_name() == 'cli-server') { if (php_sapi_name() == 'cli-server') {
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['REQUEST_URI'])) {
return false;
}
$_SERVER['PHP_SELF'] = '/' . basename(__FILE__); $_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
} }