Skip to content

Commit

Permalink
Merge pull request #284 from fbourigault/feature/kernel-root-director…
Browse files Browse the repository at this point in the history
…y-fixtures

Add kernel root directory to fixtures location paths
  • Loading branch information
dbu committed Oct 26, 2017
2 parents a12ed7f + 548d79a commit 5290b92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Command/LoadFixtureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use Doctrine\Common\DataFixtures\Purger\PHPCRPurger;
use InvalidArgumentException;
use Doctrine\Bundle\PHPCRBundle\DataFixtures\PHPCRExecutor;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* Command to load PHPCR-ODM fixtures.
Expand Down Expand Up @@ -135,8 +136,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($dirOrFile) {
$paths = is_array($dirOrFile) ? $dirOrFile : array($dirOrFile);
} else {
$paths = array();
foreach ($this->getApplication()->getKernel()->getBundles() as $bundle) {
/** @var $kernel KernelInterface */
$kernel = $this->getApplication()->getKernel();
$paths = array($kernel->getRootDir().'/DataFixtures/PHPCR');
foreach ($kernel->getBundles() as $bundle) {
$paths[] = $bundle->getPath().'/DataFixtures/PHPCR';
}
}
Expand Down

0 comments on commit 5290b92

Please sign in to comment.