Fix migration

This commit is contained in:
Nicolas Le Goff
2013-11-13 12:36:22 +01:00
parent 57c9e6e453
commit d8ea06b521
79 changed files with 1249 additions and 1060 deletions

View File

@@ -11,49 +11,49 @@
use Alchemy\Phrasea\Application;
/**
*
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_320alpha1a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.2.0-alpha.1';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var Array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
$sql = 'UPDATE record SET parent_record_id = "1"

View File

@@ -11,48 +11,49 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_320alpha1b implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.2.0-alpha.1';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var Array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$sql = 'REPLACE INTO records_rights

View File

@@ -11,48 +11,49 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_320alpha2a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.2.0-alpha.2';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$sql = 'SELECT * FROM usr WHERE nonce IS NULL';
@@ -65,7 +66,7 @@ class patch_320alpha2a implements patchInterface
$stmt = $appbox->get_connection()->prepare($sql);
foreach ($rs as $row) {
$nonce = random::generatePassword(16);
$params = [':usr_id' => $row['usr_id'], ':nonce' => $nonce];
$params = array(':usr_id' => $row['usr_id'], ':nonce' => $nonce);
$stmt->execute($params);
}
$stmt->closeCursor();
@@ -82,10 +83,10 @@ class patch_320alpha2a implements patchInterface
if (strpos($row['class'], 'task_period_') !== false)
continue;
$params = [
$params = array(
':task_id' => $row['task_id']
, ':class' => str_replace('task_', 'task_period_', $row['class'])
];
);
$stmt->execute($params);
}

View File

@@ -11,48 +11,49 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_320alpha3a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.2.0-alpha.3';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$sql = 'UPDATE basusr SET nowatermark=1 WHERE needwatermark=0';

View File

@@ -11,48 +11,49 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_320alpha4a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.2.0-alpha.4';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
$sql = 'TRUNCATE metadatas';
@@ -70,7 +71,7 @@ class patch_320alpha4a implements patchInterface
$stmt->execute();
$stmt->closeCursor();
$phrasea_maps = [
$phrasea_maps = array(
'pdftext' => 'Phraseanet:pdftext'
, 'tf-archivedate' => 'Phraseanet:tf-archivedate'
, 'tf-atime' => 'Phraseanet:tf-atime'
@@ -89,7 +90,7 @@ class patch_320alpha4a implements patchInterface
, 'tf-recordid' => 'Phraseanet:tf-recordid'
, 'tf-size' => 'Phraseanet:tf-size'
, 'tf-width' => 'Phraseanet:tf-width'
];
);
$sxe = $databox->get_sxml_structure();
$dom_struct = $databox->get_dom_structure();

View File

@@ -15,55 +15,54 @@ use Alchemy\Phrasea\Model\Entities\FeedEntry;
use Alchemy\Phrasea\Model\Entities\FeedItem;
use Alchemy\Phrasea\Model\Entities\FeedPublisher;
use Gedmo\Timestampable\TimestampableListener;
use Doctrine\ORM\Query\ResultSetMapping;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_320alpha4b implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.2.0-alpha.4';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('feed');
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return true;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$feeds = array();
try {
@@ -120,7 +119,7 @@ class patch_320alpha4b implements patchInterface
$sql = 'SELECT sselcont_id, ssel_id, base_id, record_id
FROM sselcont WHERE ssel_id = :ssel_id ORDER BY ord ASC';
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute([':ssel_id' => $row['ssel_id']]);
$stmt->execute(array(':ssel_id' => $row['ssel_id']));
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
@@ -143,7 +142,7 @@ class patch_320alpha4b implements patchInterface
$sql = 'UPDATE ssel SET deleted = "1", migrated="1"
WHERE ssel_id = :ssel_id';
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute([':ssel_id' => $row['ssel_id']]);
$stmt->execute(array(':ssel_id' => $row['ssel_id']));
$stmt->closeCursor();
$app['EM']->persist($feed);
$n++;
@@ -171,7 +170,7 @@ class patch_320alpha4b implements patchInterface
return;
}
protected static $feeds = [];
protected static $feeds = array();
protected function get_feed(appbox $appbox, User_Adapter $user, $pub_restrict, $homelink, Application $app)
{
@@ -204,9 +203,9 @@ class patch_320alpha4b implements patchInterface
if ($homelink) {
$feed->setPublic(true);
$app['EM']->persist($feed);
$app['EM']->persist($user);
$app['EM']->flush();
$app['EM']->persist($feed);
$app['EM']->persist($user);
$app['EM']->flush();
} elseif ($pub_restrict == 1) {
$collections = $app['acl']->get($user)->get_granted_base();

View File

@@ -11,51 +11,51 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_320alpha5a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.2.0-alpha.5';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$sql = 'SELECT base_id, usr_id FROM order_masters';
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute();
@@ -67,10 +67,10 @@ class patch_320alpha5a implements patchInterface
$stmt = $appbox->get_connection()->prepare($sql);
foreach ($rs as $row) {
$params = [
$params = array(
':base_id' => $row['base_id'],
':usr_id' => $row['usr_id']
];
);
$stmt->execute($params);
}

View File

@@ -11,48 +11,50 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_320alpha6a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.2.0-alpha.6';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
$sql = 'UPDATE record r, subdef s

View File

@@ -11,48 +11,50 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_320alpha8a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.2.0-alpha.8';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return true;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$sql = 'DELETE FROM basusr WHERE actif = "0"';

View File

@@ -13,53 +13,52 @@ use Alchemy\Phrasea\Application;
use Doctrine\DBAL\Migrations\Configuration\Configuration;
use Doctrine\DBAL\DriverManager;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_360alpha1a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.6.0-alpha.1';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return true;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('workzone', 'session');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$tables = array('StoryWZ', 'ValidationDatas', 'ValidationParticipants', 'ValidationSessions', 'BasketElements', 'Baskets');
foreach ($tables as $table) {
@@ -69,7 +68,7 @@ class patch_360alpha1a implements patchInterface
$stmt->closeCursor();
}
$stories = [];
$stories = array();
$sql = 'SELECT sbas_id, rid as record_id, usr_id
FROM ssel
@@ -80,7 +79,7 @@ class patch_360alpha1a implements patchInterface
$rs_s = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$current = [];
$current = array();
foreach ($rs_s as $row_story) {
$serial = $row_story['sbas_id'] . '_' . $row_story['usr_id'] . '_' . $row_story['record_id'];
@@ -99,11 +98,11 @@ class patch_360alpha1a implements patchInterface
$stmt = $appbox->get_connection()->prepare($sql);
foreach ($stories as $row) {
$params = [
$params = array(
':usr_id' => $row['usr_id'],
':sbas_id' => $row['sbas_id'],
':record_id' => $row['record_id']
];
);
$stmt->execute($params);
}
@@ -138,7 +137,7 @@ class patch_360alpha1a implements patchInterface
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$sselcont_ids = [];
$sselcont_ids = array();
foreach ($rs as $row) {
$sql = 'SELECT c.sselcont_id, c.record_id, b.sbas_id
@@ -147,11 +146,11 @@ class patch_360alpha1a implements patchInterface
AND c.ssel_id = :ssel_id AND s.ssel_id = c.ssel_id';
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute([':ssel_id' => $row['ssel_id']]);
$stmt->execute(array(':ssel_id' => $row['ssel_id']));
$rs_be = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$current = [];
$current = array();
foreach ($rs_be as $row_sselcont) {
$serial = $row_sselcont['sbas_id'] . '_' . $row_sselcont['record_id'];
@@ -168,7 +167,7 @@ class patch_360alpha1a implements patchInterface
$stmt = $appbox->get_connection()->prepare($sql);
foreach ($sselcont_ids as $sselcont_id) {
$stmt->execute([':sselcont_id' => $sselcont_id]);
$stmt->execute(array(':sselcont_id' => $sselcont_id));
}
$stmt->closeCursor();
@@ -237,11 +236,11 @@ class patch_360alpha1a implements patchInterface
)';
$stmt = $appbox->get_connection()->prepare($sql);
foreach ($rs as $row) {
$params = [
$params = array(
':participant_id' => $row['participant_id'],
':basket_id' => $row['basket_id'],
':usr_id' => $row['usr_id'],
];
);
$stmt->execute($params);
}

View File

@@ -11,48 +11,50 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_360alpha1b implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.6.0-alpha.1';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
try {

View File

@@ -11,48 +11,50 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_360alpha2a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.6.0-alpha.2';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return true;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{

View File

@@ -11,48 +11,50 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_360alpha2b implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.6.0-alpha.2';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return true;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
/**
@@ -119,7 +121,7 @@ class patch_360alpha2b implements patchInterface
VALUES (null, :record_id, :meta_struct_id, :value)';
$stmt = $databox->get_connection()->prepare($sql);
$databox_fields = [];
$databox_fields = array();
foreach ($rs as $row) {
$meta_struct_id = $row['meta_struct_id'];
@@ -131,11 +133,11 @@ class patch_360alpha2b implements patchInterface
$values = \caption_field::get_multi_values($row['value'], $databox_fields[$meta_struct_id]->get_separator());
foreach ($values as $value) {
$params = [
$params = array(
':record_id' => $row['record_id'],
':meta_struct_id' => $row['meta_struct_id'],
':value' => $value,
];
);
$stmt->execute($params);
}
}
@@ -146,7 +148,7 @@ class patch_360alpha2b implements patchInterface
$stmt = $databox->get_connection()->prepare($sql);
foreach ($rs as $row) {
$params = [':id' => $row['id']];
$params = array(':id' => $row['id']);
$stmt->execute($params);
}

View File

@@ -12,48 +12,50 @@
use Alchemy\Phrasea\Application;
use Doctrine\ORM\Tools\Pagination\Paginator;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_361alpha1a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.6.1-alpha.1';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
return true;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('workzone');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$conn = $appbox->get_connection();
@@ -77,7 +79,7 @@ class patch_361alpha1a implements patchInterface
$sql = 'SELECT record_id FROM record WHERE record_id = :record_id';
$stmt = $connbas->prepare($sql);
$stmt->execute([':record_id' => $row['record_id']]);
$stmt->execute(array(':record_id' => $row['record_id']));
$rowCount = $stmt->rowCount();
$stmt->closeCursor();

View File

@@ -11,48 +11,50 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_370alpha1a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.0-alpha.1';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
$conn = $databox->get_connection();
@@ -84,7 +86,7 @@ class patch_370alpha1a implements patchInterface
$sql = 'UPDATE pref SET value = :structure WHERE prop = "structure"';
$stmt = $conn->prepare($sql);
$stmt->execute([':structure' => $DOMDocument->saveXML()]);
$stmt->execute(array(':structure' => $DOMDocument->saveXML()));
$stmt->closeCursor();
return true;

View File

@@ -12,24 +12,13 @@
use Alchemy\Phrasea\Application;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_370alpha3a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.0-alpha.3';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
@@ -40,20 +29,33 @@ class patch_370alpha3a implements patchInterface
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
try {

View File

@@ -11,48 +11,49 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_370alpha4a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.0-alpha.4';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
$sql = 'SELECT id, src FROM metadatas_structure';
@@ -61,7 +62,7 @@ class patch_370alpha4a implements patchInterface
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$update = [];
$update = array();
$tagDirname = new \Alchemy\Phrasea\Metadata\Tag\TfDirname();
$tagBasename = new \Alchemy\Phrasea\Metadata\Tag\TfBasename();
@@ -69,10 +70,10 @@ class patch_370alpha4a implements patchInterface
foreach ($rs as $row) {
if (strpos(strtolower($row['src']), 'tf-parentdir') !== false) {
$update[] = ['id' => $row['id'], 'src' => $tagDirname->getTagname()];
$update[] = array('id' => $row['id'], 'src' => $tagDirname->getTagname());
}
if (strpos(strtolower($row['src']), 'tf-filename') !== false) {
$update[] = ['id' => $row['id'], 'src' => $tagBasename->getTagname()];
$update[] = array('id' => $row['id'], 'src' => $tagBasename->getTagname());
}
}
@@ -80,7 +81,7 @@ class patch_370alpha4a implements patchInterface
$stmt = $databox->get_connection()->prepare($sql);
foreach ($update as $row) {
$stmt->execute([':src' => $row['src'], ':id' => $row['id']]);
$stmt->execute(array(':src' => $row['src'], ':id' => $row['id']));
}
$stmt->closeCursor();

View File

@@ -11,48 +11,49 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_370alpha5a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.0-alpha.5';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
@@ -62,20 +63,20 @@ class patch_370alpha5a implements patchInterface
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$update = [];
$update = array();
foreach ($rs as $row) {
$src = str_replace(
['/rdf:RDF/rdf:Description/PHRASEANET:', '/rdf:RDF/rdf:Description/'], ['Phraseanet:', ''], $row['src']
array('/rdf:RDF/rdf:Description/PHRASEANET:', '/rdf:RDF/rdf:Description/'), array('Phraseanet:', ''), $row['src']
);
$update[] = ['id' => $row['id'], 'src' => $src];
$update[] = array('id' => $row['id'], 'src' => $src);
}
$sql = 'UPDATE metadatas_structure SET src = :src WHERE id = :id';
$stmt = $databox->get_connection()->prepare($sql);
foreach ($update as $row) {
$stmt->execute([':src' => $row['src'], ':id' => $row['id']]);
$stmt->execute(array(':src' => $row['src'], ':id' => $row['id']));
}
$stmt->closeCursor();

View File

@@ -11,48 +11,49 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_370alpha6a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.0-alpha.6';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
$structure = $databox->get_structure();
@@ -80,7 +81,7 @@ class patch_370alpha6a implements patchInterface
$this->addScreenDeviceOption($subdefgroups, $subdef, $groupname);
if (in_array($name, ['preview', 'thumbnail'])) {
if (in_array($name, array('preview', 'thumbnail'))) {
if ($name == 'thumbnail' || $subdef->getSubdefType()->getType() != \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO) {
$this->addMobileSubdefImage($subdefgroups, $subdef, $groupname);
@@ -104,7 +105,7 @@ class patch_370alpha6a implements patchInterface
{
$optionsSubdef = $subdef->getOptions();
$options = [];
$options = array();
foreach ($optionsSubdef as $optname => $option) {
$options[$optname] = $option->getValue();
@@ -113,19 +114,19 @@ class patch_370alpha6a implements patchInterface
$options['path'] = $subdef->get_path();
$options['mediatype'] = $subdef->getSubdefType()->getType();
$options['meta'] = $subdef->meta_writeable() ? 'yes' : 'no';
$options['devices'] = [databox_subdef::DEVICE_SCREEN];
$options['devices'] = array(databox_subdef::DEVICE_SCREEN);
$root->set_subdef($groupname, $subdef->get_name(), $subdef->get_class(), $subdef->is_downloadable(), $options, []);
$root->set_subdef($groupname, $subdef->get_name(), $subdef->get_class(), $subdef->is_downloadable(), $options, array());
}
protected function addMobileSubdefVideo($root, $baseSubdef, $groupname)
{
$newSubdefOptionsWebM = $newSubdefOptionsOgg = $newSubdefOptionsX264 = [
$newSubdefOptionsWebM = $newSubdefOptionsOgg = $newSubdefOptionsX264 = array(
'path' => $baseSubdef->get_path(),
'mediatype' => \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO
];
);
$options = [
$options = array(
'path' => $baseSubdef->get_path(),
'mediatype' => \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO,
'bitrate' => '300',
@@ -133,8 +134,8 @@ class patch_370alpha6a implements patchInterface
'GOPsize' => '25',
'size' => '480',
'fps' => '15',
'devices' => [databox_subdef::DEVICE_HANDHELD],
];
'devices' => array(databox_subdef::DEVICE_HANDHELD),
);
foreach ($options as $name => $value) {
$newSubdefOptionsWebM[$name] = $value;
@@ -151,14 +152,14 @@ class patch_370alpha6a implements patchInterface
$newSubdefOptionsX264['acodec'] = 'libvo_aacenc';
$newSubdefOptionsX264['vcodec'] = 'libx264';
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_webM', $baseSubdef->get_class(), false, $newSubdefOptionsWebM, []);
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_OGG', $baseSubdef->get_class(), false, $newSubdefOptionsOgg, []);
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_X264', $baseSubdef->get_class(), false, $newSubdefOptionsX264, []);
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_webM', $baseSubdef->get_class(), false, $newSubdefOptionsWebM, array());
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_OGG', $baseSubdef->get_class(), false, $newSubdefOptionsOgg, array());
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_X264', $baseSubdef->get_class(), false, $newSubdefOptionsX264, array());
}
protected function addMobileSubdefImage($root, $baseSubdef, $groupname)
{
$optionMobile = [];
$optionMobile = array();
$optionMobile['size'] = $baseSubdef->get_name() == 'thumbnail' ? '150' : '480';
$optionMobile['resolution'] = '72';
@@ -168,18 +169,18 @@ class patch_370alpha6a implements patchInterface
$optionMobile['mediatype'] = \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_IMAGE;
$optionMobile['meta'] = 'no';
$optionMobile['devices'] = [databox_subdef::DEVICE_HANDHELD];
$optionMobile['devices'] = array(databox_subdef::DEVICE_HANDHELD);
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile', $baseSubdef->get_class(), false, $optionMobile, []);
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile', $baseSubdef->get_class(), false, $optionMobile, array());
}
protected function addHtml5Video($root, $baseSubdef, $groupname)
{
$newSubdefOptionsWebM = $newSubdefOptionsOgg = [
$newSubdefOptionsWebM = $newSubdefOptionsOgg = array(
'path' => $baseSubdef->get_path(),
'mediatype' => \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO,
'devices' => [\databox_subdef::DEVICE_SCREEN]
];
'devices' => array(\databox_subdef::DEVICE_SCREEN)
);
foreach ($baseSubdef->getOptions() as $optionname => $option) {
$newSubdefOptionsWebM[$optionname] = $option->getValue();
@@ -192,7 +193,7 @@ class patch_370alpha6a implements patchInterface
$newSubdefOptionsOgg['vcodec'] = 'libtheora';
$newSubdefOptionsOgg['acodec'] = 'libvorbis';
$root->set_subdef($groupname, $baseSubdef->get_name() . '_webM', $baseSubdef->get_class(), false, $newSubdefOptionsWebM, []);
$root->set_subdef($groupname, $baseSubdef->get_name() . '_OGG', $baseSubdef->get_class(), false, $newSubdefOptionsOgg, []);
$root->set_subdef($groupname, $baseSubdef->get_name() . '_webM', $baseSubdef->get_class(), false, $newSubdefOptionsWebM, array());
$root->set_subdef($groupname, $baseSubdef->get_name() . '_OGG', $baseSubdef->get_class(), false, $newSubdefOptionsOgg, array());
}
}

View File

@@ -15,53 +15,51 @@ use Alchemy\Phrasea\Model\Entities\LazaretSession;
use MediaAlchemyst\Exception\ExceptionInterface as MediaAlchemystException;
use MediaAlchemyst\Specification\Image as ImageSpec;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_370alpha7a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.0-alpha.7';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('lazaret');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$conn = $appbox->get_connection();
try {

View File

@@ -12,48 +12,43 @@
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Model\Entities\Task;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_370alpha8a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.0-alpha.8';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
public function getDoctrineMigrations()
{
return array('task');
}
/**
* transform tasks 'workflow 01' to 'RecordMover'
* will group tasks(01) with same period to a single task(02)
@@ -65,9 +60,6 @@ class patch_370alpha8a implements patchInterface
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$ttasks = array();
$conn = $appbox->get_connection();
$sql = 'SELECT task_id, active, name, class, settings FROM task2 WHERE class=\'task_period_workflow01\'';
@@ -77,11 +69,11 @@ class patch_370alpha8a implements patchInterface
$stmt->closeCursor();
}
$tdom = []; // key = period
$taskstodel = [];
$tdom = array(); // key = period
$taskstodel = array();
foreach ($ttasks as $task) {
$active = true;
$warning = [];
$warning = array();
/*
* migrating task 'workflow01'
@@ -98,7 +90,7 @@ class patch_370alpha8a implements patchInterface
$ts->appendChild($dom->createElement('period'))->appendChild($dom->createTextNode(60 * $period));
$ts->appendChild($dom->createElement('logsql'))->appendChild($dom->createTextNode('1'));
$tasks = $ts->appendChild($dom->createElement('tasks'));
$tdom['_' . $period] = ['dom' => $dom, 'tasks' => $tasks];
$tdom['_' . $period] = array('dom' => $dom, 'tasks' => $tasks);
} else {
$dom = &$tdom['_' . $period]['dom'];
$tasks = &$tdom['_' . $period]['tasks'];

View File

@@ -11,42 +11,40 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_370alpha9a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.0-alpha.9';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
@@ -54,8 +52,7 @@ class patch_370alpha9a implements patchInterface
}
/**
* @param base $appbox
* @param Application $app
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{

View File

@@ -19,29 +19,35 @@ class patch_3715alpha1a implements patchInterface
*/
private $release = '3.7.15-alpha1';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
@@ -49,7 +55,7 @@ class patch_3715alpha1a implements patchInterface
}
/**
* @param base $databox
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{

View File

@@ -11,42 +11,32 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_371alpha1a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.1-alpha1';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
@@ -54,8 +44,15 @@ class patch_371alpha1a implements patchInterface
}
/**
* @param base $databox
* @param Application $app
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{

View File

@@ -11,42 +11,40 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_373alpha1a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.3-alpha.1';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
@@ -54,15 +52,14 @@ class patch_373alpha1a implements patchInterface
}
/**
* @param base $appbox
* @param Application $app
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$sql = 'SELECT * FROM registry WHERE `key` = :key';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$Regbinaries = [
$Regbinaries = array(
'GV_cli',
'GV_swf_extract',
'GV_pdf2swf',
@@ -72,9 +69,9 @@ class patch_373alpha1a implements patchInterface
'GV_ffprobe',
'GV_mp4box',
'GV_pdftotext',
];
);
$mapping = [
$mapping = array(
'GV_cli' => 'php_binary',
'GV_swf_extract' => 'swf_extract_binary',
'GV_pdf2swf' => 'pdf2swf_binary',
@@ -84,12 +81,12 @@ class patch_373alpha1a implements patchInterface
'GV_ffprobe' => 'ffprobe_binary',
'GV_mp4box' => 'mp4box_binary',
'GV_pdftotext' => 'pdftotext_binary',
];
);
$binaries = ['ghostscript_binary' => null];
$binaries = array('ghostscript_binary' => null);
foreach ($Regbinaries as $name) {
$stmt->execute([':key' => $name]);
$stmt->execute(array(':key' => $name));
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
$value = is_executable($row['value']) ? $row['value'] : null;
@@ -105,14 +102,14 @@ class patch_373alpha1a implements patchInterface
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
foreach ($Regbinaries as $name) {
$stmt->execute([':key' => $name]);
$stmt->execute(array(':key' => $name));
}
$stmt->closeCursor();
$sql = 'SELECT value FROM registry WHERE `key` = :key';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':key'=>'GV_sit']);
$stmt->execute(array(':key'=>'GV_sit'));
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
$stmt->closeCursor();
@@ -122,7 +119,7 @@ class patch_373alpha1a implements patchInterface
$sql = 'DELETE FROM registry WHERE `key` = :key';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':key'=>'GV_sit']);
$stmt->execute(array(':key'=>'GV_sit'));
$stmt->closeCursor();
return true;

View File

@@ -13,35 +13,38 @@ use Alchemy\Phrasea\Application;
class patch_379alpha1a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.7.9-alpha1';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
@@ -49,8 +52,7 @@ class patch_379alpha1a implements patchInterface
}
/**
* @param base $appbox
* @param Application $app
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{

View File

@@ -27,6 +27,14 @@ class patch_380alpha10a implements patchInterface
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -45,14 +45,19 @@ class patch_380alpha11a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('session');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
try {
$sql = 'SELECT usr_id, user_agent, ip, platform, browser, app,
browser_version, screen, token, nonce, lastaccess, created_on

View File

@@ -27,6 +27,14 @@ class patch_380alpha13a implements patchInterface
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -35,6 +35,14 @@ class patch_380alpha14a implements patchInterface
return false;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -27,6 +27,13 @@ class patch_380alpha15a implements patchInterface
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -27,6 +27,14 @@ class patch_380alpha16a implements patchInterface
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -27,6 +27,14 @@ class patch_380alpha17a implements patchInterface
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -28,6 +28,14 @@ class patch_380alpha18a implements patchInterface
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -11,42 +11,41 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_380alpha2a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.8.0-alpha.2';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
@@ -54,8 +53,7 @@ class patch_380alpha2a implements patchInterface
}
/**
* @param base $databox
* @param Application $app
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{

View File

@@ -11,42 +11,41 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_380alpha2b implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.8.0-alpha.2';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return true;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
@@ -54,8 +53,7 @@ class patch_380alpha2b implements patchInterface
}
/**
* @param base $appbox
* @param Application $app
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{

View File

@@ -11,49 +11,49 @@
use Alchemy\Phrasea\Application;
/**
*
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_380alpha3a implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.8.0-alpha.3';
/**
*
* @var Array
*/
private $concern = [base::DATA_BOX];
/** @var array */
private $concern = array(base::DATA_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return true;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
$conn = $databox->get_connection();

View File

@@ -11,43 +11,32 @@
use Alchemy\Phrasea\Application;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class patch_380alpha3b implements patchInterface
{
/**
*
* @var string
*/
/** @var string */
private $release = '3.8.0-alpha.3';
/**
*
* @var Array
*/
private $concern = [base::APPLICATION_BOX];
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
*
* @return string
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
*
* @return Array
* {@inheritdoc}
*/
public function concern()
{
@@ -55,8 +44,15 @@ class patch_380alpha3b implements patchInterface
}
/**
* @param base $appbox
* @param Application $app
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
@@ -64,5 +60,4 @@ class patch_380alpha3b implements patchInterface
return true;
}
}

View File

@@ -44,14 +44,20 @@ class patch_380alpha4a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('auth-failure');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$conn = $app['phraseanet.appbox']->get_connection();
$sql = 'SELECT date, login, ip, locked FROM badlog ORDER BY id ASC';
$stmt = $conn->prepare($sql);

View File

@@ -43,6 +43,14 @@ class patch_380alpha6a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -43,6 +43,14 @@ class patch_380alpha8a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -43,6 +43,14 @@ class patch_380alpha9a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -35,6 +35,14 @@ class patch_381alpha1a implements patchInterface
return false;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -35,6 +35,14 @@ class patch_381alpha1b implements patchInterface
return false;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -35,6 +35,14 @@ class patch_381alpha2a implements patchInterface
return false;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array();
}
/**
* {@inheritdoc}
*/

View File

@@ -44,14 +44,19 @@ class patch_390alpha1a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('ftp-credential');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release . 'a');
$version->execute('up');
$conn = $app['phraseanet.appbox']->get_connection();
$sql = 'SELECT usr_id, activeFTP, addrFTP, loginFTP,
retryFTP, passifFTP, pwdFTP, destFTP, prefixFTPfolder

View File

@@ -35,7 +35,7 @@ class patch_390alpha1b implements patchInterface
*/
public function require_all_upgrades()
{
return false;
return true;
}
/**
@@ -46,14 +46,19 @@ class patch_390alpha1b implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('order');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release . 'b');
$version->execute('up');
$sql = 'DELETE FROM Orders';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute();

View File

@@ -46,14 +46,19 @@ class patch_390alpha2a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('user');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$sql = 'DELETE FROM Users';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute();

View File

@@ -44,14 +44,19 @@ class patch_390alpha3a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('user-query');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$sql = 'DELETE FROM UserQueries';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute();

View File

@@ -44,14 +44,19 @@ class patch_390alpha4a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('user-setting');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$sql = 'DELETE FROM UserSettings';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute();

View File

@@ -44,14 +44,19 @@ class patch_390alpha5a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('user-notif-setting');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$sql = 'DELETE FROM UserNotificationSettings';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute();

View File

@@ -46,14 +46,19 @@ class patch_390alpha6a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('ftp-export');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$sql = 'DELETE FROM FtpExports';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute();

View File

@@ -16,6 +16,7 @@ use Alchemy\Phrasea\Model\Entities\FeedEntry;
use Alchemy\Phrasea\Model\Entities\FeedItem;
use Alchemy\Phrasea\Model\Entities\FeedPublisher;
use Alchemy\Phrasea\Model\Entities\FeedToken;
use Doctrine\ORM\Query\ResultSetMapping;
class patch_390alpha7a implements patchInterface
{
@@ -49,13 +50,36 @@ class patch_390alpha7a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('feed', 'aggregate-token');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$rsm = new ResultSetMapping();
$rsm->addScalarResult('Name', 'Name');
$backup = false;
foreach ($app['EM']->createNativeQuery('SHOW TABLE STATUS', $rsm)->getResult() as $row) {
if (0 === strcmp('feeds', $row['Name'])) {
$backup = true;
break;
}
}
if (false === $backup) {
return false;
}
$app['EM']->executeQuery("RENAME TABLE `feeds` TO `feeds_backup`");
$sql = 'DELETE FROM Feeds';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
@@ -89,22 +113,6 @@ class patch_390alpha7a implements patchInterface
$conn = $app['phraseanet.appbox']->get_connection();
$sql = 'SHOW TABLE STATUS;';
$stmt = $conn->prepare($sql);
$stmt->execute();
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$found = false;
foreach ($rs as $row) {
if ('feeds_backup' === $row['Name']) {
$found = true;
break;
}
}
if (!$found) {
return;
}
$sql = 'SELECT id, title, subtitle, public, created_on, updated_on, base_id FROM feeds_backup;';
$stmt = $conn->prepare($sql);
$stmt->execute();

View File

@@ -44,14 +44,19 @@ class patch_390alpha8a implements patchInterface
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return array('task');
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
$version->execute('up');
$sql = 'DELETE FROM Tasks';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute();