Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Prev Previous commit
Next Next commit
add checkEnvironment function in command
  • Loading branch information
albertcht committed May 5, 2018
commit 03f9f7711cd76f8f28b604555876f3142485e4ec
11 changes: 11 additions & 0 deletions src/Commands/HttpServerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class HttpServerCommand extends Command
*/
public function handle()
{
$this->checkEnvironment();
$this->loadConfigs();
$this->initAction();
$this->runAction();
Expand Down Expand Up @@ -305,4 +306,14 @@ protected function isDaemon()
{
return $this->configs['server']['options']['daemonize'];
}

/**
* Check running enironment.
*/
protected function checkEnvironment()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
throw new \RuntimeException("Swoole extension doesn't support Windows OS yet");
}
}
}