--- a/.hgsubstate Fri Nov 18 17:54:18 2011 +0100
+++ b/.hgsubstate Fri Nov 25 18:55:43 2011 +0100
@@ -1,1 +1,1 @@
-e48c2e5039459d5e1a90a077b740fbbf53663456 vendor/bundles/IRI/Bundle/WikiTagBundle
+0e57c730bb180b2f25aca6cac72f0bd479e1f30c vendor/bundles/IRI/Bundle/WikiTagBundle
--- a/app/AppKernel.php Fri Nov 18 17:54:18 2011 +0100
+++ b/app/AppKernel.php Fri Nov 25 18:55:43 2011 +0100
@@ -21,6 +21,7 @@
new FOS\UserBundle\FOSUserBundle(),
new Company\UserBundle\CompanyUserBundle(),
new IRI\Bundle\WikiTagBundle\WikiTagBundle(),
+ new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/app/DoctrineMigrations/Version20111125175224.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,63 @@
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration,
+ Doctrine\DBAL\Schema\Schema;
+
+/**
+ * Auto-generated Migration: Please modify to your need!
+ */
+class Version20111125175224 extends AbstractMigration
+{
+ public function up(Schema $schema)
+ {
+ // this up() migration is autogenerated, please modify it to your needs
+ $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
+
+ $this->addSql("ALTER TABLE wikitag_document ADD CONSTRAINT FK_256601059F75D7B0 FOREIGN KEY (external_id) REFERENCES Document(id)");
+ $this->addSql("ALTER TABLE wikitag_document_tag CHANGE wikipedia_revision_id wikipedia_revision_id BIGINT DEFAULT NULL");
+ $this->addSql("ALTER TABLE wikitag_tag ADD alternative_label VARCHAR(1024) DEFAULT NULL, ADD wikipedia_alternative_url VARCHAR(2048) DEFAULT NULL, ADD alternative_wikipedia_pageid BIGINT DEFAULT NULL, CHANGE normalized_pageid wikipedia_pageid BIGINT DEFAULT NULL");
+ }
+
+ public function postUp(Schema $schema)
+ {
+ $evm = new EventManager();
+ $em = EntityManager::create($conn, $this->configuration, $evm);
+
+ //select all tags with redirect and alternative label null
+ $query = $em->createQuery("SELECT t FROM WikiTagBundle:Tag t WHERE t.urlStatus = :url_status AND t.alternativeLabel IS NULL");
+ $query->setParameter("url_status", Tag::$TAG_URL_STATUS_DICT['redirection']);
+
+ $iterableResult = $query->iterate();
+ $i = 0;
+
+ foreach($iterableResult AS $row) {
+ $i++;
+ $tag = $row[0];
+
+ //process $tag
+ $wk_info = WikiTagUtils::getWikipediaInfo($tag->getNormalizedLabel());
+
+ $tag->setWikipediaInfo($wk_info);
+
+ if (($i % 100) == 0) {
+ $em->flush(); // Executes all updates.
+ $em->clear(); // Detaches all objects from Doctrine!
+ }
+ }
+
+ }
+
+ public function down(Schema $schema)
+ {
+ // this down() migration is autogenerated, please modify it to your needs
+ $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
+
+ $this->addSql("ALTER TABLE wikitag_document DROP FOREIGN KEY FK_256601059F75D7B0");
+ $this->addSql("ALTER TABLE wikitag_document_tag CHANGE wikipedia_revision_id wikipedia_revision_id BIGINT NOT NULL");
+ $this->addSql("ALTER TABLE wikitag_tag ADD normalized_pageid BIGINT DEFAULT NULL, DROP alternative_label, DROP wikipedia_alternative_url, DROP alternative_wikipedia_pageid, CHANGE wikipedia_pageid normalized_pageid BIGINT DEFAULT NULL");
+ }
+
+
+}
--- a/app/autoload.php Fri Nov 18 17:54:18 2011 +0100
+++ b/app/autoload.php Fri Nov 25 18:55:43 2011 +0100
@@ -5,19 +5,20 @@
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
- 'Symfony' => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
- 'Sensio' => __DIR__.'/../vendor/bundles',
- 'JMS' => __DIR__.'/../vendor/bundles',
- 'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
- 'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib',
- 'Doctrine' => __DIR__.'/../vendor/doctrine/lib',
- 'Monolog' => __DIR__.'/../vendor/monolog/src',
- 'Assetic' => __DIR__.'/../vendor/assetic/src',
- 'Metadata' => __DIR__.'/../vendor/metadata/src',
- 'FOS' => __DIR__.'/../vendor/bundles',
- 'Pagerfanta' => __DIR__.'/../vendor/bundles',
- 'Mandango\Mondator' => __DIR__.'/../vendor/mondator/src',
- 'IRI\Bundle\WikiTagBundle' => __DIR__.'/../vendor/bundles',
+ 'Symfony' => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
+ 'Sensio' => __DIR__.'/../vendor/bundles',
+ 'JMS' => __DIR__.'/../vendor/bundles',
+ 'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
+ 'Doctrine\\DBAL\\Migrations' => __DIR__.'/../vendor/doctrine-migrations/lib',
+ 'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib',
+ 'Doctrine' => __DIR__.'/../vendor/doctrine/lib',
+ 'Monolog' => __DIR__.'/../vendor/monolog/src',
+ 'Assetic' => __DIR__.'/../vendor/assetic/src',
+ 'Metadata' => __DIR__.'/../vendor/metadata/src',
+ 'FOS' => __DIR__.'/../vendor/bundles',
+ 'Pagerfanta' => __DIR__.'/../vendor/bundles',
+ 'Mandango\Mondator' => __DIR__.'/../vendor/mondator/src',
+ 'IRI\Bundle\WikiTagBundle' => __DIR__.'/../vendor/bundles',
));
$loader->registerPrefixes(array(
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
--- a/deps Fri Nov 18 17:54:18 2011 +0100
+++ b/deps Fri Nov 25 18:55:43 2011 +0100
@@ -22,6 +22,9 @@
git=http://github.com/doctrine/doctrine2.git
version=2.1.1
+[doctrine-migrations]
+ git=http://github.com/doctrine/migrations.git
+
[swiftmailer]
git=http://github.com/swiftmailer/swiftmailer.git
version=v4.1.1
@@ -57,4 +60,7 @@
git=http://github.com/symfony/AsseticBundle.git
target=/bundles/Symfony/Bundle/AsseticBundle
version=v1.0.0
-
\ No newline at end of file
+
+[DoctrineMigrationsBundle]
+ git=http://github.com/symfony/DoctrineMigrationsBundle.git
+ target=/bundles/Symfony/Bundle/DoctrineMigrationsBundle
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/DoctrineCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,39 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle\Command;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Bundle\FrameworkBundle\Console\Application;
+use Symfony\Bundle\DoctrineBundle\Command\DoctrineCommand as BaseCommand;
+use Doctrine\DBAL\Migrations\Configuration\Configuration;
+
+/**
+ * Base class for Doctrine console commands to extend from.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+abstract class DoctrineCommand extends BaseCommand
+{
+ public static function configureMigrations(ContainerInterface $container, Configuration $configuration)
+ {
+ $dir = $container->getParameter('doctrine_migrations.dir_name');
+ if (!file_exists($dir)) {
+ mkdir($dir, 0777, true);
+ }
+
+ $configuration->setMigrationsNamespace($container->getParameter('doctrine_migrations.namespace'));
+ $configuration->setMigrationsDirectory($dir);
+ $configuration->registerMigrationsFromDirectory($dir);
+ $configuration->setName($container->getParameter('doctrine_migrations.name'));
+ $configuration->setMigrationsTableName($container->getParameter('doctrine_migrations.table_name'));
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/MigrationsDiffDoctrineCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,48 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle\Command;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Bundle\DoctrineBundle\Command\Proxy\DoctrineCommandHelper;
+use Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand;
+
+/**
+ * Command for generate migration classes by comparing your current database schema
+ * to your mapping information.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class MigrationsDiffDoctrineCommand extends DiffCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this
+ ->setName('doctrine:migrations:diff')
+ ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.')
+ ;
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
+
+ $configuration = $this->getMigrationConfiguration($input, $output);
+ DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
+
+ parent::execute($input, $output);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/MigrationsExecuteDoctrineCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,47 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle\Command;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Bundle\DoctrineBundle\Command\Proxy\DoctrineCommandHelper;
+use Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand;
+
+/**
+ * Command for executing single migrations up or down manually.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class MigrationsExecuteDoctrineCommand extends ExecuteCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this
+ ->setName('doctrine:migrations:execute')
+ ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.')
+ ;
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
+
+ $configuration = $this->getMigrationConfiguration($input, $output);
+ DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
+
+ parent::execute($input, $output);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/MigrationsGenerateDoctrineCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,47 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle\Command;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Bundle\DoctrineBundle\Command\Proxy\DoctrineCommandHelper;
+use Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand;
+
+/**
+ * Command for generating new blank migration classes
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class MigrationsGenerateDoctrineCommand extends GenerateCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this
+ ->setName('doctrine:migrations:generate')
+ ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.')
+ ;
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
+
+ $configuration = $this->getMigrationConfiguration($input, $output);
+ DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
+
+ parent::execute($input, $output);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/MigrationsMigrateDoctrineCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,47 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle\Command;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Bundle\DoctrineBundle\Command\Proxy\DoctrineCommandHelper;
+use Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand;
+
+/**
+ * Command for executing a migration to a specified version or the latest available version.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class MigrationsMigrateDoctrineCommand extends MigrateCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this
+ ->setName('doctrine:migrations:migrate')
+ ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.')
+ ;
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
+
+ $configuration = $this->getMigrationConfiguration($input, $output);
+ DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
+
+ parent::execute($input, $output);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/MigrationsStatusDoctrineCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,47 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle\Command;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Bundle\DoctrineBundle\Command\Proxy\DoctrineCommandHelper;
+use Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand;
+
+/**
+ * Command to view the status of a set of migrations.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class MigrationsStatusDoctrineCommand extends StatusCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this
+ ->setName('doctrine:migrations:status')
+ ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.')
+ ;
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
+
+ $configuration = $this->getMigrationConfiguration($input, $output);
+ DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
+
+ parent::execute($input, $output);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/MigrationsVersionDoctrineCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,47 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle\Command;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Bundle\DoctrineBundle\Command\Proxy\DoctrineCommandHelper;
+use Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand;
+
+/**
+ * Command for manually adding and deleting migration versions from the version table.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class MigrationsVersionDoctrineCommand extends VersionCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this
+ ->setName('doctrine:migrations:version')
+ ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.')
+ ;
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
+
+ $configuration = $this->getMigrationConfiguration($input, $output);
+ DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
+
+ parent::execute($input, $output);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/DependencyInjection/Configuration.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,35 @@
+<?php
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle\DependencyInjection;
+
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
+
+/**
+ * DoctrineMigrationsExtension configuration structure.
+ *
+ * @author Lukas Kahwe Smith <smith@pooteeweet.org>
+ */
+class Configuration
+{
+ /**
+ * Generates the configuration tree.
+ *
+ * @return \Symfony\Component\Config\Definition\ArrayNode The config tree
+ */
+ public function getConfigTree()
+ {
+ $treeBuilder = new TreeBuilder();
+ $rootNode = $treeBuilder->root('doctrine_migrations', 'array');
+
+ $rootNode
+ ->children()
+ ->scalarNode('dir_name')->defaultValue('%kernel.root_dir%/DoctrineMigrations')->cannotBeEmpty()->end()
+ ->scalarNode('namespace')->defaultValue('Application\Migrations')->cannotBeEmpty()->end()
+ ->scalarNode('table_name')->defaultValue('migration_versions')->cannotBeEmpty()->end()
+ ->scalarNode('name')->defaultValue('Application Migrations')->end()
+ ->end()
+ ;
+
+ return $treeBuilder->buildTree();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/DependencyInjection/DoctrineMigrationsExtension.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,57 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle\DependencyInjection;
+
+use Symfony\Component\Config\Definition\Processor;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+
+/**
+ * DoctrineMigrationsExtension.
+ *
+ * @author Lukas Kahwe Smith <smith@pooteeweet.org>
+ */
+class DoctrineMigrationsExtension extends Extension
+{
+ /**
+ * Responds to the twig configuration parameter.
+ *
+ * @param array $configs
+ * @param ContainerBuilder $container
+ */
+ public function load(array $configs, ContainerBuilder $container)
+ {
+ $processor = new Processor();
+ $configuration = new Configuration();
+
+ $config = $processor->process($configuration->getConfigTree(), $configs);
+
+ foreach ($config as $key => $value) {
+ $container->setParameter($this->getAlias().'.'.$key, $value);
+ }
+ }
+
+ /**
+ * Returns the base path for the XSD files.
+ *
+ * @return string The XSD base path
+ */
+ public function getXsdValidationBasePath()
+ {
+ return __DIR__.'/../Resources/config/schema';
+ }
+
+ public function getNamespace()
+ {
+ return 'http://symfony.com/schema/dic/doctrine/migrations';
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/DoctrineMigrationsBundle.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,24 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\DoctrineMigrationsBundle;
+
+use Symfony\Component\HttpKernel\Bundle\Bundle;
+
+/**
+ * Bundle.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class DoctrineMigrationsBundle extends Bundle
+{
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/README.markdown Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,8 @@
+DoctrineMigrationsBundle
+========================
+
+This bundle integrates the [Doctrine2 Migrations library](http://www.doctrine-project.org/projects/migrations).
+into Symfony so that you can safely and quickly manage database migrations.
+
+Documentation on how to install and use this bundle is available in the
+Symfony2 [documentation](http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html).
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Resources/doc/index.rst Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,286 @@
+DoctrineMigrationsBundle
+========================
+
+The database migrations feature is an extension of the database abstraction
+layer and offers you the ability to programmatically deploy new versions of
+your database schema in a safe, easy and standardized way.
+
+.. tip::
+
+ You can read more about the Doctrine Database Migrations on the project's
+ `documentation`_.
+
+Installation
+------------
+
+Doctrine migrations for Symfony are maintained in the `DoctrineMigrationsBundle`_.
+Make sure you have both the ``doctrine-migrations`` and ``DoctrineMigrationsBundle``
+libraries configured in your project. Follow these steps to install the
+libraries in the Symfony Standard distribution.
+
+Add the following to ``deps``. This will register the Migrations Bundle
+and the doctrine-migrations library as dependencies in your application:
+
+.. code-block:: text
+
+ [doctrine-migrations]
+ git=http://github.com/doctrine/migrations.git
+
+ [DoctrineMigrationsBundle]
+ git=http://github.com/symfony/DoctrineMigrationsBundle.git
+ target=/bundles/Symfony/Bundle/DoctrineMigrationsBundle
+
+Update the vendor libraries:
+
+.. code-block:: bash
+
+ $ php bin/vendors install
+
+Next, ensure the new ``Doctrine\DBAL\Migrations`` namespace will be autoloaded
+via ``autoload.php``. The new ``Migrations`` namespace *must* be placed above
+the ``Doctrine\\DBAL`` entry so that the autoloader looks inside the migrations
+directory for those classes:
+
+.. code-block:: php
+
+ // app/autoload.php
+ $loader->registerNamespaces(array(
+ //...
+ 'Doctrine\\DBAL\\Migrations' => __DIR__.'/../vendor/doctrine-migrations/lib',
+ 'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib',
+ ));
+
+Finally, be sure to enable the bundle in ``AppKernel.php`` by including the
+following:
+
+.. code-block:: php
+
+ // app/AppKernel.php
+ public function registerBundles()
+ {
+ $bundles = array(
+ //...
+ new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(),
+ );
+ }
+
+Usage
+-----
+
+All of the migrations functionality is contained in a few console commands:
+
+.. code-block:: bash
+
+ doctrine:migrations
+ :diff Generate a migration by comparing your current database to your mapping information.
+ :execute Execute a single migration version up or down manually.
+ :generate Generate a blank migration class.
+ :migrate Execute a migration to a specified version or the latest available version.
+ :status View the status of a set of migrations.
+ :version Manually add and delete migration versions from the version table.
+
+Start by getting the status of migrations in your application by running
+the ``status`` command:
+
+.. code-block:: bash
+
+ php app/console doctrine:migrations:status
+
+ == Configuration
+
+ >> Name: Application Migrations
+ >> Configuration Source: manually configured
+ >> Version Table Name: migration_versions
+ >> Migrations Namespace: Application\Migrations
+ >> Migrations Directory: /path/to/project/app/DoctrineMigrations
+ >> Current Version: 0
+ >> Latest Version: 0
+ >> Executed Migrations: 0
+ >> Available Migrations: 0
+ >> New Migrations: 0
+
+Now, you can start working with migrations by generating a new blank migration
+class. Later, you'll learn how Doctrine can generate migrations automatically
+for you.
+
+.. code-block:: bash
+
+ php app/console doctrine:migrations:generate
+ Generated new migration class to "/path/to/project/app/DoctrineMigrations/Version20100621140655.php"
+
+Have a look at the newly generated migration class and you will see something
+like the following::
+
+ namespace Application\Migrations;
+
+ use Doctrine\DBAL\Migrations\AbstractMigration,
+ Doctrine\DBAL\Schema\Schema;
+
+ class Version20100621140655 extends AbstractMigration
+ {
+ public function up(Schema $schema)
+ {
+
+ }
+
+ public function down(Schema $schema)
+ {
+
+ }
+ }
+
+If you run the ``status`` command it will now show that you have one new
+migration to execute:
+
+.. code-block:: bash
+
+ php app/console doctrine:migrations:status
+
+ == Configuration
+
+ >> Name: Application Migrations
+ >> Configuration Source: manually configured
+ >> Version Table Name: migration_versions
+ >> Migrations Namespace: Application\Migrations
+ >> Migrations Directory: /path/to/project/app/DoctrineMigrations
+ >> Current Version: 0
+ >> Latest Version: 2010-06-21 14:06:55 (20100621140655)
+ >> Executed Migrations: 0
+ >> Available Migrations: 1
+ >> New Migrations: 1
+
+ == Migration Versions
+
+ >> 2010-06-21 14:06:55 (20100621140655) not migrated
+
+Now you can add some migration code to the ``up()`` and ``down()`` methods and
+finally migrate when you're ready:
+
+.. code-block:: bash
+
+ php app/console doctrine:migrations:migrate
+
+For more information on how to write the migrations themselves (i.e. how to
+fill in the ``up()`` and ``down()`` methods), see the official Doctrine Migrations
+`documentation`_.
+
+Running Migrations during Deployment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Of course, the end goal of writing migrations is to be able to use them to
+reliably update your database structure when you deploy your application.
+By running the migrations locally (or on a beta server), you can ensure that
+the migrations work as you expect.
+
+When you do finally deploy your application, you just need to remember to run
+the ``doctrine:migrations:migrate`` command. Internally, Doctrine creates
+a ``migration_versions`` table inside your database and tracks which migrations
+have been executed there. So, no matter how many migrations you've created
+and executed locally, when you run the command during deployment, Doctrine
+will know exactly which migrations it hasn't run yet by looking at the ``migration_versions``
+table of your production database. Regardless of what server you're on, you
+can always safely run this command to execute only the migrations that haven't
+been run yet on *that* particular database.
+
+Generating Migrations Automatically
+-----------------------------------
+
+In reality, you should rarely need to write migrations manually, as the migrations
+library can generate migration classes automatically by comparing your Doctrine
+mapping information (i.e. what your database *should* look like) with your
+actual current database structure.
+
+For example, suppose you create a new ``User`` entity and add mapping information
+for Doctrine's ORM:
+
+.. configuration-block::
+
+ .. code-block:: php-annotations
+
+ // src/Acme/HelloBundle/Entity/User.php
+ namespace Acme\HelloBundle\Entity;
+
+ use Doctrine\ORM\Mapping as ORM;
+
+ /**
+ * @ORM\Entity
+ * @ORM\Table(name="hello_user")
+ */
+ class User
+ {
+ /**
+ * @ORM\Id
+ * @ORM\Column(type="integer")
+ * @ORM\GeneratedValue(strategy="AUTO")
+ */
+ protected $id;
+
+ /**
+ * @ORM\Column(type="string", length="255")
+ */
+ protected $name;
+ }
+
+ .. code-block:: yaml
+
+ # src/Acme/HelloBundle/Resources/config/doctrine/User.orm.yml
+ Acme\HelloBundle\Entity\User:
+ type: entity
+ table: hello_user
+ id:
+ id:
+ type: integer
+ generator:
+ strategy: AUTO
+ fields:
+ name:
+ type: string
+ length: 255
+
+ .. code-block:: xml
+
+ <!-- src/Acme/HelloBundle/Resources/config/doctrine/User.orm.xml -->
+ <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
+ http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
+
+ <entity name="Acme\HelloBundle\Entity\User" table="hello_user">
+ <id name="id" type="integer" column="id">
+ <generator strategy="AUTO"/>
+ </id>
+ <field name="name" column="name" type="string" length="255" />
+ </entity>
+
+ </doctrine-mapping>
+
+With this information, Doctrine is now ready to help you persist your new
+``User`` object to and from the ``hello_user`` table. Of course, this table
+doesn't exist yet! Generate a new migration for this table automatically by
+running the following command:
+
+.. code-block:: bash
+
+ php app/console doctrine:migrations:diff
+
+You should see a message that a new migration class was generated based on
+the schema differences. If you open this file, you'll find that it has the
+SQL code needed to create the ``hello_user`` table. Next, run the migration
+to add the table to your database:
+
+.. code-block:: bash
+
+ php app/console doctrine:migrations:migrate
+
+The moral of the story is this: after each change you make to your Doctrine
+mapping information, run the ``doctrine:migrations:diff`` command to automatically
+generate your migration classes.
+
+If you do this from the very beginning of your project (i.e. so that even
+the first tables were loaded via a migration class), you'll always be able
+to create a fresh database and run your migrations in order to get your database
+schema fully up to date. In fact, this is an easy and dependable workflow
+for your project.
+
+.. _documentation: http://www.doctrine-project.org/projects/migrations/2.0/docs/reference/introduction/en
+.. _DoctrineMigrationsBundle: https://github.com/symfony/DoctrineMigrationsBundle
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/LICENSE Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/README.markdown Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,58 @@
+# Doctrine Database Migrations
+
+## Eric Clemmons' Modifications
+
+The latest official PHAR had path issues for me, so I made a couple of modifications and made
+packaging a bit easier, especially when creating a custom PHAR for your own apps.
+
+[Download `doctrine-migrations.phar` with custom Input/Output CLI support](http://github.com/downloads/ericclemmons/migrations/doctrine-migrations.phar)
+
+### Modifications
+
+* Added `DiffCommand` for migrations.
+* Support for custom `ArgvInput` in CLI instance
+* Support for custom `ConsoleOutput` in CLI instance
+
+In the same way that Doctrine will attempt to load the return values from `migrations-db.php` as your
+connection parameters, you can have `migrations-input.php` return:
+
+ $input = new \Symfony\Component\Console\Input\ArgvInput;
+ ... make some changes ...
+ return $input;
+
+or have `migrations-output.php` return a customized `ConsoleOutput` with support for HTML tags in
+your SQL statements:
+
+ $output = new \Symfony\Component\Console\Output\ConsoleOutput;
+ $output->setStyle('p');
+ return $output;
+
+This should give you the flexibility you need for customizing your input/output in the CLI.
+
+### Building Your Phar
+
+Simply run `php package.php`, which will create the file: `build/doctrine-migrations.phar` for you.
+Done! :) This is a bit simpler than getting Phing/Ant going and running `phing build-migrations` and
+hoping the rest of the build dependencies work.
+
+### Creating archive disabled by INI setting
+
+If you receive an error that looks like:
+
+ creating archive "build/doctrine-migrations.phar" disabled by INI setting
+
+This can be fixed by setting the following in your php.ini:
+
+ ; http://php.net/phar.readonly
+ phar.readonly = Off
+
+### Installing Dependencies
+
+To install dependencies issue the following commands:
+
+ git submodule init
+ git submodule update
+
+## Official Documentation
+
+All available documentation can be found [here](http://www.doctrine-project.org/projects/migrations/2.0/docs/en).
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/build.properties.dev Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,13 @@
+version=2.0.0ALPHA1
+stability=alpha
+build.dir=build
+dist.dir=dist
+report.dir=reports
+log.archive.dir=logs
+test.phpunit_configuration_file=
+test.phpunit_generate_coverage=0
+test.pmd_reports=0
+test.pdepend_exec=
+test.phpmd_exec=
+test.phpunit_configuration_option=phpunit-dest.xml
+test.phpunit_coverage_option=
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/build.xml Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,160 @@
+<?xml version="1.0"?>
+
+<!--
+ Doctrine 2 build file.
+-->
+
+<project name="DoctrineMigrations" default="build" basedir=".">
+ <property file="build.properties" />
+
+ <!--
+ Fileset for artifacts shared across all distributed packages.
+ -->
+ <fileset id="shared-artifacts" dir=".">
+ <include name="LICENSE"/>
+ </fileset>
+
+ <!--
+ Fileset for the sources of the Doctrine Common dependency.
+ -->
+ <fileset id="common-sources" dir="./lib/vendor/doctrine-common/lib">
+ <include name="Doctrine/Common/**"/>
+ </fileset>
+
+ <!--
+ Fileset for the sources of the Doctrine Migrations.
+ -->
+ <fileset id="migrations-sources" dir="./lib">
+ <include name="Doctrine/DBAL/Migrations/**"/>
+ </fileset>
+
+ <!--
+ Fileset for the sources of the Doctrine DBAL package.
+ -->
+ <fileset id="dbal-sources" dir="./lib/vendor/doctrine-dbal/lib">
+ <include name="Doctrine/DBAL/**"/>
+ </fileset>
+
+ <!--
+ Fileset for source of the Symfony YAML and Console components.
+ -->
+ <fileset id="symfony-sources" dir="./lib/vendor">
+ <include name="Symfony/Components/**"/>
+ </fileset>
+
+ <!--
+ Clean the directory for the next build.
+ -->
+ <target name="clean">
+ <available file="./build.properties" property="build_properties_exist" value="true"/>
+ <fail unless="build_properties_exist" message="The build.properties file is missing." />
+
+ <delete dir="${build.dir}" includeemptydirs="true" />
+ <delete dir="${dist.dir}" includeemptydirs="true" />
+ <delete dir="${report.dir}" includeemptydirs="true" />
+ </target>
+
+ <!--
+ Prepare the new build directories after cleaning
+ -->
+ <target name="prepare" depends="clean">
+ <echo msg="Creating build directory: ${build.dir}" />
+ <mkdir dir="${build.dir}" />
+ <echo msg="Creating distribution directory: ${dist.dir}" />
+ <mkdir dir="${dist.dir}" />
+ <echo msg="Creating report directory: ${report.dir}" />
+ <mkdir dir="${report.dir}" />
+ <mkdir dir="${build.dir}/logs"/>
+ <mkdir dir="${report.dir}/tests"/>
+ </target>
+
+ <!--
+ Builds Migrations package, preparing it for distribution.
+ -->
+ <target name="build-migrations" depends="test">
+ <copy todir="${build.dir}/migrations">
+ <fileset refid="shared-artifacts"/>
+ </copy>
+ <copy todir="${build.dir}/migrations">
+ <fileset refid="common-sources"/>
+ <fileset refid="dbal-sources" />
+ <fileset refid="migrations-sources"/>
+ </copy>
+ <copy todir="${build.dir}/migrations/Doctrine">
+ <fileset refid="symfony-sources"/>
+ </copy>
+ <exec command="sed 's/${version}-DEV/${version}/' ${build.dir}/migrations/Doctrine/DBAL/Migrations/Version.php > ${build.dir}/migrations/Doctrine/DBAL/Migrations/Version2.php" passthru="true" />
+ <exec command="mv ${build.dir}/migrations/Doctrine/DBAL/Migrations/Version2.php ${build.dir}/migrations/Doctrine/DBAL/Migrations/Version.php" passthru="true" />
+
+ <pharpackage destfile="${build.dir}/doctrine-migrations.phar" basedir="${build.dir}/migrations" stub="./phar-cli-stub.php">
+ <fileset dir="${build.dir}/migrations">
+ <include name="**/**" />
+ </fileset>
+ <metadata>
+ <element name="version" value="${version}" />
+ <element name="authors">
+ <element name="Johnathan H. Wage">
+ <element name="e-mail" value="jonwage@gmail.com" />
+ </element>
+ </element>
+ </metadata>
+ </pharpackage>
+
+ </target>
+
+ <target name="build" depends="test, build-migrations"/>
+
+ <!--
+ Runs the full test suite.
+ -->
+ <target name="test" depends="prepare">
+ <if><equals arg1="${test.phpunit_generate_coverage}" arg2="1" />
+ <then>
+ <property name="test.phpunit_coverage_file" value="${build.dir}/logs/clover.xml" />
+ </then>
+ <else>
+ <property name="test.phpunit_coverage_file" value="false" />
+ </else>
+ </if>
+
+ <exec command="phpunit --configuration ${test.phpunit_configuration_option} ${test.phpunit_coverage_option} --log-junit ${project.basedir}/${build.dir}/logs/testsuites.xml Doctrine/DBAL/Migrations/Tests/" dir="./tests" passthru="true" />
+ <phpunitreport infile="${build.dir}/logs/testsuites.xml" format="frames" todir="${report.dir}/tests" />
+
+ <tstamp/>
+ <copy file="${build.dir}/logs/testsuites.xml" tofile="${log.archive.dir}/latest/log.xml" overwrite="true"/>
+
+ <if><equals arg1="${test.pmd_reports}" arg2="1" />
+ <then>
+ <exec command="${test.pdepend_exec} --jdepend-xml=${build.dir}/logs/jdepend.xml ./lib/Doctrine" />
+ <exec command="${test.phpmd_exec} ./lib/Doctrine xml codesize --reportfile ${build.dir}/logs/phpmd.xml" />
+
+ <copy file="${build.dir}/logs/jdepend.xml" tofile="${log.archive.dir}/latest/jdepend.xml" overwrite="true"/>
+ <copy file="${build.dir}/logs/phpmd.xml" tofile="${log.archive.dir}/latest/phpmd.xml" overwrite="true"/>
+ </then>
+ </if>
+ </target>
+
+ <!--
+ Builds distributable PEAR packages.
+ -->
+ <target name="build-packages" depends="build-migrations">
+ <taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
+ <d51pearpkg2 baseinstalldir="/" dir="${build.dir}/migrations">
+ <name>DoctrineMigrations</name>
+ <summary>Doctrine Database Migrations</summary>
+ <channel>pear.doctrine-project.org</channel>
+ <description>The Doctrine migrations offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is easy to use and a very powerful tool!</description>
+ <lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
+ <license>LGPL</license>
+ <version release="${version}" api="${version}" />
+ <stability release="${stability}" api="${stability}" />
+ <notes>-</notes>
+ <dependencies>
+ <php minimum_version="5.3.0" />
+ <pear minimum_version="1.6.0" recommended_version="1.6.1" />
+ </dependencies>
+ </d51pearpkg2>
+ <exec command="pear package" dir="${build.dir}/migrations" passthru="true" />
+ <exec command="mv DoctrineMigrations-${version}.tgz ../../dist" dir="${build.dir}/migrations" passthru="true" />
+ </target>
+</project>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/composer.json Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,18 @@
+{
+ "name": "doctrine/migrations",
+ "type": "library",
+ "description": "Database Schema migrations using Doctrine DBAL",
+ "keywords": ["migrations", "database"],
+ "homepage": "http://www.doctrine-project.org",
+ "license": "LGPL",
+ "authors": [
+ {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
+ {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}
+ ],
+ "require": {
+ "php": ">=5.3.2",
+ "ext-pdo": "*",
+ "doctrine/common": ">=2.0",
+ "doctrine/dbal": ">=2.0"
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/AbortMigrationException.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,8 @@
+<?php
+
+namespace Doctrine\DBAL\Migrations;
+
+class AbortMigrationException extends MigrationException
+{
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/AbstractMigration.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,178 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations;
+
+use Doctrine\DBAL\Schema\Schema,
+ Doctrine\DBAL\Migrations\Configuration\Configuration,
+ Doctrine\DBAL\Migrations\Version;
+
+/**
+ * Abstract class for individual migrations to extend from.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+abstract class AbstractMigration
+{
+ /**
+ * The Migrations Configuration instance for this migration
+ *
+ * @var Configuration
+ */
+ private $configuration;
+
+ /**
+ * The OutputWriter object instance used for outputting information
+ *
+ * @var OutputWriter
+ */
+ private $outputWriter;
+
+ /**
+ * The Doctrine\DBAL\Connection instance we are migrating
+ *
+ * @var Connection
+ */
+ protected $connection;
+
+ /**
+ * Reference to the SchemaManager instance referened by $_connection
+ *
+ * @var \Doctrine\DBAL\Schema\AbstractSchemaManager
+ */
+ protected $sm;
+
+ /**
+ * Reference to the DatabasePlatform instance referenced by $_conection
+ *
+ * @var \Doctrine\DBAL\Platforms\AbstractPlatform
+ */
+ protected $platform;
+
+ /**
+ * Reference to the Version instance representing this migration
+ *
+ * @var Version
+ */
+ protected $version;
+
+ public function __construct(Version $version)
+ {
+ $this->configuration = $version->getConfiguration();
+ $this->outputWriter = $this->configuration->getOutputWriter();
+ $this->connection = $this->configuration->getConnection();
+ $this->sm = $this->connection->getSchemaManager();
+ $this->platform = $this->connection->getDatabasePlatform();
+ $this->version = $version;
+ }
+
+ /**
+ * Get custom migration name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ }
+
+ abstract public function up(Schema $schema);
+ abstract public function down(Schema $schema);
+
+ protected function addSql($sql, array $params = array())
+ {
+ return $this->version->addSql($sql, $params);
+ }
+
+ protected function write($message)
+ {
+ $this->outputWriter->write($message);
+ }
+
+ protected function throwIrreversibleMigrationException($message = null)
+ {
+ if ($message === null) {
+ $message = 'This migration is irreversible and cannot be reverted.';
+ }
+ throw new IrreversibleMigrationException($message);
+ }
+
+ /**
+ * Print a warning message if the condition evalutes to TRUE.
+ *
+ * @param bool $condition
+ * @param string $message
+ */
+ public function warnIf($condition, $message = '')
+ {
+ $message = (strlen($message)) ? $message : 'Unknown Reason';
+
+ if ($condition === true) {
+ $this->outputWriter->write(' <warning>Warning during ' . $this->version->getExecutionState() . ': ' . $message . '</warning>');
+ }
+ }
+
+ /**
+ * Abort the migration if the condition evalutes to TRUE.
+ *
+ * @param bool $condition
+ * @param string $message
+ */
+ public function abortIf($condition, $message = '')
+ {
+ $message = (strlen($message)) ? $message : 'Unknown Reason';
+
+ if ($condition === true) {
+ throw new AbortMigrationException($message);
+ }
+ }
+
+ /**
+ * Skip this migration (but not the next ones) if condition evalutes to TRUE.
+ *
+ * @param bool $condition
+ * @param string $message
+ */
+ public function skipIf($condition, $message = '')
+ {
+ $message = (strlen($message)) ? $message : 'Unknown Reason';
+
+ if ($condition === true) {
+ throw new SkipMigrationException($message);
+ }
+ }
+
+ public function preUp(Schema $schema)
+ {
+ }
+
+ public function postUp(Schema $schema)
+ {
+ }
+
+ public function preDown(Schema $schema)
+ {
+ }
+
+ public function postDown(Schema $schema)
+ {
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Configuration/AbstractFileConfiguration.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,93 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations\Configuration;
+
+use Doctrine\DBAL\Migrations\MigrationsException;
+
+/**
+ * Abstract Migration Configuration class for loading configuration information
+ * from a configuration file (xml or yml).
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+abstract class AbstractFileConfiguration extends Configuration
+{
+ /**
+ * The configuration file used to load configuration information
+ *
+ * @var string
+ */
+ private $file;
+
+ /**
+ * Whether or not the configuration file has been loaded yet or not
+ *
+ * @var bool
+ */
+ private $loaded = false;
+
+ /**
+ * Load the information from the passed configuration file
+ *
+ * @param string $file The path to the configuration file
+ * @return void
+ * @throws MigrationException $exception Throws exception if configuration file was already loaded
+ */
+ public function load($file)
+ {
+ if ($this->loaded) {
+ throw MigrationsException::configurationFileAlreadyLoaded();
+ }
+ if (file_exists($path = getcwd() . '/' . $file)) {
+ $file = $path;
+ }
+ $this->file = $file;
+ $this->doLoad($file);
+ $this->loaded = true;
+ }
+
+ protected function getDirectoryRelativeToFile($file, $input)
+ {
+ $path = realpath(dirname($file) . '/' . $input);
+ if ($path !== false) {
+ $directory = $path;
+ } else {
+ $directory = $input;
+ }
+ return $directory;
+ }
+
+ public function getFile()
+ {
+ return $this->file;
+ }
+
+ /**
+ * Abstract method that each file configuration driver must implement to
+ * load the given configuration file whether it be xml, yaml, etc. or something
+ * else.
+ *
+ * @param string $file The path to a configuration file.
+ */
+ abstract protected function doLoad($file);
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,512 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations\Configuration;
+
+use Doctrine\DBAL\Connection,
+ Doctrine\DBAL\Migrations\MigrationException,
+ Doctrine\DBAL\Migrations\Version,
+ Doctrine\DBAL\Migrations\OutputWriter,
+ Doctrine\DBAL\Schema\Table,
+ Doctrine\DBAL\Schema\Column,
+ Doctrine\DBAL\Types\Type;
+
+/**
+ * Default Migration Configurtion object used for configuring an instance of
+ * the Migration class. Set the connection, version table name, register migration
+ * classes/versions, etc.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class Configuration
+{
+ /**
+ * Name of this set of migrations
+ *
+ * @var string
+ */
+ private $name;
+
+ /**
+ * Flag for whether or not the migration table has been created
+ *
+ * @var bool
+ */
+ private $migrationTableCreated = false;
+
+ /**
+ * Connection instance to use for migrations
+ *
+ * @var Connection
+ */
+ private $connection;
+
+ /**
+ * OutputWriter instance for writing output during migrations
+ *
+ * @var OutputWriter
+ */
+ private $outputWriter;
+
+ /**
+ * The migration table name to track versions in
+ *
+ * @var string
+ */
+ private $migrationsTableName = 'doctrine_migration_versions';
+
+ /**
+ * The path to a directory where new migration classes will be written
+ *
+ * @var string
+ */
+ private $migrationsDirectory;
+
+ /**
+ * Namespace the migration classes live in
+ *
+ * @var string
+ */
+ private $migrationsNamespace;
+
+ /**
+ * Array of the registered migrations
+ *
+ * @var array
+ */
+ private $migrations = array();
+
+ /**
+ * Construct a migration configuration object.
+ *
+ * @param Connection $connection A Connection instance
+ * @param OutputWriter $outputWriter A OutputWriter instance
+ */
+ public function __construct(Connection $connection, OutputWriter $outputWriter = null)
+ {
+ $this->connection = $connection;
+ if ($outputWriter === null) {
+ $outputWriter = new OutputWriter();
+ }
+ $this->outputWriter = $outputWriter;
+ }
+
+ /**
+ * Validation that this instance has all the required properties configured
+ *
+ * @return void
+ * @throws MigrationException
+ */
+ public function validate()
+ {
+ if ( ! $this->migrationsNamespace) {
+ throw MigrationException::migrationsNamespaceRequired();
+ }
+ if ( ! $this->migrationsDirectory) {
+ throw MigrationException::migrationsDirectoryRequired();
+ }
+ }
+
+ /**
+ * Set the name of this set of migrations
+ *
+ * @param string $name The name of this set of migrations
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * Returns the name of this set of migrations
+ *
+ * @return string $name The name of this set of migrations
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the OutputWriter instance
+ *
+ * @return OutputWriter $outputWriter The OutputWriter instance
+ */
+ public function getOutputWriter()
+ {
+ return $this->outputWriter;
+ }
+
+ /**
+ * Returns a timestamp version as a formatted date
+ *
+ * @param string $version
+ * @return string $formattedVersion The formatted version
+ */
+ public function formatVersion($version)
+ {
+ return sprintf('%s-%s-%s %s:%s:%s',
+ substr($version, 0, 4),
+ substr($version, 4, 2),
+ substr($version, 6, 2),
+ substr($version, 8, 2),
+ substr($version, 10, 2),
+ substr($version, 12, 2)
+ );
+ }
+
+ /**
+ * Returns the Connection instance
+ *
+ * @return Connection $connection The Connection instance
+ */
+ public function getConnection()
+ {
+ return $this->connection;
+ }
+
+ /**
+ * Set the migration table name
+ *
+ * @param string $tableName The migration table name
+ */
+ public function setMigrationsTableName($tableName)
+ {
+ $this->migrationsTableName = $tableName;
+ }
+
+ /**
+ * Returns the migration table name
+ *
+ * @return string $migrationsTableName The migration table name
+ */
+ public function getMigrationsTableName()
+ {
+ return $this->migrationsTableName;
+ }
+
+ /**
+ * Set the new migrations directory where new migration classes are generated
+ *
+ * @param string $migrationsDirectory The new migrations directory
+ */
+ public function setMigrationsDirectory($migrationsDirectory)
+ {
+ $this->migrationsDirectory = $migrationsDirectory;
+ }
+
+ /**
+ * Returns the new migrations directory where new migration classes are generated
+ *
+ * @return string $migrationsDirectory The new migrations directory
+ */
+ public function getMigrationsDirectory()
+ {
+ return $this->migrationsDirectory;
+ }
+
+ /**
+ * Set the migrations namespace
+ *
+ * @param string $migrationsNamespace The migrations namespace
+ */
+ public function setMigrationsNamespace($migrationsNamespace)
+ {
+ $this->migrationsNamespace = $migrationsNamespace;
+ }
+
+ /**
+ * Returns the migrations namespace
+ *
+ * @return string $migrationsNamespace The migrations namespace
+ */
+ public function getMigrationsNamespace()
+ {
+ return $this->migrationsNamespace;
+ }
+
+ /**
+ * Register migrations from a given directory. Recursively finds all files
+ * with the pattern VersionYYYYMMDDHHMMSS.php as the filename and registers
+ * them as migrations.
+ *
+ * @param string $path The root directory to where some migration classes live.
+ * @return $migrations The array of migrations registered.
+ */
+ public function registerMigrationsFromDirectory($path)
+ {
+ $path = realpath($path);
+ $path = rtrim($path, '/');
+ $files = glob($path . '/Version*.php');
+ $versions = array();
+ if ($files) {
+ foreach ($files as $file) {
+ require_once($file);
+ $info = pathinfo($file);
+ $version = substr($info['filename'], 7);
+ $class = $this->migrationsNamespace . '\\' . $info['filename'];
+ $versions[] = $this->registerMigration($version, $class);
+ }
+ }
+ return $versions;
+ }
+
+ /**
+ * Register a single migration version to be executed by a AbstractMigration
+ * class.
+ *
+ * @param string $version The version of the migration in the format YYYYMMDDHHMMSS.
+ * @param string $class The migration class to execute for the version.
+ */
+ public function registerMigration($version, $class)
+ {
+ $version = (string) $version;
+ $class = (string) $class;
+ if (isset($this->migrations[$version])) {
+ throw MigrationException::duplicateMigrationVersion($version, get_class($this->migrations[$version]));
+ }
+ $version = new Version($this, $version, $class);
+ $this->migrations[$version->getVersion()] = $version;
+ ksort($this->migrations);
+ return $version;
+ }
+
+ /**
+ * Register an array of migrations. Each key of the array is the version and
+ * the value is the migration class name.
+ *
+ *
+ * @param array $migrations
+ * @return void
+ */
+ public function registerMigrations(array $migrations)
+ {
+ $versions = array();
+ foreach ($migrations as $version => $class) {
+ $versions[] = $this->registerMigration($version, $class);
+ }
+ return $versions;
+ }
+
+ /**
+ * Get the array of registered migration versions.
+ *
+ * @return array $migrations
+ */
+ public function getMigrations()
+ {
+ return $this->migrations;
+ }
+
+ /**
+ * Returns the Version instance for a given version in the format YYYYMMDDHHMMSS.
+ *
+ * @param string $version The version string in the format YYYYMMDDHHMMSS.
+ * @return Version $version
+ * @throws MigrationException $exception Throws exception if migration version does not exist.
+ */
+ public function getVersion($version)
+ {
+ if ( ! isset($this->migrations[$version])) {
+ throw MigrationException::unknownMigrationVersion($version);
+ }
+ return $this->migrations[$version];
+ }
+
+ /**
+ * Check if a version exists.
+ *
+ * @param string $version
+ * @return bool $exists
+ */
+ public function hasVersion($version)
+ {
+ return isset($this->migrations[$version]) ? true : false;
+ }
+
+ /**
+ * Check if a version has been migrated or not yet
+ *
+ * @param Version $version
+ * @return bool $migrated
+ */
+ public function hasVersionMigrated(Version $version)
+ {
+ $this->createMigrationTable();
+
+ $version = $this->connection->fetchColumn("SELECT version FROM " . $this->migrationsTableName . " WHERE version = ?", array($version->getVersion()));
+ return $version !== false ? true : false;
+ }
+
+ /**
+ * Returns all migrated versions from the versions table, in an array.
+ *
+ * @return array $migrated
+ */
+ public function getMigratedVersions()
+ {
+ $this->createMigrationTable();
+
+ $ret = $this->connection->fetchAll("SELECT version FROM " . $this->migrationsTableName);
+ $versions = array();
+ foreach ($ret as $version) {
+ $versions[] = current($version);
+ }
+
+ return $versions;
+ }
+
+ /**
+ * Returns the current migrated version from the versions table.
+ *
+ * @return bool $currentVersion
+ */
+ public function getCurrentVersion()
+ {
+ $this->createMigrationTable();
+
+ $sql = "SELECT version FROM " . $this->migrationsTableName . " ORDER BY version DESC";
+ $sql = $this->connection->getDatabasePlatform()->modifyLimitQuery($sql, 1);
+ $result = $this->connection->fetchColumn($sql);
+ return $result !== false ? (string) $result : '0';
+ }
+
+ /**
+ * Returns the total number of executed migration versions
+ *
+ * @return integer $count
+ */
+ public function getNumberOfExecutedMigrations()
+ {
+ $this->createMigrationTable();
+
+ $result = $this->connection->fetchColumn("SELECT COUNT(version) FROM " . $this->migrationsTableName);
+ return $result !== false ? $result : 0;
+ }
+
+ /**
+ * Returns the total number of available migration versions
+ *
+ * @return integer $count
+ */
+ public function getNumberOfAvailableMigrations()
+ {
+ return count($this->migrations);
+ }
+
+ /**
+ * Returns the latest available migration version.
+ *
+ * @return string $version The version string in the format YYYYMMDDHHMMSS.
+ */
+ public function getLatestVersion()
+ {
+ $versions = array_keys($this->migrations);
+ $latest = end($versions);
+ return $latest !== false ? (string) $latest : '0';
+ }
+
+ /**
+ * Create the migration table to track migrations with.
+ *
+ * @return bool $created Whether or not the table was created.
+ */
+ public function createMigrationTable()
+ {
+ $this->validate();
+
+ if ($this->migrationTableCreated) {
+ return false;
+ }
+
+ $schema = $this->connection->getSchemaManager()->createSchema();
+ if ( ! $schema->hasTable($this->migrationsTableName)) {
+ $columns = array(
+ 'version' => new Column('version', Type::getType('string'), array('length' => 255)),
+ );
+ $table = new Table($this->migrationsTableName, $columns);
+ $table->setPrimaryKey(array('version'));
+ $this->connection->getSchemaManager()->createTable($table);
+
+ $this->migrationTableCreated = true;
+
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the array of migrations to executed based on the given direction
+ * and target version number.
+ *
+ * @param string $direction The direction we are migrating.
+ * @param string $to The version to migrate to.
+ * @return array $migrations The array of migrations we can execute.
+ */
+ public function getMigrationsToExecute($direction, $to)
+ {
+ if ($direction === 'down') {
+ if (count($this->migrations)) {
+ $allVersions = array_reverse(array_keys($this->migrations));
+ $classes = array_reverse(array_values($this->migrations));
+ $allVersions = array_combine($allVersions, $classes);
+ } else {
+ $allVersions = array();
+ }
+ } else {
+ $allVersions = $this->migrations;
+ }
+ $versions = array();
+ $migrated = $this->getMigratedVersions();
+ foreach ($allVersions as $version) {
+ if ($this->shouldExecuteMigration($direction, $version, $to, $migrated)) {
+ $versions[$version->getVersion()] = $version;
+ }
+ }
+ return $versions;
+ }
+
+ /**
+ * Check if we should execute a migration for a given direction and target
+ * migration version.
+ *
+ * @param string $direction The direction we are migrating.
+ * @param Version $version The Version instance to check.
+ * @param string $to The version we are migrating to.
+ * @param array $migrated Migrated versions array.
+ * @return void
+ */
+ private function shouldExecuteMigration($direction, Version $version, $to, $migrated)
+ {
+ if ($direction === 'down') {
+ if ( ! in_array($version->getVersion(), $migrated)) {
+ return false;
+ }
+ return $version->getVersion() > $to ? true : false;
+ } else if ($direction === 'up') {
+ if (in_array($version->getVersion(), $migrated)) {
+ return false;
+ }
+ return $version->getVersion() <= $to ? true : false;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Configuration/XmlConfiguration.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,58 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations\Configuration;
+
+/**
+ * Load migration configuration information from a XML configuration file.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class XmlConfiguration extends AbstractFileConfiguration
+{
+ /**
+ * @inheritdoc
+ */
+ protected function doLoad($file)
+ {
+ $xml = simplexml_load_file($file);
+ if (isset($xml->name)) {
+ $this->setName((string) $xml->name);
+ }
+ if (isset($xml->table['name'])) {
+ $this->setMigrationsTableName((string) $xml->table['name']);
+ }
+ if (isset($xml->{'migrations-namespace'})) {
+ $this->setMigrationsNamespace((string) $xml->{'migrations-namespace'});
+ }
+ if (isset($xml->{'migrations-directory'})) {
+ $migrationsDirectory = $this->getDirectoryRelativeToFile($file, (string) $xml->{'migrations-directory'});
+ $this->setMigrationsDirectory($migrationsDirectory);
+ $this->registerMigrationsFromDirectory($migrationsDirectory);
+ }
+ if (isset($xml->migrations->migration)) {
+ foreach ($xml->migrations->migration as $migration) {
+ $this->registerMigration((string) $migration['version'], (string) $migration['class']);
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Configuration/YamlConfiguration.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,61 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations\Configuration;
+
+use Symfony\Component\Yaml\Yaml;
+
+/**
+ * Load migration configuration information from a YAML configuration file.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class YamlConfiguration extends AbstractFileConfiguration
+{
+ /**
+ * @inheritdoc
+ */
+ protected function doLoad($file)
+ {
+ $array = Yaml::parse($file);
+
+ if (isset($array['name'])) {
+ $this->setName($array['name']);
+ }
+ if (isset($array['table_name'])) {
+ $this->setMigrationsTableName($array['table_name']);
+ }
+ if (isset($array['migrations_namespace'])) {
+ $this->setMigrationsNamespace($array['migrations_namespace']);
+ }
+ if (isset($array['migrations_directory'])) {
+ $migrationsDirectory = $this->getDirectoryRelativeToFile($file, $array['migrations_directory']);
+ $this->setMigrationsDirectory($migrationsDirectory);
+ $this->registerMigrationsFromDirectory($migrationsDirectory);
+ }
+ if (isset($array['migrations']) && is_array($array['migrations'])) {
+ foreach ($array['migrations'] as $migration) {
+ $this->registerMigration($migration['version'], $migration['class']);
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/IrreversibleMigrationException.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,33 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations;
+
+/**
+ * Exception to be thrown in the down() methods of migrations that signifies it
+ * is an irreversible migration and stops execution.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class IrreversibleMigrationException extends \Exception
+{
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Migration.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,160 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations;
+
+use Doctrine\DBAL\Migrations\Configuration\Configuration,
+ Doctrine\DBAL\Schema\Schema;
+
+/**
+ * Class for running migrations to the current version or a manually specified version.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class Migration
+{
+ /**
+ * The OutputWriter object instance used for outputting information
+ *
+ * @var OutputWriter
+ */
+ private $outputWriter;
+
+ /**
+ * @var Configuration
+ */
+ private $configuration;
+
+ /**
+ * Construct a Migration instance
+ *
+ * @param Configuration $configuration A migration Configuration instance
+ */
+ public function __construct(Configuration $configuration)
+ {
+ $this->configuration = $configuration;
+ $this->outputWriter = $configuration->getOutputWriter();
+ }
+
+ /**
+ * Get the array of versions and SQL queries that would be executed for
+ * each version but do not execute anything.
+ *
+ * @param string $to The version to migrate to.
+ * @return array $sql The array of SQL queries.
+ */
+ public function getSql($to = null)
+ {
+ return $this->migrate($to, true);
+ }
+
+ /**
+ * Write a migration SQL file to the given path
+ *
+ * @param string $path The path to write the migration SQL file.
+ * @param string $to The version to migrate to.
+ * @return bool $written
+ */
+ public function writeSqlFile($path, $to = null)
+ {
+ $sql = $this->getSql($to);
+
+ $from = $this->configuration->getCurrentVersion();
+ if ($to === null) {
+ $to = $this->configuration->getLatestVersion();
+ }
+
+ $string = sprintf("# Doctrine Migration File Generated on %s\n", date('Y-m-d H:m:s'));
+ $string .= sprintf("# Migrating from %s to %s\n", $from, $to);
+
+ foreach ($sql as $version => $queries) {
+ $string .= "\n# Version " . $version . "\n";
+ foreach ($queries as $query) {
+ $string .= $query . ";\n";
+ }
+ }
+ if (is_dir($path)) {
+ $path = realpath($path);
+ $path = $path . '/doctrine_migration_' . date('YmdHis') . '.sql';
+ }
+
+ $this->outputWriter->write("\n".sprintf('Writing migration file to "<info>%s</info>"', $path));
+
+ return file_put_contents($path, $string);
+ }
+
+ /**
+ * Run a migration to the current version or the given target version.
+ *
+ * @param string $to The version to migrate to.
+ * @param string $dryRun Whether or not to make this a dry run and not execute anything.
+ * @return array $sql The array of migration sql statements
+ * @throws MigrationException
+ */
+ public function migrate($to = null, $dryRun = false)
+ {
+ if ($to === null) {
+ $to = $this->configuration->getLatestVersion();
+ }
+
+ $from = $this->configuration->getCurrentVersion();
+ $from = (string) $from;
+ $to = (string) $to;
+
+ $migrations = $this->configuration->getMigrations();
+ if ( ! isset($migrations[$to]) && $to > 0) {
+ throw MigrationException::unknownMigrationVersion($to);
+ }
+
+ if ($from === $to) {
+ return array();
+ }
+
+ $direction = $from > $to ? 'down' : 'up';
+ $migrations = $this->configuration->getMigrationsToExecute($direction, $to);
+
+ if ($dryRun === false) {
+ $this->outputWriter->write(sprintf('Migrating <info>%s</info> to <comment>%s</comment> from <comment>%s</comment>', $direction, $to, $from));
+ } else {
+ $this->outputWriter->write(sprintf('Executing dry run of migration <info>%s</info> to <comment>%s</comment> from <comment>%s</comment>', $direction, $to, $from));
+ }
+
+ if (empty($migrations)) {
+ throw MigrationException::noMigrationsToExecute();
+ }
+
+ $sql = array();
+ $time = 0;
+ foreach ($migrations as $version) {
+ $versionSql = $version->execute($direction, $dryRun);
+ $sql[$version->getVersion()] = $versionSql;
+ $time += $version->getTime();
+ }
+
+ $this->outputWriter->write("\n <comment>------------------------</comment>\n");
+ $this->outputWriter->write(sprintf(" <info>++</info> finished in %s", $time));
+ $this->outputWriter->write(sprintf(" <info>++</info> %s migrations executed", count($migrations)));
+ $this->outputWriter->write(sprintf(" <info>++</info> %s sql queries", count($sql, true) - count($sql)));
+
+ return $sql;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/MigrationException.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,66 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations;
+
+/**
+ * Class for Migrations specific exceptions
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class MigrationException extends \Exception
+{
+ public static function migrationsNamespaceRequired()
+ {
+ return new self('Migrations namespace must be configured in order to use Doctrine migrations.', 2);
+ }
+
+ public static function migrationsDirectoryRequired()
+ {
+ return new self('Migrations directory must be configured in order to use Doctrine migrations.', 3);
+ }
+
+ public static function noMigrationsToExecute()
+ {
+ return new self('Could not find any migrations to execute.', 4);
+ }
+
+ public static function unknownMigrationVersion($version)
+ {
+ return new self(sprintf('Could not find migration version %s', $version), 5);
+ }
+
+ public static function alreadyAtVersion($version)
+ {
+ return new self(sprintf('Database is already at version %s', $version), 6);
+ }
+
+ public static function duplicateMigrationVersion($version, $class)
+ {
+ return new self(sprintf('Migration version %s already registered with class %s', $version, $class), 7);
+ }
+
+ public static function configurationFileAlreadyLoaded()
+ {
+ return new self(sprintf('Migrations configuration file already loaded'), 8);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/MigrationsVersion.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,26 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+
+namespace Doctrine\DBAL\Migrations;
+
+class MigrationsVersion
+{
+ const VERSION = '2.0.0-DEV';
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/OutputWriter.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,52 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations;
+
+/**
+ * Simple class for outputting information from migrations.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class OutputWriter
+{
+ private $closure;
+
+ public function __construct(\Closure $closure = null)
+ {
+ if ($closure === null) {
+ $closure = function($message) {};
+ }
+ $this->closure = $closure;
+ }
+
+ /**
+ * Write output using the configured closure.
+ *
+ * @param string $message The message to write.
+ */
+ public function write($message)
+ {
+ $closure = $this->closure;
+ $closure($message);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/SkipMigrationException.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,8 @@
+<?php
+
+namespace Doctrine\DBAL\Migrations;
+
+class SkipMigrationException extends MigrationException
+{
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,122 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\DBAL\Migrations\Tools\Console\Command;
+
+use Symfony\Component\Console\Command\Command,
+ Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Input\InputOption,
+ Doctrine\DBAL\Migrations\Migration,
+ Doctrine\DBAL\Migrations\MigrationException,
+ Doctrine\DBAL\Migrations\OutputWriter,
+ Doctrine\DBAL\Migrations\Configuration\Configuration,
+ Doctrine\DBAL\Migrations\Configuration\YamlConfiguration,
+ Doctrine\DBAL\Migrations\Configuration\XmlConfiguration;
+
+/**
+ * CLI Command for adding and deleting migration versions from the version table.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan Wage <jonwage@gmail.com>
+ */
+abstract class AbstractCommand extends Command
+{
+ /**
+ * @var Configuration
+ */
+ private $configuration;
+
+ protected function configure()
+ {
+ $this->addOption('configuration', null, InputOption::VALUE_OPTIONAL, 'The path to a migrations configuration file.');
+ $this->addOption('db-configuration', null, InputOption::VALUE_OPTIONAL, 'The path to a database connection configuration file.');
+ }
+
+ protected function outputHeader(Configuration $configuration, OutputInterface $output)
+ {
+ $name = $configuration->getName();
+ $name = $name ? $name : 'Doctrine Database Migrations';
+ $name = str_repeat(' ', 20) . $name . str_repeat(' ', 20);
+ $output->writeln('<question>' . str_repeat(' ', strlen($name)) . '</question>');
+ $output->writeln('<question>' . $name . '</question>');
+ $output->writeln('<question>' . str_repeat(' ', strlen($name)) . '</question>');
+ $output->writeln('');
+ }
+
+ public function setMigrationConfiguration(Configuration $config)
+ {
+ $this->configuration = $config;
+ }
+
+ /**
+ * @param InputInterface $input
+ * @param OutputInterface $output
+ * @return Configuration
+ */
+ protected function getMigrationConfiguration(InputInterface $input, OutputInterface $output)
+ {
+ if ( ! $this->configuration) {
+ $outputWriter = new OutputWriter(function($message) use ($output) {
+ return $output->writeln($message);
+ });
+
+ if ($this->getApplication()->getHelperSet()->has('db')) {
+ $conn = $this->getHelper('db')->getConnection();
+ } else if($input->getOption('db-configuration')) {
+ if (!file_exists($input->getOption('db-configuration'))) {
+ throw new \InvalidArgumentException("The specified connection file is not a valid file.");
+ }
+
+ $params = include($input->getOption('db-configuration'));
+ if (!is_array($params)) {
+ throw new \InvalidArgumentException('The connection file has to return an array with database configuration parameters.');
+ }
+ $conn = \Doctrine\DBAL\DriverManager::getConnection($params);
+ } else if (file_exists('migrations-db.php')) {
+ $params = include("migrations-db.php");
+ if (!is_array($params)) {
+ throw new \InvalidArgumentException('The connection file has to return an array with database configuration parameters.');
+ }
+ $conn = \Doctrine\DBAL\DriverManager::getConnection($params);
+ } else {
+ throw new \InvalidArgumentException('You have to specify a --db-configuration file or pass a Database Connection as a dependency to the Migrations.');
+ }
+
+ if ($input->getOption('configuration')) {
+ $info = pathinfo($input->getOption('configuration'));
+ $class = $info['extension'] === 'xml' ? 'Doctrine\DBAL\Migrations\Configuration\XmlConfiguration' : 'Doctrine\DBAL\Migrations\Configuration\YamlConfiguration';
+ $configuration = new $class($conn, $outputWriter);
+ $configuration->load($input->getOption('configuration'));
+ } else if (file_exists('migrations.xml')) {
+ $configuration = new XmlConfiguration($conn, $outputWriter);
+ $configuration->load('migrations.xml');
+ } else if (file_exists('migrations.yml')) {
+ $configuration = new YamlConfiguration($conn, $outputWriter);
+ $configuration->load('migrations.yml');
+ } else {
+ $configuration = new Configuration($conn, $outputWriter);
+ }
+ $this->configuration = $configuration;
+ }
+ return $this->configuration;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/DiffCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,106 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\DBAL\Migrations\Tools\Console\Command;
+
+use Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Doctrine\ORM\Tools\SchemaTool,
+ Doctrine\DBAL\Migrations\Configuration\Configuration;
+
+/**
+ * Command for generate migration classes by comparing your current database schema
+ * to your mapping information.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan Wage <jonwage@gmail.com>
+ */
+class DiffCommand extends GenerateCommand
+{
+ protected function configure()
+ {
+ parent::configure();
+
+ $this
+ ->setName('migrations:diff')
+ ->setDescription('Generate a migration by comparing your current database to your mapping information.')
+ ->setHelp(<<<EOT
+The <info>%command.name%</info> command generates a migration by comparing your current database to your mapping information:
+
+ <info>%command.full_name%</info>
+
+You can optionally specify a <comment>--editor-cmd</comment> option to open the generated file in your favorite editor:
+
+ <info>%command.full_name% --editor-cmd=mate</info>
+EOT
+ );
+
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ $configuration = $this->getMigrationConfiguration($input, $output);
+
+ $em = $this->getHelper('em')->getEntityManager();
+ $conn = $em->getConnection();
+ $platform = $conn->getDatabasePlatform();
+ $metadata = $em->getMetadataFactory()->getAllMetadata();
+
+ if (empty($metadata)) {
+ $output->writeln('No mapping information to process.', 'ERROR');
+ return;
+ }
+
+ $tool = new SchemaTool($em);
+
+ $fromSchema = $conn->getSchemaManager()->createSchema();
+ $toSchema = $tool->getSchemaFromMetadata($metadata);
+ $up = $this->buildCodeFromSql($configuration, $fromSchema->getMigrateToSql($toSchema, $platform));
+ $down = $this->buildCodeFromSql($configuration, $fromSchema->getMigrateFromSql($toSchema, $platform));
+
+ if ( ! $up && ! $down) {
+ $output->writeln('No changes detected in your mapping information.', 'ERROR');
+ return;
+ }
+
+ $version = date('YmdHis');
+ $path = $this->generateMigration($configuration, $input, $version, $up, $down);
+
+ $output->writeln(sprintf('Generated new migration class to "<info>%s</info>" from schema differences.', $path));
+ }
+
+ private function buildCodeFromSql(Configuration $configuration, array $sql)
+ {
+ $currentPlatform = $configuration->getConnection()->getDatabasePlatform()->getName();
+ $code = array(
+ "\$this->abortIf(\$this->connection->getDatabasePlatform()->getName() != \"$currentPlatform\");", "",
+ );
+ foreach ($sql as $query) {
+ if (strpos($query, $configuration->getMigrationsTableName()) !== false) {
+ continue;
+ }
+ $code[] = "\$this->addSql(\"$query\");";
+ }
+ return implode("\n", $code);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/ExecuteCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,102 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\DBAL\Migrations\Tools\Console\Command;
+
+use Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Doctrine\DBAL\Migrations\Migration,
+ Doctrine\DBAL\Migrations\Configuration\Configuration,
+ Doctrine\DBAL\Migrations\Configuration\YamlConfiguration,
+ Doctrine\DBAL\Migrations\Configuration\XmlConfiguration;
+
+/**
+ * Command for executing single migrations up or down manually.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan Wage <jonwage@gmail.com>
+ */
+class ExecuteCommand extends AbstractCommand
+{
+ protected function configure()
+ {
+ $this
+ ->setName('migrations:execute')
+ ->setDescription('Execute a single migration version up or down manually.')
+ ->addArgument('version', InputArgument::REQUIRED, 'The version to execute.', null)
+ ->addOption('write-sql', null, InputOption::VALUE_NONE, 'The path to output the migration SQL file instead of executing it.')
+ ->addOption('dry-run', null, InputOption::VALUE_NONE, 'Execute the migration as a dry run.')
+ ->addOption('up', null, InputOption::VALUE_NONE, 'Execute the migration down.')
+ ->addOption('down', null, InputOption::VALUE_NONE, 'Execute the migration down.')
+ ->setHelp(<<<EOT
+The <info>%command.name%</info> command executes a single migration version up or down manually:
+
+ <info>%command.full_name% YYYYMMDDHHMMSS</info>
+
+If no <comment>--up</comment> or <comment>--down</comment> option is specified it defaults to up:
+
+ <info>%command.full_name% YYYYMMDDHHMMSS --down</info>
+
+You can also execute the migration as a <comment>--dry-run</comment>:
+
+ <info>%command.full_name% YYYYMMDDHHMMSS --dry-run</info>
+
+You can output the would be executed SQL statements to a file with <comment>--write-sql</comment>:
+
+ <info>%command.full_name% YYYYMMDDHHMMSS --write-sql</info>
+
+Or you can also execute the migration without a warning message wich you need to interact with:
+
+ <info>%command.full_name% --no-interaction</info>
+EOT
+ );
+
+ parent::configure();
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ $version = $input->getArgument('version');
+ $direction = $input->getOption('down') ? 'down' : 'up';
+
+ $configuration = $this->getMigrationConfiguration($input, $output);
+ $version = $configuration->getVersion($version);
+
+ if ($path = $input->getOption('write-sql')) {
+ $path = is_bool($path) ? getcwd() : $path;
+ $version->writeSqlFile($path, $direction);
+ } else {
+ $noInteraction = $input->getOption('no-interaction') ? true : false;
+ if ($noInteraction === true) {
+ $version->execute($direction, $input->getOption('dry-run') ? true : false);
+ } else {
+ $confirmation = $this->getHelper('dialog')->askConfirmation($output, '<question>WARNING! You are about to execute a database migration that could result in schema changes and data lost. Are you sure you wish to continue? (y/n)</question>', false);
+ if ($confirmation === true) {
+ $version->execute($direction, $input->getOption('dry-run') ? true : false);
+ } else {
+ $output->writeln('<error>Migration cancelled!</error>');
+ }
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,130 @@
+<?php
+
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\DBAL\Migrations\Tools\Console\Command;
+
+use Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Doctrine\DBAL\Migrations\MigrationException,
+ Doctrine\DBAL\Migrations\Configuration\Configuration;
+
+/**
+ * Command for generating new blank migration classes
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan Wage <jonwage@gmail.com>
+ */
+class GenerateCommand extends AbstractCommand
+{
+
+ private static $_template =
+ '<?php
+
+namespace <namespace>;
+
+use Doctrine\DBAL\Migrations\AbstractMigration,
+ Doctrine\DBAL\Schema\Schema;
+
+/**
+ * Auto-generated Migration: Please modify to your need!
+ */
+class Version<version> extends AbstractMigration
+{
+ public function up(Schema $schema)
+ {
+ // this up() migration is autogenerated, please modify it to your needs
+<up>
+ }
+
+ public function down(Schema $schema)
+ {
+ // this down() migration is autogenerated, please modify it to your needs
+<down>
+ }
+}
+';
+
+ protected function configure()
+ {
+ $this
+ ->setName('migrations:generate')
+ ->setDescription('Generate a blank migration class.')
+ ->addOption('editor-cmd', null, InputOption::VALUE_OPTIONAL, 'Open file with this command upon creation.')
+ ->setHelp(<<<EOT
+The <info>%command.name%</info> command generates a blank migration class:
+
+ <info>%command.full_name%</info>
+
+You can optionally specify a <comment>--editor-cmd</comment> option to open the generated file in your favorite editor:
+
+ <info>%command.full_name% --editor-cmd=mate</info>
+EOT
+ );
+
+ parent::configure();
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ $configuration = $this->getMigrationConfiguration($input, $output);
+
+ $version = date('YmdHis');
+ $path = $this->generateMigration($configuration, $input, $version);
+
+ $output->writeln(sprintf('Generated new migration class to "<info>%s</info>"', $path));
+ }
+
+ protected function generateMigration(Configuration $configuration, InputInterface $input, $version, $up = null, $down = null)
+ {
+ $placeHolders = array(
+ '<namespace>',
+ '<version>',
+ '<up>',
+ '<down>'
+ );
+ $replacements = array(
+ $configuration->getMigrationsNamespace(),
+ $version,
+ $up ? " " . implode("\n ", explode("\n", $up)) : null,
+ $down ? " " . implode("\n ", explode("\n", $down)) : null
+ );
+ $code = str_replace($placeHolders, $replacements, self::$_template);
+ $dir = $configuration->getMigrationsDirectory();
+ $dir = $dir ? $dir : getcwd();
+ $dir = rtrim($dir, '/');
+ $path = $dir . '/Version' . $version . '.php';
+
+ if (!file_exists($dir)) {
+ throw new \InvalidArgumentException(sprintf('Migrations directory "%s" does not exist.', $dir));
+ }
+
+ file_put_contents($path, $code);
+
+ if ($editorCmd = $input->getOption('editor-cmd')) {
+ shell_exec($editorCmd . ' ' . escapeshellarg($path));
+ }
+
+ return $path;
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/MigrateCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,107 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\DBAL\Migrations\Tools\Console\Command;
+
+use Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Doctrine\DBAL\Migrations\Migration,
+ Doctrine\DBAL\Migrations\Configuration\Configuration,
+ Doctrine\DBAL\Migrations\Configuration\YamlConfiguration,
+ Doctrine\DBAL\Migrations\Configuration\XmlConfiguration;
+
+/**
+ * Command for executing a migration to a specified version or the latest available version.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan Wage <jonwage@gmail.com>
+ */
+class MigrateCommand extends AbstractCommand
+{
+ protected function configure()
+ {
+ $this
+ ->setName('migrations:migrate')
+ ->setDescription('Execute a migration to a specified version or the latest available version.')
+ ->addArgument('version', InputArgument::OPTIONAL, 'The version to migrate to.', null)
+ ->addOption('write-sql', null, InputOption::VALUE_NONE, 'The path to output the migration SQL file instead of executing it.')
+ ->addOption('dry-run', null, InputOption::VALUE_NONE, 'Execute the migration as a dry run.')
+ ->setHelp(<<<EOT
+The <info>%command.name%</info> command executes a migration to a specified version or the latest available version:
+
+ <info>%command.full_name%</info>
+
+You can optionally manually specify the version you wish to migrate to:
+
+ <info>%command.full_name% YYYYMMDDHHMMSS</info>
+
+You can also execute the migration as a <comment>--dry-run</comment>:
+
+ <info>%command.full_name% YYYYMMDDHHMMSS --dry-run</info>
+
+You can output the would be executed SQL statements to a file with <comment>--write-sql</comment>:
+
+ <info>%command.full_name% YYYYMMDDHHMMSS --write-sql</info>
+
+Or you can also execute the migration without a warning message wich you need to interact with:
+
+ <info>%command.full_name% --no-interaction</info>
+
+EOT
+ );
+
+ parent::configure();
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ $version = $input->getArgument('version');
+
+ $configuration = $this->getMigrationConfiguration($input, $output);
+ $migration = new Migration($configuration);
+
+ $this->outputHeader($configuration, $output);
+
+ if ($path = $input->getOption('write-sql')) {
+ $path = is_bool($path) ? getcwd() : $path;
+ $migration->writeSqlFile($path, $version);
+ } else {
+ $dryRun = $input->getOption('dry-run') ? true : false;
+ if ($dryRun === true) {
+ $migration->migrate($version, true);
+ } else {
+ $noInteraction = $input->getOption('no-interaction') ? true : false;
+ if ($noInteraction === true) {
+ $migration->migrate($version, $dryRun);
+ } else {
+ $confirmation = $this->getHelper('dialog')->askConfirmation($output, '<question>WARNING! You are about to execute a database migration that could result in schema changes and data lost. Are you sure you wish to continue? (y/n)</question>', false);
+ if ($confirmation === true) {
+ $migration->migrate($version, $dryRun);
+ } else {
+ $output->writeln('<error>Migration cancelled!</error>');
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/StatusCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,115 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\DBAL\Migrations\Tools\Console\Command;
+
+use Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Doctrine\DBAL\Migrations\Migration,
+ Doctrine\DBAL\Migrations\MigrationException,
+ Doctrine\DBAL\Migrations\Configuration\Configuration,
+ Doctrine\DBAL\Migrations\Configuration\YamlConfiguration,
+ Doctrine\DBAL\Migrations\Configuration\XmlConfiguration;
+
+/**
+ * Command to view the status of a set of migrations.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan Wage <jonwage@gmail.com>
+ */
+class StatusCommand extends AbstractCommand
+{
+ protected function configure()
+ {
+ $this
+ ->setName('migrations:status')
+ ->setDescription('View the status of a set of migrations.')
+ ->addOption('show-versions', null, InputOption::VALUE_NONE, 'This will display a list of all available migrations and their status')
+ ->setHelp(<<<EOT
+The <info>%command.name%</info> command outputs the status of a set of migrations:
+
+ <info>%command.full_name%</info>
+
+You can output a list of all available migrations and their status with <comment>--show-versions</comment>:
+
+ <info>%command.full_name% --show-versions</info>
+EOT
+ );
+
+ parent::configure();
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ $configuration = $this->getMigrationConfiguration($input, $output);
+
+ $currentVersion = $configuration->getCurrentVersion();
+ if ($currentVersion) {
+ $currentVersionFormatted = $configuration->formatVersion($currentVersion) . ' (<comment>'.$currentVersion.'</comment>)';
+ } else {
+ $currentVersionFormatted = 0;
+ }
+ $latestVersion = $configuration->getLatestVersion();
+ if ($latestVersion) {
+ $latestVersionFormatted = $configuration->formatVersion($latestVersion) . ' (<comment>'.$latestVersion.'</comment>)';
+ } else {
+ $latestVersionFormatted = 0;
+ }
+ $executedMigrations = $configuration->getNumberOfExecutedMigrations();
+ $availableMigrations = $configuration->getNumberOfAvailableMigrations();
+ $newMigrations = $availableMigrations - $executedMigrations;
+
+ $output->writeln("\n <info>==</info> Configuration\n");
+
+ $info = array(
+ 'Name' => $configuration->getName() ? $configuration->getName() : 'Doctrine Database Migrations',
+ 'Database Driver' => $configuration->getConnection()->getDriver()->getName(),
+ 'Database Name' => $configuration->getConnection()->getDatabase(),
+ 'Configuration Source' => $configuration instanceof \Doctrine\DBAL\Migrations\Configuration\AbstractFileConfiguration ? $configuration->getFile() : 'manually configured',
+ 'Version Table Name' => $configuration->getMigrationsTableName(),
+ 'Migrations Namespace' => $configuration->getMigrationsNamespace(),
+ 'Migrations Directory' => $configuration->getMigrationsDirectory(),
+ 'Current Version' => $currentVersionFormatted,
+ 'Latest Version' => $latestVersionFormatted,
+ 'Executed Migrations' => $executedMigrations,
+ 'Available Migrations' => $availableMigrations,
+ 'New Migrations' => $newMigrations > 0 ? '<question>' . $newMigrations . '</question>' : $newMigrations
+ );
+ foreach ($info as $name => $value) {
+ $output->writeln(' <comment>>></comment> ' . $name . ': ' . str_repeat(' ', 50 - strlen($name)) . $value);
+ }
+
+ $showVersions = $input->getOption('show-versions') ? true : false;
+ if ($showVersions === true) {
+ if ($migrations = $configuration->getMigrations()) {
+ $output->writeln("\n <info>==</info> Migration Versions\n");
+ $migratedVersions = $configuration->getMigratedVersions();
+ foreach ($migrations as $version) {
+ $isMigrated = in_array($version->getVersion(), $migratedVersions);
+ $status = $isMigrated ? '<info>migrated</info>' : '<error>not migrated</error>';
+ $output->writeln(' <comment>>></comment> ' . $configuration->formatVersion($version->getVersion()) . ' (<comment>' . $version->getVersion() . '</comment>)' . str_repeat(' ', 30 - strlen($name)) . $status);
+ }
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/VersionCommand.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,95 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\DBAL\Migrations\Tools\Console\Command;
+
+use Symfony\Component\Console\Input\InputInterface,
+ Symfony\Component\Console\Output\OutputInterface,
+ Symfony\Component\Console\Input\InputArgument,
+ Symfony\Component\Console\Input\InputOption,
+ Doctrine\DBAL\Migrations\Migration,
+ Doctrine\DBAL\Migrations\MigrationException,
+ Doctrine\DBAL\Migrations\Configuration\Configuration,
+ Doctrine\DBAL\Migrations\Configuration\YamlConfiguration,
+ Doctrine\DBAL\Migrations\Configuration\XmlConfiguration;
+
+/**
+ * Command for manually adding and deleting migration versions from the version table.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan Wage <jonwage@gmail.com>
+ */
+class VersionCommand extends AbstractCommand
+{
+ protected function configure()
+ {
+ $this
+ ->setName('migrations:version')
+ ->setDescription('Manually add and delete migration versions from the version table.')
+ ->addArgument('version', InputArgument::REQUIRED, 'The version to add or delete.', null)
+ ->addOption('add', null, InputOption::VALUE_NONE, 'Add the specified version.')
+ ->addOption('delete', null, InputOption::VALUE_NONE, 'Delete the specified version.')
+ ->setHelp(<<<EOT
+The <info>%command.name%</info> command allows you to manually add and delete migration versions from the version table:
+
+ <info>%command.full_name% YYYYMMDDHHMMSS --add</info>
+
+If you want to delete a version you can use the <comment>--delete</comment> option:
+
+ <info>%command.full_name% YYYYMMDDHHMMSS --delete</info>
+EOT
+ );
+
+ parent::configure();
+ }
+
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ $configuration = $this->getMigrationConfiguration($input, $output);
+ $migration = new Migration($configuration);
+
+ if ($input->getOption('add') === false && $input->getOption('delete') === false) {
+ throw new \InvalidArgumentException('You must specify whether you want to --add or --delete the specified version.');
+ }
+
+ $version = $input->getArgument('version');
+ $markMigrated = $input->getOption('add') ? true : false;
+
+ if ( ! $configuration->hasVersion($version)) {
+ throw MigrationException::unknownMigrationVersion($version);
+ }
+
+ $version = $configuration->getVersion($version);
+ if ($markMigrated && $configuration->hasVersionMigrated($version)) {
+ throw new \InvalidArgumentException(sprintf('The version "%s" already exists in the version table.', $version));
+ }
+
+ if ( ! $markMigrated && ! $configuration->hasVersionMigrated($version)) {
+ throw new \InvalidArgumentException(sprintf('The version "%s" does not exists in the version table.', $version));
+ }
+
+ if ($markMigrated) {
+ $version->markMigrated();
+ } else {
+ $version->markNotMigrated();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Version.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,353 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\DBAL\Migrations;
+
+use Doctrine\DBAL\Migrations\Configuration\Configuration,
+ Doctrine\DBAL\Schema\Schema;
+
+/**
+ * Class which wraps a migration version and allows execution of the
+ * individual migration version up or down method.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+class Version
+{
+ const STATE_NONE = 0;
+ const STATE_PRE = 1;
+ const STATE_EXEC = 2;
+ const STATE_POST = 3;
+
+ /**
+ * The Migrations Configuration instance for this migration
+ *
+ * @var Configuration
+ */
+ private $configuration;
+
+ /**
+ * The OutputWriter object instance used for outputting information
+ *
+ * @var OutputWriter
+ */
+ private $outputWriter;
+
+ /**
+ * The version in timestamp format (YYYYMMDDHHMMSS)
+ *
+ * @param int
+ */
+ private $version;
+
+ /**
+ * @var AbstractSchemaManager
+ */
+ private $sm;
+
+ /**
+ * @var AbstractPlatform
+ */
+ private $platform;
+
+ /**
+ * The migration instance for this version
+ *
+ * @var AbstractMigration
+ */
+ private $migration;
+
+ /**
+ * @var Connection
+ */
+ private $connection;
+
+ /**
+ * @var string
+ */
+ private $class;
+
+ /** The array of collected SQL statements for this version */
+ private $sql = array();
+
+ /** The array of collected parameters for SQL statements for this version */
+ private $params = array();
+
+ /** The array of collected types for SQL statements for this version */
+ private $types = array();
+
+ /** The time in seconds that this migration version took to execute */
+ private $time;
+
+ /**
+ * @var int
+ */
+ private $state = self::STATE_NONE;
+
+ public function __construct(Configuration $configuration, $version, $class)
+ {
+ $this->configuration = $configuration;
+ $this->outputWriter = $configuration->getOutputWriter();
+ $this->class = $class;
+ $this->connection = $configuration->getConnection();
+ $this->sm = $this->connection->getSchemaManager();
+ $this->platform = $this->connection->getDatabasePlatform();
+ $this->migration = new $class($this);
+ $this->version = $this->migration->getName() ?: $version;
+ }
+
+ /**
+ * Returns the string version in the format YYYYMMDDHHMMSS
+ *
+ * @return string $version
+ */
+ public function getVersion()
+ {
+ return $this->version;
+ }
+
+ /**
+ * Returns the Migrations Configuration object instance
+ *
+ * @return Configuration $configuration
+ */
+ public function getConfiguration()
+ {
+ return $this->configuration;
+ }
+
+ /**
+ * Check if this version has been migrated or not.
+ *
+ * @param bool $bool
+ * @return mixed
+ */
+ public function isMigrated()
+ {
+ return $this->configuration->hasVersionMigrated($this);
+ }
+
+ public function markMigrated()
+ {
+ $this->configuration->createMigrationTable();
+ $this->connection->executeQuery("INSERT INTO " . $this->configuration->getMigrationsTableName() . " (version) VALUES (?)", array($this->version));
+ }
+
+ public function markNotMigrated()
+ {
+ $this->configuration->createMigrationTable();
+ $this->connection->executeQuery("DELETE FROM " . $this->configuration->getMigrationsTableName() . " WHERE version = ?", array($this->version));
+ }
+
+ /**
+ * Add some SQL queries to this versions migration
+ *
+ * @param mixed $sql
+ * @param array $params
+ * @param array $types
+ * @return void
+ */
+ public function addSql($sql, array $params = array(), array $types = array())
+ {
+ if (is_array($sql)) {
+ foreach ($sql as $key => $query) {
+ $this->sql[] = $query;
+ if (isset($params[$key])) {
+ $this->params[count($this->sql) - 1] = $params[$key];
+ $this->types[count($this->sql) - 1] = isset($types[$key]) ? $types[$key] : array();
+ }
+ }
+ } else {
+ $this->sql[] = $sql;
+ if ($params) {
+ $this->params[count($this->sql) - 1] = $params;
+ $this->types[count($this->sql) - 1] = $types ?: array();
+ }
+ }
+ }
+
+ /**
+ * Write a migration SQL file to the given path
+ *
+ * @param string $path The path to write the migration SQL file.
+ * @param string $direction The direction to execute.
+ * @return bool $written
+ */
+ public function writeSqlFile($path, $direction = 'up')
+ {
+ $queries = $this->execute($direction, true);
+
+ $string = sprintf("# Doctrine Migration File Generated on %s\n", date('Y-m-d H:m:s'));
+
+ $string .= "\n# Version " . $this->version . "\n";
+ foreach ($queries as $query) {
+ $string .= $query . ";\n";
+ }
+ if (is_dir($path)) {
+ $path = realpath($path);
+ $path = $path . '/doctrine_migration_' . date('YmdHis') . '.sql';
+ }
+
+ $this->outputWriter->write("\n".sprintf('Writing migration file to "<info>%s</info>"', $path));
+
+ return file_put_contents($path, $string);
+ }
+
+ /**
+ * @return AbstractMigration
+ */
+ public function getMigration()
+ {
+ return $this->migration;
+ }
+
+ /**
+ * Execute this migration version up or down and and return the SQL.
+ *
+ * @param string $direction The direction to execute the migration.
+ * @param string $dryRun Whether to not actually execute the migration SQL and just do a dry run.
+ * @return array $sql
+ * @throws Exception when migration fails
+ */
+ public function execute($direction, $dryRun = false)
+ {
+ $this->sql = array();
+
+ $this->connection->beginTransaction();
+
+ try {
+ $start = microtime(true);
+
+ $this->state = self::STATE_PRE;
+ $fromSchema = $this->sm->createSchema();
+ $this->migration->{'pre' . ucfirst($direction)}($fromSchema);
+
+ if ($direction === 'up') {
+ $this->outputWriter->write("\n" . sprintf(' <info>++</info> migrating <comment>%s</comment>', $this->version) . "\n");
+ } else {
+ $this->outputWriter->write("\n" . sprintf(' <info>--</info> reverting <comment>%s</comment>', $this->version) . "\n");
+ }
+
+ $this->state = self::STATE_EXEC;
+
+ $toSchema = clone $fromSchema;
+ $this->migration->$direction($toSchema);
+ $this->addSql($fromSchema->getMigrateToSql($toSchema, $this->platform));
+
+ if ($dryRun === false) {
+ if ($this->sql) {
+ foreach ($this->sql as $key => $query) {
+ if ( ! isset($this->params[$key])) {
+ $this->outputWriter->write(' <comment>-></comment> ' . $query);
+ $this->connection->executeQuery($query);
+ } else {
+ $this->outputWriter->write(sprintf(' <comment>-</comment> %s (with parameters)', $query));
+ $this->connection->executeQuery($query, $this->params[$key], $this->types[$key]);
+ }
+ }
+ } else {
+ $this->outputWriter->write(sprintf('<error>Migration %s was executed but did not result in any SQL statements.</error>', $this->version));
+ }
+
+ if ($direction === 'up') {
+ $this->markMigrated();
+ } else {
+ $this->markNotMigrated();
+ }
+
+ } else {
+ foreach ($this->sql as $query) {
+ $this->outputWriter->write(' <comment>-></comment> ' . $query);
+ }
+ }
+
+ $this->state = self::STATE_POST;
+ $this->migration->{'post' . ucfirst($direction)}($toSchema);
+
+ $end = microtime(true);
+ $this->time = round($end - $start, 2);
+ if ($direction === 'up') {
+ $this->outputWriter->write(sprintf("\n <info>++</info> migrated (%ss)", $this->time));
+ } else {
+ $this->outputWriter->write(sprintf("\n <info>--</info> reverted (%ss)", $this->time));
+ }
+
+ $this->connection->commit();
+
+ return $this->sql;
+ } catch(SkipMigrationException $e) {
+ $this->connection->rollback();
+
+ if ($dryRun == false) {
+ // now mark it as migrated
+ if ($direction === 'up') {
+ $this->markMigrated();
+ } else {
+ $this->markNotMigrated();
+ }
+ }
+
+ $this->outputWriter->write(sprintf("\n <info>SS</info> skipped (Reason: %s)", $e->getMessage()));
+ } catch (\Exception $e) {
+
+ $this->outputWriter->write(sprintf(
+ '<error>Migration %s failed during %s. Error %s</error>',
+ $this->version, $this->getExecutionState(), $e->getMessage()
+ ));
+
+ $this->connection->rollback();
+
+ $this->state = self::STATE_NONE;
+ throw $e;
+ }
+ $this->state = self::STATE_NONE;
+ }
+
+ public function getExecutionState()
+ {
+ switch($this->state) {
+ case self::STATE_PRE:
+ return 'Pre-Checks';
+ case self::STATE_POST:
+ return 'Post-Checks';
+ case self::STATE_EXEC:
+ return 'Execution';
+ default:
+ return 'No State';
+ }
+ }
+
+ /**
+ * Returns the time this migration version took to execute
+ *
+ * @return integer $time The time this migration version took to execute
+ */
+ public function getTime()
+ {
+ return $this->time;
+ }
+
+ public function __toString()
+ {
+ return $this->version;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/package.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * Phing alternative to packaging the PHAR:
+ * $ php package.php
+ *
+ * @author Eric Clemmons <eric@smarterspam.com>
+ */
+
+$buildDir = realpath(dirname(__FILE__)) . '/build';
+
+$pharName = "$buildDir/doctrine-migrations.phar";
+
+if (!file_exists($buildDir)) {
+ mkdir($buildDir);
+}
+
+if (file_exists($pharName)) {
+ unlink($pharName);
+}
+
+$p = new Phar($pharName);
+$p->CompressFiles(Phar::GZ);
+$p->setSignatureAlgorithm(Phar::SHA1);
+
+$p->startBuffering();
+
+$dirs = array(
+ './lib' => '/Doctrine\/DBAL\/Migrations/',
+ './lib/vendor/doctrine-dbal/lib' => '/Doctrine/',
+ './lib/vendor/doctrine-common/lib' => '/Doctrine/',
+ './lib/vendor' => '/Symfony/'
+);
+
+foreach ($dirs as $dir => $filter) {
+ $p->buildFromDirectory($dir, $filter);
+}
+
+$p->stopBuffering();
+
+$p->setStub(file_get_contents('phar-cli-stub.php'));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/phar-cli-stub.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,83 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+
+Phar::mapPhar();
+
+require_once 'phar://'.__FILE__.'/Doctrine/Common/ClassLoader.php';
+
+$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', 'phar://'.__FILE__);
+$classLoader->register();
+
+$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', 'phar://'.__FILE__);
+$classLoader->register();
+
+$classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'phar://'.__FILE__);
+$classLoader->register();
+
+// Support for using the Doctrine ORM convention of providing a `cli-config.php` file.
+$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
+
+$helperSet = null;
+if (file_exists($configFile)) {
+ if ( ! is_readable($configFile)) {
+ trigger_error(
+ 'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR
+ );
+ }
+
+ require $configFile;
+
+ foreach ($GLOBALS as $helperSetCandidate) {
+ if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) {
+ $helperSet = $helperSetCandidate;
+ break;
+ }
+ }
+}
+
+$helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet();
+$helperSet->set(new \Symfony\Component\Console\Helper\DialogHelper(), 'dialog');
+
+$cli = new \Symfony\Component\Console\Application('Doctrine Migrations', \Doctrine\DBAL\Migrations\MigrationsVersion::VERSION);
+$cli->setCatchExceptions(true);
+$cli->setHelperSet($helperSet);
+$cli->addCommands(array(
+ // Migrations Commands
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand()
+));
+if ($helperSet->has('em')) {
+ $cli->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand());
+}
+
+$input = file_exists('migrations-input.php')
+ ? include('migrations-input.php')
+ : null;
+
+$output = file_exists('migrations-output.php')
+ ? include('migrations-output.php')
+ : null;
+
+$cli->run($input, $output);
+
+__HALT_COMPILER();
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/phpunit.xml.dist Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit backupGlobals="false"
+ backupStaticAttributes="false"
+ colors="false"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ stopOnFailure="false"
+ syntaxCheck="false"
+ bootstrap="tests/bootstrap.php"
+>
+ <testsuites>
+ <testsuite name="Doctrine2 Database Migrations Test Suite">
+ <directory>./tests/Doctrine/</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/AbstractConfigurationTest.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,35 @@
+<?php
+
+namespace Doctrine\DBAL\Migrations\Tests\Configuration;
+
+abstract class AbstractConfigurationTest extends \Doctrine\DBAL\Migrations\Tests\MigrationTestCase
+{
+ /**
+ * @var \Doctrine\DBAL\Migrations\Configuration\Configuration
+ */
+ abstract public function loadConfiguration();
+
+ public function testMigrationDirectory()
+ {
+ $config = $this->loadConfiguration();
+ $this->assertEquals("/path/to/migrations/classes/DoctrineMigrations", $config->getMigrationsDirectory());
+ }
+
+ public function testMigrationNamespace()
+ {
+ $config = $this->loadConfiguration();
+ $this->assertEquals("DoctrineMigrationsTest", $config->getMigrationsNamespace());
+ }
+
+ public function testMigrationName()
+ {
+ $config = $this->loadConfiguration();
+ $this->assertEquals("Doctrine Sandbox Migrations", $config->getName());
+ }
+
+ public function testMigrationsTable()
+ {
+ $config = $this->loadConfiguration();
+ $this->assertEquals('doctrine_migration_versions_test', $config->getMigrationsTableName());
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/XmlConfigurationTest.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,16 @@
+<?php
+
+namespace Doctrine\DBAL\Migrations\Tests\Configuration;
+
+use Doctrine\DBAL\Migrations\Configuration\XmlConfiguration;
+
+class XmlConfigurationTest extends AbstractConfigurationTest
+{
+ public function loadConfiguration()
+ {
+ $config = new XmlConfiguration($this->getSqliteConnection());
+ $config->load(__DIR__ . "/_files/config.xml");
+
+ return $config;
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/YamlConfigurationTest.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,16 @@
+<?php
+
+namespace Doctrine\DBAL\Migrations\Tests\Configuration;
+
+use Doctrine\DBAL\Migrations\Configuration\YamlConfiguration;
+
+class YamlConfigurationTest extends AbstractConfigurationTest
+{
+ public function loadConfiguration()
+ {
+ $config = new YamlConfiguration($this->getSqliteConnection());
+ $config->load(__DIR__ . "/_files/config.yml");
+
+ return $config;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/_files/config.xml Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doctrine-migrations xmlns="http://doctrine-project.org/schemas/migrations/configuration"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://doctrine-project.org/schemas/migrations/configuration
+ http://doctrine-project.org/schemas/migrations/configuration.xsd">
+
+ <name>Doctrine Sandbox Migrations</name>
+ <migrations-namespace>DoctrineMigrationsTest</migrations-namespace>
+ <table name="doctrine_migration_versions_test" />
+ <migrations-directory>/path/to/migrations/classes/DoctrineMigrations</migrations-directory>
+
+</doctrine-migrations>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/_files/config.yml Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,5 @@
+---
+name: Doctrine Sandbox Migrations
+migrations_namespace: DoctrineMigrationsTest
+table_name: doctrine_migration_versions_test
+migrations_directory: /path/to/migrations/classes/DoctrineMigrations
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,143 @@
+<?php
+
+namespace Doctrine\DBAL\Migrations\Tests;
+
+use Doctrine\DBAL\Migrations\Configuration\Configuration;
+use Doctrine\DBAL\Schema\Schema;
+
+class ConfigurationTest extends MigrationTestCase
+{
+ public function testGetConnection()
+ {
+ $conn = $this->getSqliteConnection();
+ $config = new Configuration($conn);
+
+ $this->assertSame($conn, $config->getConnection());
+ }
+
+ public function testValidateMigrationsNamespaceRequired()
+ {
+ $config = new Configuration($this->getSqliteConnection());
+
+ $this->setExpectedException("Doctrine\DBAL\Migrations\MigrationException", "Migrations namespace must be configured in order to use Doctrine migrations.");
+ $config->validate();
+ }
+
+ public function testValidateMigrationsDirectoryRequired()
+ {
+ $config = new Configuration($this->getSqliteConnection());
+ $config->setMigrationsNamespace("DoctrineMigrations\\");
+
+ $this->setExpectedException("Doctrine\DBAL\Migrations\MigrationException", "Migrations directory must be configured in order to use Doctrine migrations.");
+ $config->validate();
+ }
+
+ public function testValidateMigrations()
+ {
+ $config = new Configuration($this->getSqliteConnection());
+ $config->setMigrationsNamespace("DoctrineMigrations\\");
+ $config->setMigrationsDirectory(sys_get_temp_dir());
+
+ $config->validate();
+ }
+
+ public function testSetGetName()
+ {
+ $config = new Configuration($this->getSqliteConnection());
+ $config->setName('Test');
+
+ $this->assertEquals('Test', $config->getName());
+ }
+
+ public function testMigrationsTable()
+ {
+ $config = new Configuration($this->getSqliteConnection());
+
+ $this->assertEquals("doctrine_migration_versions", $config->getMigrationsTableName());
+ }
+
+ public function testEmptyProjectDefaults()
+ {
+ $config = $this->getSqliteConfiguration();
+ $this->assertEquals(0, $config->getCurrentVersion(), "current version 0");
+ $this->assertEquals(0, $config->getLatestVersion(), "latest version 0");
+ $this->assertEquals(0, $config->getNumberOfAvailableMigrations(), "number of available migrations 0");
+ $this->assertEquals(0, $config->getNumberOfExecutedMigrations(), "number of executed migrations 0");
+ $this->assertEquals(array(), $config->getMigrations());
+ }
+
+ public function testGetUnknownVersion()
+ {
+ $config = $this->getSqliteConfiguration();
+
+ $this->setExpectedException('Doctrine\DBAL\Migrations\MigrationException', 'Could not find migration version 1234');
+ $config->getVersion(1234);
+ }
+
+ public function testRegisterMigration()
+ {
+ $config = $this->getSqliteConfiguration();
+ $config->registerMigration(1234, 'Doctrine\DBAL\Migrations\Tests\ConfigMigration');
+
+ $this->assertEquals(1, count($config->getMigrations()), "One Migration registered.");
+ $this->assertTrue($config->hasVersion(1234));
+
+ $version = $config->getVersion(1234);
+ $this->assertInstanceOf('Doctrine\DBAL\Migrations\Version', $version);
+ $this->assertEquals(1234, $version->getVersion());
+ $this->assertFalse($version->isMigrated());
+ }
+
+ public function testRegisterMigrations()
+ {
+ $config = $this->getSqliteConfiguration();
+ $config->registerMigrations(array(
+ 1234 => 'Doctrine\DBAL\Migrations\Tests\ConfigMigration',
+ 1235 => 'Doctrine\DBAL\Migrations\Tests\Config2Migration',
+ ));
+
+ $this->assertEquals(2, count($config->getMigrations()), "Two Migration registered.");
+
+ $version = $config->getVersion(1234);
+ $this->assertInstanceOf('Doctrine\DBAL\Migrations\Version', $version);
+
+ $version = $config->getVersion(1235);
+ $this->assertInstanceOf('Doctrine\DBAL\Migrations\Version', $version);
+ }
+
+ public function testRegisterDuplicateVersion()
+ {
+ $config = $this->getSqliteConfiguration();
+
+ $config->registerMigration(1234, 'Doctrine\DBAL\Migrations\Tests\ConfigMigration');
+
+ $this->setExpectedException('Doctrine\DBAL\Migrations\MigrationException', 'Migration version 1234 already registered with class Doctrine\DBAL\Migrations\Version');
+ $config->registerMigration(1234, 'Doctrine\DBAL\Migrations\Tests\ConfigMigration');
+ }
+}
+
+class ConfigMigration extends \Doctrine\DBAL\Migrations\AbstractMigration
+{
+ public function down(Schema $schema)
+ {
+
+ }
+
+ public function up(Schema $schema)
+ {
+
+ }
+}
+
+class Config2Migration extends \Doctrine\DBAL\Migrations\AbstractMigration
+{
+ public function down(Schema $schema)
+ {
+
+ }
+
+ public function up(Schema $schema)
+ {
+
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/Functional/FunctionalTest.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,238 @@
+<?php
+
+namespace Doctrine\DBAL\Migrations\Tests\Functional;
+
+use Doctrine\DBAL\DriverManager;
+use Doctrine\DBAL\Schema\Schema;
+use Doctrine\DBAL\Migrations\Configuration\Configuration;
+
+class FunctionalTest extends \Doctrine\DBAL\Migrations\Tests\MigrationTestCase
+{
+ /**
+ * @var Configuration
+ */
+ private $config;
+
+ /**
+ * @var Connection
+ */
+ private $connection;
+
+ public function setUp()
+ {
+ $this->connection = $this->getSqliteConnection();
+ $this->config = new Configuration($this->connection);
+ $this->config->setMigrationsNamespace('Doctrine\DBAL\Migrations\Tests\Functional');
+ $this->config->setMigrationsDirectory('.');
+ }
+
+ public function testMigrateUp()
+ {
+ $version = new \Doctrine\DBAL\Migrations\Version($this->config, 1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp');
+
+ $this->assertFalse($this->config->hasVersionMigrated($version));
+ $version->execute('up');
+
+ $schema = $this->connection->getSchemaManager()->createSchema();
+ $this->assertTrue($schema->hasTable('foo'));
+ $this->assertTrue($schema->getTable('foo')->hasColumn('id'));
+ $this->assertTrue($this->config->hasVersionMigrated($version));
+ }
+
+ public function testMigrateDown()
+ {
+ $version = new \Doctrine\DBAL\Migrations\Version($this->config, 1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp');
+
+ $this->assertFalse($this->config->hasVersionMigrated($version));
+ $version->execute('up');
+
+ $schema = $this->connection->getSchemaManager()->createSchema();
+ $this->assertTrue($schema->hasTable('foo'));
+ $this->assertTrue($schema->getTable('foo')->hasColumn('id'));
+ $this->assertTrue($this->config->hasVersionMigrated($version));
+
+ $version->execute('down');
+ $schema = $this->connection->getSchemaManager()->createSchema();
+ $this->assertFalse($schema->hasTable('foo'));
+ $this->assertFalse($this->config->hasVersionMigrated($version));
+
+ }
+
+ public function testSkipMigrateUp()
+ {
+ $version = new \Doctrine\DBAL\Migrations\Version($this->config, 1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration');
+
+ $this->assertFalse($this->config->hasVersionMigrated($version));
+ $version->execute('up');
+
+ $schema = $this->connection->getSchemaManager()->createSchema();
+ $this->assertFalse($schema->hasTable('foo'));
+
+ $this->assertTrue($this->config->hasVersionMigrated($version));
+ }
+
+ public function testMigrateSeveralSteps()
+ {
+ $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp');
+ $this->config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration');
+ $this->config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther');
+
+ $this->assertEquals(0, $this->config->getCurrentVersion());
+ $migrations = $this->config->getMigrationsToExecute('up', 3);
+
+ $this->assertEquals(3, count($migrations));
+ $this->assertInstanceOf('Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp', $migrations[1]->getMigration());
+ $this->assertInstanceOf('Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration', $migrations[2]->getMigration());
+ $this->assertInstanceOf('Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther', $migrations[3]->getMigration());
+
+ $migration = new \Doctrine\DBAL\Migrations\Migration($this->config);
+ $migration->migrate(3);
+
+ $schema = $this->config->getConnection()->getSchemaManager()->createSchema();
+ $this->assertTrue($schema->hasTable('foo'));
+ $this->assertTrue($schema->hasTable('bar'));
+
+ $this->assertEquals(3, $this->config->getCurrentVersion());
+ $this->assertTrue($migrations[1]->isMigrated());
+ $this->assertTrue($migrations[2]->isMigrated());
+ $this->assertTrue($migrations[3]->isMigrated());
+ }
+
+ public function testMigrateToLastVersion()
+ {
+ $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp');
+ $this->config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration');
+ $this->config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther');
+
+ $migration = new \Doctrine\DBAL\Migrations\Migration($this->config);
+ $migration->migrate();
+
+ $this->assertEquals(3, $this->config->getCurrentVersion());
+ $migrations = $this->config->getMigrations();
+ $this->assertTrue($migrations[1]->isMigrated());
+ $this->assertTrue($migrations[2]->isMigrated());
+ $this->assertTrue($migrations[3]->isMigrated());
+ }
+
+ public function testDryRunMigration()
+ {
+ $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp');
+ $this->config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration');
+ $this->config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther');
+
+ $migration = new \Doctrine\DBAL\Migrations\Migration($this->config);
+ $migration->migrate(3, true);
+
+ $schema = $this->config->getConnection()->getSchemaManager()->createSchema();
+ $this->assertFalse($schema->hasTable('foo'));
+ $this->assertFalse($schema->hasTable('bar'));
+
+ $this->assertEquals(0, $this->config->getCurrentVersion());
+ $migrations = $this->config->getMigrations();
+ $this->assertFalse($migrations[1]->isMigrated());
+ $this->assertFalse($migrations[2]->isMigrated());
+ $this->assertFalse($migrations[3]->isMigrated());
+ }
+
+ public function testMigrateDownSeveralSteps()
+ {
+ $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp');
+ $this->config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration');
+ $this->config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther');
+
+ $migration = new \Doctrine\DBAL\Migrations\Migration($this->config);
+ $migration->migrate(3);
+ $this->assertEquals(3, $this->config->getCurrentVersion());
+ $migration->migrate(0);
+
+ $schema = $this->config->getConnection()->getSchemaManager()->createSchema();
+ $this->assertFalse($schema->hasTable('foo'));
+ $this->assertFalse($schema->hasTable('bar'));
+
+ $this->assertEquals(0, $this->config->getCurrentVersion());
+ $migrations = $this->config->getMigrations();
+ $this->assertFalse($migrations[1]->isMigrated());
+ $this->assertFalse($migrations[2]->isMigrated());
+ $this->assertFalse($migrations[3]->isMigrated());
+ }
+
+ public function testAddSql()
+ {
+ $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrateAddSqlTest');
+
+ $migration = new \Doctrine\DBAL\Migrations\Migration($this->config);
+ $migration->migrate(1);
+
+ $migrations = $this->config->getMigrations();
+ $this->assertTrue($migrations[1]->isMigrated());
+
+ $schema = $this->config->getConnection()->getSchemaManager()->createSchema();
+ $this->assertTrue($schema->hasTable('test_add_sql_table'));
+ $check = $this->config->getConnection()->fetchAll('select * from test_add_sql_table');
+ $this->assertNotEmpty($check);
+ $this->assertEquals('test', $check[0]['test']);
+
+ $migration->migrate(0);
+ $this->assertFalse($migrations[1]->isMigrated());
+ $schema = $this->config->getConnection()->getSchemaManager()->createSchema();
+ $this->assertFalse($schema->hasTable('test_add_sql_table'));
+ }
+}
+
+class MigrateAddSqlTest extends \Doctrine\DBAL\Migrations\AbstractMigration
+{
+ public function up(Schema $schema)
+ {
+ $this->addSql("CREATE TABLE test_add_sql_table (test varchar(255))");
+ $this->addSql("INSERT INTO test_add_sql_table (test) values (?)", array('test'));
+ }
+
+ public function down(Schema $schema)
+ {
+ $this->addSql("DROP TABLE test_add_sql_table");
+ }
+}
+
+class MigrationMigrateUp extends \Doctrine\DBAL\Migrations\AbstractMigration
+{
+ public function down(Schema $schema)
+ {
+ $schema->dropTable('foo');
+ }
+
+ public function up(Schema $schema)
+ {
+ $table = $schema->createTable('foo');
+ $table->addColumn('id', 'integer');
+ }
+}
+
+class MigrationSkipMigration extends MigrationMigrateUp
+{
+
+ public function preUp(Schema $schema)
+ {
+ $this->skipIf(true);
+ }
+
+ public function preDown(Schema $schema)
+ {
+ $this->skipIf(true);
+ }
+}
+
+class MigrationMigrateFurther extends \Doctrine\DBAL\Migrations\AbstractMigration
+{
+
+ public function down(Schema $schema)
+ {
+ $schema->dropTable('bar');
+ }
+
+ public function up(Schema $schema)
+ {
+ $table = $schema->createTable('bar');
+ $table->addColumn('id', 'integer');
+ }
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/MigrationTest.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,34 @@
+<?php
+
+namespace Doctrine\DBAL\Migrations\Tests;
+
+use Doctrine\DBAL\Migrations\Configuration\Configuration;
+use Doctrine\DBAL\Migrations\Migration;
+
+class MigrationTest extends MigrationTestCase
+{
+ private $config;
+
+ public function setUp()
+ {
+ $this->config = new Configuration($this->getSqliteConnection());
+ $this->config->setMigrationsDirectory(\sys_get_temp_dir());
+ $this->config->setMigrationsNamespace('DoctrineMigrations\\');
+ }
+
+ public function testMigrateToUnknownVersionThrowsException()
+ {
+ $migration = new Migration($this->config);
+
+ $this->setExpectedException('Doctrine\DBAL\Migrations\MigrationException', 'Could not find migration version 1234');
+ $migration->migrate('1234');
+ }
+
+ public function testMigrateToCurrentVersionReturnsEmpty()
+ {
+ $migration = new Migration($this->config);
+
+ $sql = $migration->migrate('0');
+ $this->assertEquals(array(), $sql);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/MigrationTestCase.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,26 @@
+<?php
+
+namespace Doctrine\DBAL\Migrations\Tests;
+
+use Doctrine\Common\ClassLoader;
+use Doctrine\DBAL\DriverManager;
+
+abstract class MigrationTestCase extends \PHPUnit_Framework_TestCase
+{
+ public function getSqliteConnection()
+ {
+ $params = array('driver' => 'pdo_sqlite', 'memory' => true);
+ return DriverManager::getConnection($params);
+ }
+
+ /**
+ * @return \Doctrine\DBAL\Migrations\Configuration\Configuration
+ */
+ public function getSqliteConfiguration()
+ {
+ $config = new \Doctrine\DBAL\Migrations\Configuration\Configuration($this->getSqliteConnection());
+ $config->setMigrationsDirectory(\sys_get_temp_dir());
+ $config->setMigrationsNamespace('DoctrineMigrations');
+ return $config;
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,58 @@
+<?php
+namespace Doctrine\DBAL\Migrations\Tests;
+
+
+use Doctrine\DBAL\Migrations\Tests\MigrationTestCase;
+use Doctrine\DBAL\Schema\Schema;
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Migrations\Version;
+use Doctrine\DBAL\Migrations\Configuration\Configuration;
+
+/**
+ * Version Test
+ */
+class VersionTest extends MigrationTestCase
+{
+ /**
+ * Create simple migration
+ */
+ public function testCreateVersion()
+ {
+ $version = new Version(new Configuration($this->getSqliteConnection()), $versionName = '003',
+ 'Doctrine\DBAL\Migrations\Tests\VersionTest_Migration');
+ $this->assertEquals($versionName, $version->getVersion());
+ }
+
+ /**
+ * Create migration with custom name
+ */
+ public function testCreateVersionWithCustomName()
+ {
+ $versionName = 'CustomVersionName';
+ $version = new Version(new Configuration($this->getSqliteConnection()), '003',
+ 'Doctrine\DBAL\Migrations\Tests\VersionTest_MigrationCustom');
+ $this->assertEquals($versionName, $version->getVersion());
+ }
+}
+
+/**
+ * Simple migration
+ */
+class VersionTest_Migration extends AbstractMigration
+{
+ public function down(Schema $schema) {}
+ public function up(Schema $schema) {}
+}
+
+/**
+ * Migration with custom name
+ */
+class VersionTest_MigrationCustom extends AbstractMigration
+{
+ public function getName()
+ {
+ return 'CustomVersionName';
+ }
+ public function down(Schema $schema) {}
+ public function up(Schema $schema) {}
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/TestInit.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,20 @@
+<?php
+
+require_once __DIR__ . '/../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
+
+use Doctrine\Common\ClassLoader;
+
+$classLoader = new ClassLoader('Doctrine\DBAL\Migrations\Tests', __DIR__ . '/');
+$classLoader->register();
+
+$classLoader = new ClassLoader('Doctrine\DBAL\Migrations', __DIR__ . '/../lib');
+$classLoader->register();
+
+$classLoader = new ClassLoader('Doctrine\Common', __DIR__ . '/../lib/vendor/doctrine-common/lib');
+$classLoader->register();
+
+$classLoader = new ClassLoader('Doctrine\DBAL', __DIR__ . '/../lib/vendor/doctrine-dbal/lib');
+$classLoader->register();
+
+$classLoader = new ClassLoader('Symfony\Component\Yaml', __DIR__ . '/../lib/vendor');
+$classLoader->register();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/doctrine-migrations/tests/bootstrap.php Fri Nov 25 18:55:43 2011 +0100
@@ -0,0 +1,20 @@
+<?php
+
+require_once __DIR__ . '/../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
+
+use Doctrine\Common\ClassLoader;
+
+$classLoader = new ClassLoader('Doctrine\DBAL\Migrations\Tests', __DIR__ . '/../tests');
+$classLoader->register();
+
+$classLoader = new ClassLoader('Doctrine\DBAL\Migrations', __DIR__ . '/../lib');
+$classLoader->register();
+
+$classLoader = new ClassLoader('Doctrine\DBAL', __DIR__ . '/../lib/vendor/doctrine-dbal/lib');
+$classLoader->register();
+
+$classLoader = new ClassLoader('Doctrine', __DIR__ . '/../lib/vendor/doctrine-common/lib');
+$classLoader->register();
+
+$classLoader = new ClassLoader('Symfony\Component\Yaml', __DIR__ . '/../lib/vendor');
+$classLoader->register();
\ No newline at end of file