예제 #1
0
파일: plugin.php 프로젝트: joeymetal/v1
                }
            }
            foreach ($repsositories as $repsository => $plugins) {
                echo "Plugins available at {$repository}:\n";
                echo join(", ", $plugins) . "\n\n";
            }
        }
    }
    die;
}
/**
 * List configured plugin repositories.
 */
if ($command == 'sources') {
    $options = get_console_options_for('List configured plugin repositories.', array('check' => array('short' => 'c', 'desc' => "Report status of repository.", 'max' => 0)));
    $repositories = $PluginManager->getAvailableRepositories(true);
    foreach ($repositories as $repository) {
        $checked = isset($options['check']) && !Ak::url_get_contents($repository, array('timeout' => 5)) ? ' [Connection timeout].' : '';
        echo " * {$repository}{$checked}\n";
    }
    die;
}
/**
 * Adds a repository to the default search list.
 */
if ($command == 'source') {
    array_shift($argv);
    $options = Ak::toArray($argv);
    if (empty($options)) {
        die("You need to provide at least one repository to add to the default search list.\n");
    }