Skip to content

Commit

Permalink
Fix ServerShell not being able to handle plugin assets.
Browse files Browse the repository at this point in the history
Fixes #3575
  • Loading branch information
markstory committed Jan 29, 2013
1 parent d3fdd2c commit 4109812
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/webroot/index.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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__);
}

Expand All @@ -93,5 +97,6 @@

App::uses('Dispatcher', 'Routing');


$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse());
5 changes: 3 additions & 2 deletions lib/Cake/Console/Command/ServerShell.php
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions lib/Cake/Console/Templates/skel/webroot/index.php
Expand Up @@ -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__);
}

Expand Down

0 comments on commit 4109812

Please sign in to comment.