Skip to content

Commit 03f9f77

Browse files
committed
add checkEnvironment function in command
1 parent 45383d2 commit 03f9f77

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Commands/HttpServerCommand.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class HttpServerCommand extends Command
5050
*/
5151
public function handle()
5252
{
53+
$this->checkEnvironment();
5354
$this->loadConfigs();
5455
$this->initAction();
5556
$this->runAction();
@@ -305,4 +306,14 @@ protected function isDaemon()
305306
{
306307
return $this->configs['server']['options']['daemonize'];
307308
}
309+
310+
/**
311+
* Check running enironment.
312+
*/
313+
protected function checkEnvironment()
314+
{
315+
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
316+
throw new \RuntimeException("Swoole extension doesn't support Windows OS yet");
317+
}
318+
}
308319
}

0 commit comments

Comments
 (0)