mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 18:44:30 +00:00
Bump to version a8
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Alchemy\Phrasea\Core;
|
||||
*/
|
||||
class Version
|
||||
{
|
||||
protected static $number = '3.9.0.a7';
|
||||
protected static $number = '3.9.0.a8';
|
||||
protected static $name = 'Epanterias';
|
||||
|
||||
public static function getNumber()
|
||||
|
132
lib/classes/patch/3908.php
Normal file
132
lib/classes/patch/3908.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2012 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Entities\Task;
|
||||
|
||||
class patch_3908 implements patchInterface
|
||||
{
|
||||
/** @var string */
|
||||
private $release = '3.9.0.a8';
|
||||
|
||||
/** @var array */
|
||||
private $concern = array(base::APPLICATION_BOX);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get_release()
|
||||
{
|
||||
return $this->release;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function require_all_upgrades()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function concern()
|
||||
{
|
||||
return $this->concern;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function apply(base $appbox, Application $app)
|
||||
{
|
||||
$sql = 'SELECT task_id, active, crashed, name, class, settings FROM task2';
|
||||
$stmt = $appbox->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
foreach ($rs as $row) {
|
||||
try {
|
||||
$job = $this->createJob($app, $row['class']);
|
||||
} catch (\RuntimeException $e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$settings = simplexml_load_string($row['settings']);
|
||||
$period = $job->getEditor()->getDefaultPeriod();
|
||||
if ($settings->period) {
|
||||
$period = (int) $settings->period;
|
||||
unset($settings->period);
|
||||
$row['settings'] = $settings->asXML();
|
||||
}
|
||||
|
||||
$task = new Task();
|
||||
$task->setCrashed($row['crashed'])
|
||||
->setJobId($job->getJobId())
|
||||
->setName($row['name'])
|
||||
->setPeriod($period)
|
||||
->setSettings($row['settings'])
|
||||
->setStatus($row['active'] ? Task::STATUS_STARTED : Task::STATUS_STOPPED);
|
||||
}
|
||||
}
|
||||
|
||||
private function createJob(Application $app, $class)
|
||||
{
|
||||
switch (strtolower($class)) {
|
||||
case 'task_period_recordmover':
|
||||
case 'recordmover':
|
||||
$name = 'RecordMover';
|
||||
break;
|
||||
case 'task_period_apibridge':
|
||||
case 'apibridge':
|
||||
$name = 'Bridge';
|
||||
break;
|
||||
case 'task_period_archive':
|
||||
case 'archive':
|
||||
$name = 'Archive';
|
||||
break;
|
||||
case 'task_period_cindexer':
|
||||
case 'cindexer':
|
||||
$name = 'PhraseanetIndexer';
|
||||
break;
|
||||
case 'task_period_emptyColl':
|
||||
case 'emptyColl':
|
||||
$name = 'EmptyCollection';
|
||||
break;
|
||||
case 'task_period_ftp':
|
||||
case 'ftp':
|
||||
$name = 'Ftp';
|
||||
break;
|
||||
case 'task_period_ftppull':
|
||||
case 'ftppull':
|
||||
$name = 'FtpPull';
|
||||
break;
|
||||
case 'task_period_subdef':
|
||||
case 'subdef':
|
||||
$name = 'Subdefs';
|
||||
break;
|
||||
case 'task_period_test':
|
||||
case 'test':
|
||||
$name = 'Null';
|
||||
break;
|
||||
case 'task_period_writemeta':
|
||||
case 'writemeta':
|
||||
$name = 'WriteMetadata';
|
||||
break;
|
||||
default:
|
||||
throw new \RuntimeException(sprintf('Unable to migrate task named %s ', $class));
|
||||
}
|
||||
|
||||
return $app['task-manager.job-factory']->create($name);
|
||||
}
|
||||
}
|
@@ -2415,117 +2415,6 @@
|
||||
</indexes>
|
||||
<engine>InnoDB</engine>
|
||||
</table>
|
||||
<table name="task2">
|
||||
<fields>
|
||||
<field>
|
||||
<name>task_id</name>
|
||||
<type>int(11) unsigned</type>
|
||||
<null></null>
|
||||
<extra>auto_increment</extra>
|
||||
<default></default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>usr_id_owner</name>
|
||||
<type>int(11) unsigned</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default>0</default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>pid</name>
|
||||
<type>int(11) unsigned</type>
|
||||
<null>YES</null>
|
||||
<extra></extra>
|
||||
<default></default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>status</name>
|
||||
<type>enum('stopped','started','starting','stopping','tostart','tostop','manual','torestart')</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default>stopped</default>
|
||||
<comment></comment>
|
||||
<collation>ascii_bin</collation>
|
||||
</field>
|
||||
<field>
|
||||
<name>crashed</name>
|
||||
<type>int(2) unsigned</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default>0</default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>active</name>
|
||||
<type>int(1) unsigned</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default>0</default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>name</name>
|
||||
<type>varchar(100)</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default></default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>last_exec_time</name>
|
||||
<type>datetime</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default>0000-00-00 00:00:00</default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>class</name>
|
||||
<type>varchar(100)</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default></default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>settings</name>
|
||||
<type>text</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default></default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>completed</name>
|
||||
<type>tinyint(4)</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default>-1</default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
<field>
|
||||
<name>runner</name>
|
||||
<type>char(20)</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
<default>-1</default>
|
||||
<comment></comment>
|
||||
</field>
|
||||
</fields>
|
||||
<indexes>
|
||||
<index>
|
||||
<name>PRIMARY</name>
|
||||
<type>PRIMARY</type>
|
||||
<fields>
|
||||
<field>task_id</field>
|
||||
</fields>
|
||||
</index>
|
||||
</indexes>
|
||||
<engine>InnoDB</engine>
|
||||
</table>
|
||||
<table name="tokens">
|
||||
<fields>
|
||||
<field>
|
||||
|
Reference in New Issue
Block a user