Add support for Xdebug Profiler
This commit is contained in:
parent
ecff692f8e
commit
0f4c0a6eaf
@ -133,6 +133,9 @@ EOF
|
|||||||
$config = new WebServerConfig($documentRoot, $env, $input->getArgument('addressport'), $input->getOption('router'));
|
$config = new WebServerConfig($documentRoot, $env, $input->getArgument('addressport'), $input->getOption('router'));
|
||||||
|
|
||||||
$io->success(sprintf('Server listening on http://%s', $config->getAddress()));
|
$io->success(sprintf('Server listening on http://%s', $config->getAddress()));
|
||||||
|
if (ini_get('xdebug.profiler_enable_trigger')) {
|
||||||
|
$io->comment('Xdebug profiler trigger enabled.');
|
||||||
|
}
|
||||||
$io->comment('Quit the server with CONTROL-C.');
|
$io->comment('Quit the server with CONTROL-C.');
|
||||||
|
|
||||||
$exitCode = $server->run($config, $disableOutput, $callback);
|
$exitCode = $server->run($config, $disableOutput, $callback);
|
||||||
|
@ -144,6 +144,9 @@ EOF
|
|||||||
|
|
||||||
if (WebServer::STARTED === $server->start($config, $input->getOption('pidfile'))) {
|
if (WebServer::STARTED === $server->start($config, $input->getOption('pidfile'))) {
|
||||||
$io->success(sprintf('Server listening on http://%s', $config->getAddress()));
|
$io->success(sprintf('Server listening on http://%s', $config->getAddress()));
|
||||||
|
if (ini_get('xdebug.profiler_enable_trigger')) {
|
||||||
|
$io->comment('Xdebug profiler trigger enabled.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$io->error($e->getMessage());
|
$io->error($e->getMessage());
|
||||||
|
@ -150,7 +150,9 @@ class WebServer
|
|||||||
throw new \RuntimeException('Unable to find the PHP binary.');
|
throw new \RuntimeException('Unable to find the PHP binary.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$process = new Process(array_merge(array($binary), $finder->findArguments(), array('-dvariables_order=EGPCS', '-S', $config->getAddress(), $config->getRouter())));
|
$xdebugArgs = ini_get('xdebug.profiler_enable_trigger') ? array('-dxdebug.profiler_enable_trigger=1') : array();
|
||||||
|
|
||||||
|
$process = new Process(array_merge(array($binary), $finder->findArguments(), $xdebugArgs, array('-dvariables_order=EGPCS', '-S', $config->getAddress(), $config->getRouter())));
|
||||||
$process->setWorkingDirectory($config->getDocumentRoot());
|
$process->setWorkingDirectory($config->getDocumentRoot());
|
||||||
$process->setTimeout(null);
|
$process->setTimeout(null);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user