Skip to content

Commit

Permalink
Update InitTestSchemaCommand.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ngodfraind committed Feb 29, 2016
1 parent 3c56f47 commit b6507e5
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions Command/Dev/InitTestSchemaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand;
use Claroline\InstallationBundle\Bundle\InstallableBundle;
use Claroline\InstallationBundle\Fixtures\FixtureLoader;

class InitTestSchemaCommand extends ContainerAwareCommand
{
Expand Down Expand Up @@ -77,27 +75,10 @@ private function createSchema(OutputInterface $output)
);
$consoleLogger = new ConsoleLogger($output, $verbosityLevelMap);
$migrator->setLogger($consoleLogger);
$fixtureLoader = $this->getContainer()->get('claroline.installation.fixture_loader');


foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
if ($bundle instanceof InstallableBundle && $bundle->hasMigrations()) {

if (count($migrator->getBundleStatus($bundle)[Migrator::STATUS_AVAILABLE]) > 1) {
$migrator->upgradeBundle($bundle, Migrator::VERSION_FARTHEST);
}

if ($bundle instanceof PluginBundle) {
$this->getContainer()->get('claroline.plugin.installer')->install($bundle);
} elseif ($bundle instanceof InstallableInterface) {
$this->getContainer()->get('claroline.installation.manager')->setLogger($consoleLogger);
$this->getContainer()->get('claroline.installation.manager')->install($bundle, true);
}

if ($fixturesDir = $bundle->getRequiredFixturesDirectory($this->environment)) {
$output->writeln('Loading required fixtures...');
$fixtureLoader->load($bundle, $fixturesDir);
}
if (count($migrator->getBundleStatus($bundle)[Migrator::STATUS_AVAILABLE]) > 1) {
$migrator->upgradeBundle($bundle, Migrator::VERSION_FARTHEST);
}
}
}
Expand Down

0 comments on commit b6507e5

Please sign in to comment.