Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
feat(swoole): Disable Xdebug using XdebugHandler
Browse files Browse the repository at this point in the history
Swoole php extension is incompatible with Xdebug php extension, so XdebugHandler will restart
process without it if detected
  • Loading branch information
k911 committed Sep 23, 2018
1 parent 443bd13 commit 97ae8e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Command/ServerProfileCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Bundle\SwooleBundle\Driver\HttpDriverInterface;
use App\Bundle\SwooleBundle\Server\ServerUtils;
use Assert\Assertion;
use Composer\XdebugHandler\XdebugHandler;
use Swoole\Http\Request;
use Swoole\Http\Response;
use Swoole\Http\Server;
Expand Down Expand Up @@ -60,6 +61,10 @@ protected function configure(): void
*/
protected function execute(InputInterface $input, OutputInterface $output): void
{
$xdebug = new XdebugHandler('swoole');
$xdebug->check();
unset($xdebug);

$io = new SymfonyStyle($input, $output);

$host = (string) ($input->getOption('host') ?? $this->server->host);
Expand Down
5 changes: 5 additions & 0 deletions Command/ServerRunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Bundle\SwooleBundle\Driver\HttpDriverInterface;
use App\Bundle\SwooleBundle\Server\ServerUtils;
use Assert\Assertion;
use Composer\XdebugHandler\XdebugHandler;
use Swoole\Http\Request;
use Swoole\Http\Response;
use Swoole\Http\Server;
Expand Down Expand Up @@ -61,6 +62,10 @@ protected function configure(): void
*/
protected function execute(InputInterface $input, OutputInterface $output): void
{
$xdebug = new XdebugHandler('swoole');
$xdebug->check();
unset($xdebug);

$io = new SymfonyStyle($input, $output);

$host = (string) ($input->getOption('host') ?? $this->server->host);
Expand Down

0 comments on commit 97ae8e7

Please sign in to comment.