diff --git a/src/Symfony/Bundle/DoctrineAbstractBundle/Common/DataFixtures/Loader.php b/src/Symfony/Bundle/DoctrineAbstractBundle/Common/DataFixtures/Loader.php deleted file mode 100644 index 1e7c2f754b2f..000000000000 --- a/src/Symfony/Bundle/DoctrineAbstractBundle/Common/DataFixtures/Loader.php +++ /dev/null @@ -1,27 +0,0 @@ -container = $container; - } - - public function addFixture(FixtureInterface $fixture) - { - if ($fixture instanceof ContainerAwareInterface) { - $fixture->setContainer($this->container); - } - - parent::addFixture($fixture); - } -} diff --git a/src/Symfony/Bundle/DoctrineAbstractBundle/Tests/Common/ContainerAwareFixture.php b/src/Symfony/Bundle/DoctrineAbstractBundle/Tests/Common/ContainerAwareFixture.php deleted file mode 100644 index 51a873cd56da..000000000000 --- a/src/Symfony/Bundle/DoctrineAbstractBundle/Tests/Common/ContainerAwareFixture.php +++ /dev/null @@ -1,21 +0,0 @@ -container = $container; - } - - public function load($manager) - { - } -} diff --git a/src/Symfony/Bundle/DoctrineAbstractBundle/Tests/Common/DataFixtures/LoaderTest.php b/src/Symfony/Bundle/DoctrineAbstractBundle/Tests/Common/DataFixtures/LoaderTest.php deleted file mode 100644 index 8bef32a6e230..000000000000 --- a/src/Symfony/Bundle/DoctrineAbstractBundle/Tests/Common/DataFixtures/LoaderTest.php +++ /dev/null @@ -1,21 +0,0 @@ -getMock('Symfony\Component\DependencyInjection\ContainerInterface'); - $loader = new Loader($container); - $fixture = new ContainerAwareFixture(); - - $loader->addFixture($fixture); - - $this->assertSame($container, $fixture->container); - } -} diff --git a/src/Symfony/Bundle/DoctrineAbstractBundle/Tests/TestCase.php b/src/Symfony/Bundle/DoctrineAbstractBundle/Tests/TestCase.php deleted file mode 100644 index 17326b6d5a87..000000000000 --- a/src/Symfony/Bundle/DoctrineAbstractBundle/Tests/TestCase.php +++ /dev/null @@ -1,13 +0,0 @@ -markTestSkipped('Doctrine Data Fixtures is not available.'); - } - } -} diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/LoadDataFixturesDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/LoadDataFixturesDoctrineCommand.php deleted file mode 100644 index 5a21e5169ca3..000000000000 --- a/src/Symfony/Bundle/DoctrineBundle/Command/LoadDataFixturesDoctrineCommand.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\DoctrineBundle\Command; - -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; -use Symfony\Component\Finder\Finder; -use Symfony\Component\HttpKernel\Util\Filesystem; -use Symfony\Bundle\DoctrineAbstractBundle\Common\DataFixtures\Loader as DataFixturesLoader; -use Doctrine\Common\DataFixtures\Executor\ORMExecutor; -use Doctrine\Common\DataFixtures\Purger\ORMPurger; -use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Internal\CommitOrderCalculator; -use Doctrine\ORM\Mapping\ClassMetadata; -use InvalidArgumentException; - -/** - * Load data fixtures from bundles. - * - * @author Fabien Potencier - * @author Jonathan H. Wage - */ -class LoadDataFixturesDoctrineCommand extends DoctrineCommand -{ - protected function configure() - { - $this - ->setName('doctrine:data:load') - ->setDescription('Load data fixtures to your database.') - ->addOption('fixtures', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The directory or file to load data fixtures from.') - ->addOption('append', null, InputOption::VALUE_NONE, 'Append the data fixtures instead of flushing the database first.') - ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->setHelp(<<doctrine:data:load command loads data fixtures from your bundles: - - ./app/console doctrine:data:load - -You can also optionally specify the path to fixtures with the --fixtures option: - - ./app/console doctrine:data:load --fixtures=/path/to/fixtures1 --fixtures=/path/to/fixtures2 - -If you want to append the fixtures instead of flushing the database first you can use the --append option: - - ./app/console doctrine:data:load --append -EOT - ); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $emName = $input->getOption('em'); - $emName = $emName ? $emName : 'default'; - $emServiceName = sprintf('doctrine.orm.%s_entity_manager', $emName); - - if (!$this->container->has($emServiceName)) { - throw new InvalidArgumentException( - sprintf( - 'Could not find an entity manager configured with the name "%s". Check your '. - 'application configuration to configure your Doctrine entity managers.', $emName - ) - ); - } - - $em = $this->container->get($emServiceName); - $dirOrFile = $input->getOption('fixtures'); - if ($dirOrFile) { - $paths = is_array($dirOrFile) ? $dirOrFile : array($dirOrFile); - } else { - $paths = array(); - foreach ($this->getApplication()->getKernel()->getBundles() as $bundle) { - $paths[] = $bundle->getPath().'/DataFixtures/ORM'; - } - } - - $loader = new DataFixturesLoader($this->container); - foreach ($paths as $path) { - if (is_dir($path)) { - $loader->loadFromDirectory($path); - } - } - $fixtures = $loader->getFixtures(); - if (!$fixtures) { - throw new InvalidArgumentException( - sprintf('Could not find any fixtures to load in: %s', "\n\n- ".implode("\n- ", $paths)) - ); - } - $purger = new ORMPurger($em); - $executor = new ORMExecutor($em, $purger); - $executor->setLogger(function($message) use ($output) { - $output->writeln(sprintf(' > %s', $message)); - }); - $executor->execute($fixtures, $input->getOption('append')); - } -} \ No newline at end of file diff --git a/vendors.sh b/vendors.sh index 3f2723ce446b..397000184926 100755 --- a/vendors.sh +++ b/vendors.sh @@ -40,9 +40,6 @@ install_git assetic git://github.com/kriswallsmith/assetic.git # Doctrine ORM install_git doctrine git://github.com/doctrine/doctrine2.git 2.0.4 -# Doctrine Data Fixtures Extension -install_git doctrine-data-fixtures git://github.com/doctrine/data-fixtures.git - # Doctrine DBAL install_git doctrine-dbal git://github.com/doctrine/dbal.git 2.0.4