diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php index e1192b6e08..4256eaa90c 100644 --- a/lib/Alchemy/Phrasea/Core/Version.php +++ b/lib/Alchemy/Phrasea/Core/Version.php @@ -18,7 +18,7 @@ namespace Alchemy\Phrasea\Core; */ class Version { - protected static $number = '3.8.4-alpha.1'; + protected static $number = '3.8.4-alpha.2'; protected static $name = 'Diplodocus'; public static function getNumber() diff --git a/lib/classes/databox/status.php b/lib/classes/databox/status.php index 5c4a69c588..8dc5da54d6 100644 --- a/lib/classes/databox/status.php +++ b/lib/classes/databox/status.php @@ -69,8 +69,14 @@ class databox_status return; } - $path = $this->path = $app['root.path'] . "/config/status/" . urlencode($sbas_params[$sbas_id]["host"]) . "-" . urlencode($sbas_params[$sbas_id]["port"]) . "-" . urlencode($sbas_params[$sbas_id]["dbname"]); - $url = $this->url = "/custom/status/" . urlencode($sbas_params[$sbas_id]["host"]) . "-" . urlencode($sbas_params[$sbas_id]["port"]) . "-" . urlencode($sbas_params[$sbas_id]["dbname"]); + $uniqid = md5(implode('-', array( + $sbas_params[$sbas_id]["host"], + $sbas_params[$sbas_id]["port"], + $sbas_params[$sbas_id]["dbname"] + ))); + + $path = $this->path = $app['root.path'] . "/config/status/" . $uniqid; + $url = $this->url = "/custom/status/" . $uniqid; $databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id); $xmlpref = $databox->get_structure(); diff --git a/lib/classes/patch/384alpha2a.php b/lib/classes/patch/384alpha2a.php new file mode 100644 index 0000000000..c92da4c6a6 --- /dev/null +++ b/lib/classes/patch/384alpha2a.php @@ -0,0 +1,72 @@ +release; + } + + /** + * {@inheritdoc} + */ + public function require_all_upgrades() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function concern() + { + return $this->concern; + } + + /** + * {@inheritdoc} + */ + public function apply(base $appbox, Application $app) + { + $finder = new Finder(); + $fs = new Filesystem(); + foreach ($finder->files()->in($app['root.path'].'/config/status') as $file) { + if (!$file->isFile()) { + continue; + } + $fileName = $file->getFileName(); + $chunks = explode('-', $fileName); + + if (count($chunks) < 4) { + continue; + } + + $suffix = array_pop($chunks); + $uniqid = md5(implode('-', $chunks)); + + $fs->rename($file->getRealPath(), $app['root.path'].'/config/status/' . $uniqid . '-' . $suffix); + } + } +}