-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from inhere/master
router update, some modify for http server
- Loading branch information
Showing
15 changed files
with
719 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: inhere | ||
* Date: 2018/3/19 | ||
* Time: 上午11:32 | ||
*/ | ||
|
||
namespace Swoft\Http\Server\Bootstrap\Listener; | ||
|
||
use Swoft\App; | ||
use Swoft\Bean\Annotation\ServerListener; | ||
use Swoft\Bootstrap\Listeners\Interfaces\StartInterface; | ||
use Swoft\Bootstrap\SwooleEvent; | ||
use Swoole\Server; | ||
|
||
/** | ||
* Class MasterStartListener | ||
* @package Swoft\Http\Server\Bootstrap\Listener | ||
* @ServerListener(event=SwooleEvent::ON_START) | ||
*/ | ||
class MasterStartListener implements StartInterface | ||
{ | ||
public function onStart(Server $server) | ||
{ | ||
\output()->writeln( | ||
'Server has been started. ' . | ||
"(master PID: <cyan>{$server->master_pid}</cyan>, manager PID: <cyan>{$server->manager_pid}</cyan>)" | ||
); | ||
|
||
// output a message before start | ||
if (!App::$server->isDaemonize()) { | ||
\output()->writeln('You can use <info>CTRL + C</info> to stop run.'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.