Skip to content

Commit

Permalink
fix: doc root parse error for php serve
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jun 14, 2021
1 parent ce1e7f5 commit 68001ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Util/PhpDevServe.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ protected function printDefaultMessage(): void
// $version = PHP_VERSION;
$workDir = (string)getcwd();
$svrAddr = $this->getServerAddr();
$docRoot = $this->docRoot ? $workDir . '/' . $this->docRoot : $workDir;
$docRoot = $workDir;
if ($this->docRoot) {
$docRoot = $this->docRoot;
$docRoot = Helper::isAbsPath($docRoot) ? $docRoot : $workDir . '/' . $docRoot;
}

Cli::writeln([
"PHP Development Server start listening on <info>http://$svrAddr</info>",
Expand Down

0 comments on commit 68001ef

Please sign in to comment.