Remove PreSchema Upgrader

This commit is contained in:
Nicolas Le Goff
2013-11-18 14:16:52 +01:00
parent 4c58b141ee
commit 1cde667730
4 changed files with 0 additions and 86 deletions

View File

@@ -13,7 +13,6 @@ namespace Alchemy\Phrasea\Core\Provider;
use Alchemy\Phrasea\Setup\ConfigurationTester; use Alchemy\Phrasea\Setup\ConfigurationTester;
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Setup\Version\PreSchemaUpgrade\PreSchemaUpgradeCollection;
use Silex\Application as SilexApplication; use Silex\Application as SilexApplication;
use Silex\ServiceProviderInterface; use Silex\ServiceProviderInterface;
@@ -25,10 +24,6 @@ class ConfigurationTesterServiceProvider implements ServiceProviderInterface
$app['phraseanet.configuration-tester'] = $app->share(function (Application $app) { $app['phraseanet.configuration-tester'] = $app->share(function (Application $app) {
return new ConfigurationTester($app); return new ConfigurationTester($app);
}); });
$app['phraseanet.pre-schema-upgrader'] = $app->share(function () {
return new PreSchemaUpgradeCollection();
});
} }
public function boot(SilexApplication $app) public function boot(SilexApplication $app)

View File

@@ -1,41 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Setup\Version\PreSchemaUpgrade;
use Alchemy\Phrasea\Application;
/**
* Collection of Doctrine schema pre-upgrades
*/
class PreSchemaUpgradeCollection
{
/** @var PreSchemaUpgradeInterface[] */
private $upgrades = [];
public function __construct()
{
}
/**
* Applies all applyable upgrades
*
* @param Application $app
*/
public function apply(Application $app)
{
foreach ($this->upgrades as $upgrade) {
if ($upgrade->isApplyable($app)) {
$upgrade->apply($app['EM']);
}
}
}
}

View File

@@ -1,38 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Setup\Version\PreSchemaUpgrade;
use Doctrine\ORM\EntityManager;
use Alchemy\Phrasea\Application;
/**
* Interface for DB schema upgrade that have to be done before Doctrine schema
* upgrade
*/
interface PreSchemaUpgradeInterface
{
/**
* Applies the pre-upgrade/
*
* @param EntityManager $em
*/
public function apply(EntityManager $em);
/**
* Returns true if the Upgrade is applyable
*
* @param Application $app
*
* @return Boolean
*/
public function isApplyable(Application $app);
}

View File

@@ -306,8 +306,6 @@ class appbox extends base
$upgrader->set_current_message(_('Creating new tables')); $upgrader->set_current_message(_('Creating new tables'));
$app['phraseanet.pre-schema-upgrader']->apply($app);
$upgrader->add_steps_complete(1); $upgrader->add_steps_complete(1);
/** /**