From 431966aec3289d627bc75554ed67151d2de2378d Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 20 Mar 2012 12:08:38 +0100 Subject: [PATCH 1/4] Fix upgrade process --- lib/classes/patch/360.class.php | 2 +- lib/classes/patch/3602.class.php | 2 +- lib/classes/patch/3603.class.php | 2 +- lib/classes/patch/3604.class.php | 117 +++++++++++++++++++++++++++++++ 4 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 lib/classes/patch/3604.class.php diff --git a/lib/classes/patch/360.class.php b/lib/classes/patch/360.class.php index 186e1427c5..0804f89972 100644 --- a/lib/classes/patch/360.class.php +++ b/lib/classes/patch/360.class.php @@ -22,7 +22,7 @@ class patch_360 implements patchInterface * * @var string */ - private $release = '3.6.0.0.a1'; + private $release = '3.6.0a1'; /** * diff --git a/lib/classes/patch/3602.class.php b/lib/classes/patch/3602.class.php index 150b5d47b6..43b3be5780 100644 --- a/lib/classes/patch/3602.class.php +++ b/lib/classes/patch/3602.class.php @@ -22,7 +22,7 @@ class patch_3602 implements patchInterface * * @var string */ - private $release = '3.6.0.0.a2'; + private $release = '3.6.0a2'; /** * * @var Array diff --git a/lib/classes/patch/3603.class.php b/lib/classes/patch/3603.class.php index 5565454fa6..5f62abfe59 100644 --- a/lib/classes/patch/3603.class.php +++ b/lib/classes/patch/3603.class.php @@ -22,7 +22,7 @@ class patch_3603 implements patchInterface * * @var string */ - private $release = '3.6.0.0.a2'; + private $release = '3.6.0a2'; /** * * @var Array diff --git a/lib/classes/patch/3604.class.php b/lib/classes/patch/3604.class.php new file mode 100644 index 0000000000..b2ac4b2247 --- /dev/null +++ b/lib/classes/patch/3604.class.php @@ -0,0 +1,117 @@ +release; + } + + public function require_all_upgrades() + { + return true; + } + + /** + * + * @return Array + */ + function concern() + { + return $this->concern; + } + + function apply(base &$databox) + { + + $sql = 'SELECT m . * + FROM metadatas_structure s, metadatas m + WHERE m.meta_struct_id = s.id + AND s.multi = "1"'; + + $stmt = $databox->get_connection()->prepare($sql); + $stmt->execute(); + $rs = $stmt->fetchAll(); + $stmt->closeCursor(); + + $databox->get_connection()->beginTransaction(); + + $sql = 'INSERT INTO metadatas(id, record_id, meta_struct_id, value) + VALUES (null, :record_id, :meta_struct_id, :value)'; + $stmt = $databox->get_connection()->prepare($sql); + + $databox_fields = array(); + + foreach ($rs as $row) + { + $meta_struct_id = $row['meta_struct_id']; + + if (!isset($databox_fields[$meta_struct_id])) + { + $databox_fields[$meta_struct_id] = \databox_field::get_instance($databox, $meta_struct_id); + } + + $values = \caption_field::get_multi_values($row['value'], $databox_fields[$meta_struct_id]->get_separator()); + + foreach ($values as $value) + { + $params = array( + ':record_id' => $row['record_id'], + ':meta_struct_id' => $row['meta_struct_id'], + ':value' => $value, + ); + $stmt->execute($params); + } + } + + $stmt->closeCursor(); + + + $sql = 'DELETE FROM metadatas WHERE id = :id'; + $stmt = $databox->get_connection()->prepare($sql); + + foreach ($rs as $row) + { + $params = array(':id' => $row['id']); + $stmt->execute($params); + } + + $stmt->closeCursor(); + + $databox->get_connection()->commit(); + + return true; + } + +} From fa20b6abcb9536e746ee61f3ff511d204fa6b9e0 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 20 Mar 2012 12:12:15 +0100 Subject: [PATCH 2/4] Fix typo --- templates/web/prod/feeds/feeds.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/prod/feeds/feeds.html b/templates/web/prod/feeds/feeds.html index 558bcb0a15..0351e1356c 100644 --- a/templates/web/prod/feeds/feeds.html +++ b/templates/web/prod/feeds/feeds.html @@ -73,4 +73,4 @@ $('.menu_feeds').buttonsetv(); }); -s \ No newline at end of file + \ No newline at end of file From 5ed518e42329979d3cf8039e5f6ee581b15c656f Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 20 Mar 2012 15:45:32 +0100 Subject: [PATCH 3/4] Fix upgrade --- lib/classes/patch/3602.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/classes/patch/3602.class.php b/lib/classes/patch/3602.class.php index 43b3be5780..f198b3590d 100644 --- a/lib/classes/patch/3602.class.php +++ b/lib/classes/patch/3602.class.php @@ -22,7 +22,7 @@ class patch_3602 implements patchInterface * * @var string */ - private $release = '3.6.0a2'; + private $release = '3.6.0a1'; /** * * @var Array @@ -40,7 +40,7 @@ class patch_3602 implements patchInterface public function require_all_upgrades() { - return true; + return false; } /** From ad320e21931120a9dff3c7627e184955d145917f Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 20 Mar 2012 15:51:14 +0100 Subject: [PATCH 4/4] Remove cache pseudo optimisation --- lib/Alchemy/Phrasea/Core/Configuration.php | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/lib/Alchemy/Phrasea/Core/Configuration.php b/lib/Alchemy/Phrasea/Core/Configuration.php index 70d8bba84e..3ba2277570 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration.php +++ b/lib/Alchemy/Phrasea/Core/Configuration.php @@ -82,8 +82,6 @@ class Configuration { $this->initialize(); - $cacheService = "Cache\array_cache"; - $retrieve_old_credentials = function(\SplFileObject $connexionInc) { require $connexionInc->getPathname(); @@ -131,29 +129,10 @@ class Configuration } $configs[$env]['phraseanet']['servername'] = $old_parameters['servername']; - - if ($env === 'prod' && isset($configs[$env]['cache'])) - { - $configs[$env]["cache"] = $cacheService; - } - if ($env === 'prod' && isset($configs[$env]['opcodecache'])) - { - $configs[$env]["opcodecache"] = $cacheService; - } } + $this->setConfigurations($configs); - $services = $this->getServices(); - - if (isset($services['Orm']["doctrine_prod"]["options"]["cache"])) - { - $services['Orm']["doctrine_prod"]["options"]["cache"]['query']['service'] = $cacheService; - $services['Orm']["doctrine_prod"]["options"]["cache"]['result']['service'] = $cacheService; - $services['Orm']["doctrine_prod"]["options"]["cache"]['metadata']['service'] = $cacheService; - } - - $this->setServices($services); - $this->setEnvironnement('prod'); return $this;