Add Secrets to ApplicationBox.

This commit is contained in:
Benoît Burnichon
2015-05-19 18:25:15 +02:00
parent 1e61c4aab7
commit c2ff3b6575
6 changed files with 219 additions and 36 deletions

View File

@@ -185,46 +185,47 @@ abstract class base implements cache_cacheableInterface
$stmt->closeCursor();
$ORMTables = [
'AuthFailures',
'ApiApplications',
'AggregateTokens',
'ApiAccounts',
'ApiApplications',
'ApiLogs',
'ApiOauthCodes',
'ApiOauthRefreshTokens',
'ApiOauthTokens',
'AggregateTokens',
'AuthFailures',
'BasketElements',
'Baskets',
'FeedEntries',
'FeedItems',
'FeedPublishers',
'FeedTokens',
'Feeds',
'FeedTokens',
'FtpCredential',
'FtpExportElements',
'FtpExports',
'LazaretAttributes',
'LazaretChecks',
'LazaretFiles',
'LazaretSessions',
'OrderElements',
'Orders',
'Registrations',
'Secrets',
'SessionModules',
'Sessions',
'StoryWZ',
'Tasks',
'UserNotificationSettings',
'UserQueries',
'Users',
'UserSettings',
'UsrAuthProviders',
'UsrListOwners',
'UsrLists',
'UsrListsContent',
'ValidationDatas',
'ValidationParticipants',
'ValidationSessions',
'LazaretAttributes',
'LazaretChecks',
'LazaretFiles',
'LazaretSessions',
'SessionModules',
'Sessions',
'Tasks',
'UsrAuthProviders',
'UserQueries',
'UserSettings',
'Users',
'UserNotificationSettings',
];
foreach ($rs as $row) {
@@ -742,6 +743,7 @@ abstract class base implements cache_cacheableInterface
foreach ($list_patches as $patch) {
// Gets doctrine migrations required for current patch
foreach ($patch->getDoctrineMigrations() as $doctrineVersion) {
/** @var \Doctrine\DBAL\Migrations\Version $version */
$version = $app['doctrine-migration.configuration']->getVersion($doctrineVersion);
// Skip if already migrated
if ($version->isMigrated()) {
@@ -750,17 +752,22 @@ abstract class base implements cache_cacheableInterface
$migration = $version->getMigration();
// Inject entity manager
$migration->setEntityManager($app['orm.em']);
// Handle legacy migrations
if ($migration instanceof \Alchemy\Phrasea\Setup\DoctrineMigrations\AbstractMigration) {
// Inject entity manager
$migration->setEntityManager($app['orm.em']);
// Execute migration if not marked as migrated and not already applied by an older patch
if (!$migration->isAlreadyApplied()) {
// Execute migration if not marked as migrated and not already applied by an older patch
if (!$migration->isAlreadyApplied()) {
$version->execute('up');
continue;
}
// Or mark it as migrated
$version->markMigrated();
} else {
$version->execute('up');
continue;
}
// Or mark it as migrated
$version->markMigrated();
}
if (false === $patch->apply($this, $app)) {

View File

@@ -0,0 +1,63 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Alchemy\Phrasea\Application;
class patch_400alpha2a implements patchInterface
{
/** @var string */
private $release = '4.0.0-alpha.2';
/** @var array */
private $concern = [base::APPLICATION_BOX];
/**
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return [
'20150519173347',
];
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
return true;
}
}