Skip to content

Commit

Permalink
Used alias instead of relative path in ServeController
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Nov 6, 2015
1 parent 9d7db8c commit effc4fa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions framework/console/controllers/ServeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class ServeController extends Controller
public $port = 8080;

/**
* @var string path to directory to serve
* @var string path or path alias to directory to serve
*/
public $docroot = 'web';
public $docroot = '@app/web';

/**
* @var string path to router script.
Expand All @@ -52,8 +52,7 @@ class ServeController extends Controller
*/
public function actionIndex($address = 'localhost')
{
$basePath = Yii::$app->basePath;
$documentRoot = $basePath . '/' . $this->docroot;
$documentRoot = Yii::getAlias($this->docroot);

if (strpos($address, ':') === false) {
$address = $address . ':' . $this->port;
Expand Down

0 comments on commit effc4fa

Please sign in to comment.