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

Commit

Permalink
Merge pull request #83 from PBWebMedia/symfony3
Browse files Browse the repository at this point in the history
Symfony3 compatibility
  • Loading branch information
jonaswouters committed Mar 11, 2016
2 parents 03a5d0a + 8220370 commit 33b23b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
14 changes: 4 additions & 10 deletions EventListener/CommandListener.php
Expand Up @@ -4,7 +4,6 @@

use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Jns\Bundle\XhprofBundle\DataCollector\XhprofCollector;
Expand Down Expand Up @@ -78,19 +77,14 @@ public function setWebLocation($webLocation)
*/
private function isProfileOption(ConsoleCommandEvent $event)
{
$inputDefinition = $event->getCommand()->getApplication()->getDefinition();
$definition = $event->getCommand()->getDefinition();

$inputDefinition->addOption(
$definition->addOption(
new InputOption($this->optionName, null, InputOption::VALUE_NONE, '<info>JnsXhprofBundle</info>: Whether to profile this command with xhprof', null)
);

// merge the application's input definition
$event->getCommand()->mergeApplicationDefinition();

$input = new ArgvInput();

// we use the input definition of the command
$input->bind($event->getCommand()->getDefinition());
$input = $event->getInput();
$input->bind($definition);

return $input->getOption($this->optionName);
}
Expand Down
21 changes: 11 additions & 10 deletions composer.json
Expand Up @@ -12,15 +12,16 @@
}
],
"require": {
"php": ">=5.3.2",
"symfony/http-kernel": "2.*",
"symfony/dependency-injection": "2.*",
"lox/xhprof": "dev-master@dev"
"php": "^5.3.2|^7.0",
"symfony/http-kernel": "^2.3|^3.0",
"symfony/dependency-injection": "^2.3|^3.0",
"pbweb/xhprof": "^1.0"
},
"require-dev": {
"doctrine/common": "^2.5",
"phpspec/prophecy": "~1.1.2",
"phpunit/phpunit": "~4.1.3"
"symfony/console":"^2.8|^3.0",
"phpspec/prophecy": "^1.1.2",
"phpunit/phpunit": "^4.1.3"
},
"suggest": {
"ext-xhprof": "Hierarchical Profiler for PHP",
Expand All @@ -34,10 +35,10 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.x-dev"
}
},
"config": {
},
"config": {
"bin-dir": "bin/"
}
}
}

0 comments on commit 33b23b0

Please sign in to comment.