Browse Source

Used alias instead of relative path in ServeController

tags/3.0.0-alpha1
Alexander Makarov 9 years ago
parent
commit
effc4facda
  1. 7
      framework/console/controllers/ServeController.php

7
framework/console/controllers/ServeController.php

@ -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.
@ -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;

Loading…
Cancel
Save