Bugfix leger + gestion commande `init` pour effacer les modules installés

This commit is contained in:
xdrm-brackets 2016-12-05 14:49:51 +01:00
parent 558ea6b55b
commit 425363334c
9 changed files with 63 additions and 43 deletions

View File

@ -25,6 +25,16 @@
/* REMOVES ENABLED MODULES
*
*/
public function init(){
$this->modules['enabled'] = [];
$this->store();
return true;
}
/* RETURNS AVAILABLE MODULE LIST /* RETURNS AVAILABLE MODULE LIST
* *
* @return modules<Array> Set containing modules and their versions * @return modules<Array> Set containing modules and their versions
@ -38,7 +48,7 @@
foreach($versions as $version=>$dependencies) foreach($versions as $version=>$dependencies)
// if version of module enabled // 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 ]; $modules[$module][] = [ 'version' => $version, 'enabled' => true ];
else else
$modules[$module][] = [ 'version' => $version, 'enabled' => false ]; $modules[$module][] = [ 'version' => $version, 'enabled' => false ];

View File

@ -22,6 +22,16 @@
=========================================================*/ =========================================================*/
switch($arguments[0]){ switch($arguments[0]){
/* (0) Reset enabled modules
---------------------------------------------------------*/
case 'init': {
$exporter->init();
echo "** success **\n";
} break;
/* (1) Modules listing /* (1) Modules listing
---------------------------------------------------------*/ ---------------------------------------------------------*/
case 'modules': { case 'modules': {

View File

@ -13,10 +13,10 @@
} }
}, },
"orm": { "orm": {
"0.8-1": { "0.8.1": {
"database": "1.0" "database": "1.0"
}, },
"0.8-2": { "0.8.2": {
"database": "2.0" "database": "2.0"
} }
}, },
@ -36,8 +36,8 @@
} }
}, },
"enabled": { "enabled": {
"orm": "0.8", "api": "2.0",
"database": "1.0", "error": "2.0",
"error": "1.0" "database": "2.0"
} }
} }