Skip to content
Snippets Groups Projects
Commit 3f493b6a authored by Ghislain Loas's avatar Ghislain Loas
Browse files

fix cosmogramme patch path in Migrations/Patchs.php

parent 3f859e8b
Branches
Tags
5 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!228Dev#12992 Custom Fields,!222Master,!220Cosmogramme Version,!219Hotline 6.46
......@@ -22,8 +22,10 @@
class Class_Migration_Patchs {
use Trait_StaticFileSystem;
const PATCH_PATH="./cosmogramme/sql/patch";
public $force=false;
public $force = false;
function extensionForFile($file) {
return substr($file, -4);
}
......@@ -40,7 +42,7 @@ class Class_Migration_Patchs {
public function getLastPatchNumber() {
$ids=[];
foreach (self::getFileSystem()->glob(self::PATCH_PATH."/patch_*") as $filename) {
foreach (self::getFileSystem()->glob(PATCH_PATH."patch_*") as $filename) {
$ids[]=$this->versionForFile($filename);
}
if (empty($ids))
......@@ -51,7 +53,7 @@ class Class_Migration_Patchs {
public function getMatchingPatchFiles($patch_level) {
$scripts=[];
foreach (self::getFileSystem()->glob(self::PATCH_PATH."/patch_*") as $filename) {
foreach (self::getFileSystem()->glob(PATCH_PATH."patch_*") as $filename) {
if (!in_array($this->extensionForFile($filename), ['.sql', '.php']))
continue;
$numero = $this->versionForFile($filename);
......
......@@ -106,6 +106,8 @@ function setupConstants() {
defineConstant('MEMCACHED_PORT', '11211');
defineConstant('IMAGE_MAGICK_PATH', 'convert');
defineConstant('PATCH_PATH', ROOT_PATH . '/cosmogramme/sql/patch/');
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment