8000 Add support for Xdebug Profiler · symfony/symfony@e25fe30 · GitHub
[go: up one dir, main page]

Skip to content

Commit e25fe30

Browse files
committed
Add support for Xdebug Profiler
1 parent ecff692 commit e25fe30

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
132132
$server = new WebServer();
133133
$config = new WebServerConfig($documentRoot, $env, $input->getArgument('addressport'), $input->getOption('router'));
134134

135-
$io->success(sprintf('Server listening on http://%s', $config->getAddress()));
135+
$io->success(sprintf('Server listening on http://%s%s', $config->getAddress(), \extension_loaded('xbdebug') ? ' with Xdebug' : ''));
136136
$io->comment('Quit the server with CONTROL-C.');
137137

138138
$exitCode = $server->run($config, $disableOutput, $callback);

src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
143143
$config = new WebServerConfig($documentRoot, $env, $input->getArgument('addressport'), $input->getOption('router'));
144144

145145
if (WebServer::STARTED === $server->start($config, $input->getOption('pidfile'))) {
146-
$io->success(sprintf('Server listening on http://%s', $config->getAddress()));
146+
$io->success(sprintf('Server listening on http://%s%s', $config->getAddress(), \extension_loaded('xdebug') ? ' with Xdebug' : ''));
147147
}
148148
} catch (\Exception $e) {
149149
$io->error($e->getMessage());

src/Symfony/Bundle/WebServerBundle/WebServer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ private function createServerProcess(WebServerConfig $config)
150150
throw new \RuntimeException('Unable to find the PHP binary.');
151151
}
152152

153-
$process = new Process(array_merge(array($binary), $finder->findArguments(), array('-dvariables_order=EGPCS', '-S', $config->getAddress(), $config->getRouter())));
153+
$xdebugArgs = \extension_loaded('xdebug') ? array('-dxdebug.profiler_enable_trigger=1') : array();
154+
155+
$process = new Process(array_merge(array($binary), $finder->findArguments(), $xdebugArgs, array('-dvariables_order=EGPCS', '-S', $config->getAddress(), $config->getRouter())));
154156
$process->setWorkingDirectory($config->getDocumentRoot());
155157
$process->setTimeout(null);
156158

0 commit comments

Comments
 (0)
0