Commit 0f19f34b authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Possibilité de mettre des versions en chiffres uniquement (12 et plus 12.0 par exemple)

parent 7a18e347
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2,13 +2,13 @@

$bdd = new \BddAdmin\Bdd(Config::get('bdds', 'deploy-local'));
$oa->setBdd($bdd);

/*
$schema = new \BddAdmin\Schema($bdd);

/* Récupération du schéma de référence */
/* Récupération du schéma de référence *
$ref = $schema->loadFromFile($oa->getOseDir() . 'data/ddl.php');

/* Construction de la config de DDL pour filtrer */
/* Construction de la config de DDL pour filtrer *
$ddlConfig = require $oa->getOseDir() . 'data/ddl_config.php';
foreach ($ref as $ddlClass => $objects) {
    foreach ($objects as $object => $objectDdl) {
@@ -21,3 +21,8 @@ $mm->initTablesDef($ref, $ddlConfig);

$r = $mm->testUtile('FormuleMigrationVolumeHoraireStructuresTestVersCode');
var_dump($r);
*/

$t = $oa->getTags();

var_dump($t);
 No newline at end of file
+12 −0
Original line number Diff line number Diff line
@@ -98,8 +98,16 @@ class OseAdmin
            }

            usort($this->tags, function ($a, $b) {
                if ((string)(int)$a !== $a) {
                    $va = (int)substr($a, 0, strpos($a, '.'));
                } else {
                    $va = (int)$a;
                }
                if ((string)(int)$b !== $b) {
                    $vb = (int)substr($b, 0, strpos($b, '.'));
                } else {
                    $vb = (int)$b;
                }

                if ($va == $vb) return $a > $b;

@@ -109,7 +117,11 @@ class OseAdmin

        $tags = $this->tags;
        foreach ($tags as $i => $tag) {
            if ((string)(int)$tag !== $tag) {
                $version = (int)substr($tag, 0, strpos($tag, '.'));
            } else {
                $version = (int)$tag;
            }
            if ($version < $minVersion) unset($tags[$i]);
        }

+12 −0
Original line number Diff line number Diff line
@@ -281,8 +281,16 @@ class OseDeploy
            }

            usort($this->tags, function ($a, $b) {
                if ((string)(int)$a !== $a) {
                    $va = (int)substr($a, 0, strpos($a, '.'));
                } else {
                    $va = (int)$a;
                }
                if ((string)(int)$b !== $b) {
                    $vb = (int)substr($b, 0, strpos($b, '.'));
                } else {
                    $vb = (int)$b;
                }

                if ($va == $vb) return $a > $b;

@@ -292,7 +300,11 @@ class OseDeploy

        $tags = $this->tags;
        foreach ($tags as $i => $tag) {
            if ((string)(int)$tag !== $tag) {
                $version = (int)substr($tag, 0, strpos($tag, '.'));
            } else {
                $version = (int)$tag;
            }
            if ($version < $minVersion) unset($tags[$i]);
        }