Permalink
Browse files

Fix ServerShell not being able to handle plugin assets.

Fixes #3575
  • Loading branch information...
markstory committed Jan 29, 2013
1 parent d3fdd2c commit 410981296cf916c8f27eb2ac3489004a8031a1ef
View
@@ -24,6 +24,7 @@
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
+
/**
* These defines should only be edited if you have cake installed in
* a directory layout other than the way it is distributed.
@@ -72,6 +73,9 @@
// for built-in 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__);
}
@@ -93,5 +97,6 @@
App::uses('Dispatcher', 'Routing');
+
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse());
@@ -125,10 +125,11 @@ public function main() {
return;
}
- $command = sprintf("php -S %s:%d -t %s",
+ $command = sprintf("php -S %s:%d -t %s %s",
$this->_host,
$this->_port,
- $this->_documentRoot
+ $this->_documentRoot,
+ WEBROOT_DIR . '/index.php'
);
$port = ($this->_port == self::DEFAULT_PORT) ? '' : ':' . $this->_port;
@@ -74,6 +74,9 @@
// for built-in 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__);
}

0 comments on commit 4109812

Please sign in to comment.