コード例 #1
0
ファイル: plugin.php プロジェクト: joeymetal/v1
    if ($best == 'http' && (!empty($options['externals']) || !empty($options['checkout']))) {
        die("Cannot install using subversion because `svn' cannot be found in your PATH\n");
    } elseif ($best == 'export' && !empty($options['externals'])) {
        die("Cannot install using externals because this project is not under subversion.");
    } elseif ($best == 'export' && !empty($options['checkout'])) {
        die("Cannot install using checkout because this project is not under subversion.");
    }
    $plugins = Ak::toArray($options['parameters']);
    foreach ($plugins as $plugin) {
        $repository = null;
        $plugin_name = basename($plugin);
        if ($plugin_name != $plugin) {
            $repository = preg_replace('/\\/?' . $plugin_name . '$/', '', trim($plugin));
        }
        echo "\nInstalling {$plugin}\n";
        $PluginManager->installPlugin($plugin_name, $repository, $options);
    }
    echo "Done.\n";
    die;
}
/**
 * Remove plugins.
 */
if ($command == 'remove') {
    $options = get_console_options_for('Remove plugins.', array(CONSOLE_GETARGS_PARAMS => array('short' => 'p', 'desc' => "You can specify plugin names as given in 'plugin list' output or absolute URLs to a plugin repository.", 'max' => -1, 'min' => 1)));
    if (empty($options['parameters'])) {
        die("You must supply at least one plugin name or plugin URL to uninstall.\n");
    }
    $plugins = Ak::toArray($options['parameters']);
    foreach ($plugins as $plugin) {
        $plugin_name = basename($plugin);