Skip to content

Add kernel root directory to fixtures location paths #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 26, 2017
Merged

Add kernel root directory to fixtures location paths #284

merged 2 commits into from
Oct 26, 2017

Conversation

fbourigault
Copy link
Contributor

This allows to load fixtures from a bundless application like the one created with symfony/flex. This is a port of doctrine/DoctrineFixturesBundle#192.

@fbourigault
Copy link
Contributor Author

Tests are failing because travis switched the default box to trusty which don't have php5.3 support. I will open an other PR to fix this.

Copy link
Member

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, agree with the change. about php 5.3 lets just drop it and bump up to php 5.6

$paths = array();
/** @var $kernel \Symfony\Component\HttpKernel\KernelInterface */
$kernel = $this->getApplication()->getKernel();
$paths = array($kernel->getRootDir().'/DataFixtures/PHPCR');
foreach ($this->getApplication()->getKernel()->getBundles() as $bundle) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change this to $kernel->getBundles(), no need to get application and kernel twice

@@ -135,7 +135,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($dirOrFile) {
$paths = is_array($dirOrFile) ? $dirOrFile : array($dirOrFile);
} else {
$paths = array();
/** @var $kernel \Symfony\Component\HttpKernel\KernelInterface */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i prefer to use a short class name here and use it at the top if its not already used.

@fbourigault
Copy link
Contributor Author

It looks like it's the purpose of #282.

@dbu
Copy link
Member

dbu commented Oct 24, 2017

yes but that got stuck because dependencies not working correctly on 7.2. in the end its super bizarre: phpcr/phpcr-utils#174

i did not get around to dig into it and figure out what exactly is wrong. we could simply drop 5.3 separately. anyways, i can merge this pull request without the 5.3 build being green, its not related. can you please update to the comments i made?

@fbourigault
Copy link
Contributor Author

I addressed all your comments.

@dbu dbu merged commit 5290b92 into doctrine:master Oct 26, 2017
@dbu
Copy link
Member

dbu commented Oct 26, 2017

thank you very much! if you see a place in the documentation where this should be mentioned, please do a pull request. this is the bundle, so docs should be in symfony-cmf-docs and not in the doctrine documentation.

@fbourigault fbourigault deleted the feature/kernel-root-directory-fixtures branch October 26, 2017 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants