From 425363334cd44fdcbff87a89e54549730b77a3eb Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 5 Dec 2016 14:49:51 +0100 Subject: [PATCH] =?UTF-8?q?Bugfix=20leger=20+=20gestion=20commande=20`init?= =?UTF-8?q?`=20pour=20effacer=20les=20modules=20install=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exporter/Exporter.php | 12 ++- exporter/main.php | 10 +++ exporter/modules.json | 84 +++++++++---------- .../orm/{0.8-1 => 0.8.1}/core/Rows.php | 0 .../orm/{0.8-1 => 0.8.1}/core/SQLBuilder.php | 0 .../orm/{0.8-1 => 0.8.1}/core/Table.php | 0 .../orm/{0.8-2 => 0.8.2}/core/Rows.php | 0 .../orm/{0.8-2 => 0.8.2}/core/SQLBuilder.php | 0 .../orm/{0.8-2 => 0.8.2}/core/Table.php | 0 9 files changed, 63 insertions(+), 43 deletions(-) rename src/modules/orm/{0.8-1 => 0.8.1}/core/Rows.php (100%) rename src/modules/orm/{0.8-1 => 0.8.1}/core/SQLBuilder.php (100%) rename src/modules/orm/{0.8-1 => 0.8.1}/core/Table.php (100%) rename src/modules/orm/{0.8-2 => 0.8.2}/core/Rows.php (100%) rename src/modules/orm/{0.8-2 => 0.8.2}/core/SQLBuilder.php (100%) rename src/modules/orm/{0.8-2 => 0.8.2}/core/Table.php (100%) diff --git a/exporter/Exporter.php b/exporter/Exporter.php index bcdbb0d..c98cbc1 100644 --- a/exporter/Exporter.php +++ b/exporter/Exporter.php @@ -25,6 +25,16 @@ + /* REMOVES ENABLED MODULES + * + */ + public function init(){ + $this->modules['enabled'] = []; + $this->store(); + + return true; + } + /* RETURNS AVAILABLE MODULE LIST * * @return modules Set containing modules and their versions @@ -38,7 +48,7 @@ foreach($versions as $version=>$dependencies) // if version of module enabled - if( isset($this->modules['enabled'][$module]) && is_array($this->modules['enabled'][$module]) && in_array($version, $this->modules['enabled'][$module]) ) + if( isset($this->modules['enabled'][$module]) && $version == $this->modules['enabled'][$module] ) $modules[$module][] = [ 'version' => $version, 'enabled' => true ]; else $modules[$module][] = [ 'version' => $version, 'enabled' => false ]; diff --git a/exporter/main.php b/exporter/main.php index 910b3bf..cf13023 100644 --- a/exporter/main.php +++ b/exporter/main.php @@ -22,6 +22,16 @@ =========================================================*/ switch($arguments[0]){ + /* (0) Reset enabled modules + ---------------------------------------------------------*/ + case 'init': { + + $exporter->init(); + + echo "** success **\n"; + + } break; + /* (1) Modules listing ---------------------------------------------------------*/ case 'modules': { diff --git a/exporter/modules.json b/exporter/modules.json index 434867c..7a02dc8 100644 --- a/exporter/modules.json +++ b/exporter/modules.json @@ -1,43 +1,43 @@ { - "available": { - "error": { - "1.0": [], - "2.0": [] - }, - "api": { - "1.0": { - "error": "1.0" - }, - "2.0": { - "error": "2.0" - } - }, - "orm": { - "0.8-1": { - "database": "1.0" - }, - "0.8-2": { - "database": "2.0" - } - }, - "database": { - "1.0": { - "error": "1.0" - }, - "2.0": { - "error": "2.0" - } - }, - "lightdb": { - "1.0": [] - }, - "router": { - "1.0": [] - } - }, - "enabled": { - "orm": "0.8", - "database": "1.0", - "error": "1.0" - } -} + "available": { + "error": { + "1.0": [], + "2.0": [] + }, + "api": { + "1.0": { + "error": "1.0" + }, + "2.0": { + "error": "2.0" + } + }, + "orm": { + "0.8.1": { + "database": "1.0" + }, + "0.8.2": { + "database": "2.0" + } + }, + "database": { + "1.0": { + "error": "1.0" + }, + "2.0": { + "error": "2.0" + } + }, + "lightdb": { + "1.0": [] + }, + "router": { + "1.0": [] + } + }, + "enabled": { + "api": "2.0", + "error": "2.0", + "database": "2.0" + } +} \ No newline at end of file diff --git a/src/modules/orm/0.8-1/core/Rows.php b/src/modules/orm/0.8.1/core/Rows.php similarity index 100% rename from src/modules/orm/0.8-1/core/Rows.php rename to src/modules/orm/0.8.1/core/Rows.php diff --git a/src/modules/orm/0.8-1/core/SQLBuilder.php b/src/modules/orm/0.8.1/core/SQLBuilder.php similarity index 100% rename from src/modules/orm/0.8-1/core/SQLBuilder.php rename to src/modules/orm/0.8.1/core/SQLBuilder.php diff --git a/src/modules/orm/0.8-1/core/Table.php b/src/modules/orm/0.8.1/core/Table.php similarity index 100% rename from src/modules/orm/0.8-1/core/Table.php rename to src/modules/orm/0.8.1/core/Table.php diff --git a/src/modules/orm/0.8-2/core/Rows.php b/src/modules/orm/0.8.2/core/Rows.php similarity index 100% rename from src/modules/orm/0.8-2/core/Rows.php rename to src/modules/orm/0.8.2/core/Rows.php diff --git a/src/modules/orm/0.8-2/core/SQLBuilder.php b/src/modules/orm/0.8.2/core/SQLBuilder.php similarity index 100% rename from src/modules/orm/0.8-2/core/SQLBuilder.php rename to src/modules/orm/0.8.2/core/SQLBuilder.php diff --git a/src/modules/orm/0.8-2/core/Table.php b/src/modules/orm/0.8.2/core/Table.php similarity index 100% rename from src/modules/orm/0.8-2/core/Table.php rename to src/modules/orm/0.8.2/core/Table.php