Skip to content

Commit

Permalink
Merge pull request #9 from claroline/dev-5.0
Browse files Browse the repository at this point in the history
Dev 5.0
  • Loading branch information
ngodfraind committed Apr 29, 2015
2 parents 28146bd + acf4c69 commit 442dd0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions Manager/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Manager
private $generator;
private $writer;
private $migrator;
private $supportedPlatforms;

/**
* Constructor.
Expand Down Expand Up @@ -147,20 +148,23 @@ public function discardUpperMigrations(Bundle $bundle)
*/
public function getAvailablePlatforms()
{
$rDriverManager = new \ReflectionClass('Doctrine\DBAL\DriverManager');
$rMap = $rDriverManager->getProperty('_driverMap');
$rMap->setAccessible(true);
$driverMap = $rMap->getValue();
$platforms = array();

foreach ($driverMap as $driverName => $driverClass) {
foreach ($this->getSupportedDrivers() as $driverName => $driverClass) {
$driver = new $driverClass;
$platforms[$driverName] = $driver->getDatabasePlatform();
}

return $platforms;
}

private function getSupportedDrivers()
{
return array(
'pdo_mysql' => 'Doctrine\DBAL\Driver\PDOMySql\Driver'
);
}

private function doMigrate(Bundle $bundle, $version, $direction)
{
$action = $direction === Migrator::DIRECTION_UP ? 'Ugprading' : 'Downgrading';
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
],
"require": {
"php": ">=5.3.3",
"symfony/framework-bundle": "~2.0",
"symfony/framework-bundle": "*",
"symfony/console": "~2.0",
"symfony/twig-bridge": "~2.0",
"symfony/twig-bundle": "~2.0",
"doctrine/orm": "~2.2",
"doctrine/migrations": "dev-master",
"jdorn/sql-formatter": "~1.0",
"claroline/kernel-bundle": "~1.0"
"claroline/kernel-bundle": "*"
},
"require-dev": {
"mockery/mockery": "dev-master@dev",
Expand Down

0 comments on commit 442dd0d

Please sign in to comment.