Exemple #1
0
 */
require_once dirname(__FILE__) . '/../../includes/core/init.php';
$self = array_shift($argv);
$action = array_shift($argv);
$target = array_shift($argv);
if (!in_array($action, array('install', 'update', 'uninstall'))) {
    die('Unknown action "' . $action . '", see "help"' . "\n");
}
if ($action == 'help') {
    echo 'Usage : ' . $self . ' <action> <target>' . "\n";
    echo "\n";
    echo "\t" . 'action must be "install", "update" or "uninstall"' . "\n";
    echo "\t" . 'target is the name of th plugin to act upon' . "\n";
    exit(0);
}
try {
    switch ($action) {
        case 'install':
            PluginManager::installPlugin($target);
            break;
        case 'update':
            PluginManager::updatePlugin($target);
            break;
        case 'uninstall':
            PluginManager::uninstallPlugin($target);
            break;
    }
} catch (Exception $e) {
    die('Exception : ' . $e->getMessage() . "\n");
}
exit(0);