available(); foreach($modules as $module=>$versions){ foreach($versions as $version) echo " - $module-$version\n"; echo "\n"; } } break; /* (2) Enables a module and its version ---------------------------------------------------------*/ case 'enable': { if( $arglen < 2 || !preg_match("/^(.+)-([0-9\.]+)$/i", $arguments[1], $matches) ){ echo "You must specify @module-@version.\n"; return; } $err = $exporter->enable($matches[1], $matches[2]); /* (1) Managing state */ if( $err === true ) echo "success.\n"; else echo $err; } break; /* (3) Disabled a module ---------------------------------------------------------*/ case 'disable': { if( $arglen < 2 ){ echo "You must specify @module.\n"; return; } $err = $exporter->disable($arguments[1]); /* (1) Managing state */ if( $err === true ) echo "success.\n"; else echo $err; } break; } ?>