diff -r bbdc7f9aa25e -r 03b14b0fe101 vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Configuration/XmlConfiguration.php --- /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 @@ +. +*/ + +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 + */ +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