Extends
lithium\console\Command
List all the plugins and extensions available on the server.
Parameters
- string $type plugins|extensions
Returns
voidSource
public function find($type = 'plugins') {
$results = array();
foreach ($this->_settings['servers'] as $server => $enabled) {
if (!$enabled) { continue; }
$service = $this->_instance('service', array(
'host' => $server, 'port' => $this->port
));
$results[$server] = json_decode($service->get("lab/{$type}.json"));
if (empty($results[$server])) {
$this->out("No {$type} at {$server}");
continue;
}
foreach ((array) $results[$server] as $data) {
$name = isset($data->class) ? $data->class : $data->name;
$header = "{$server} > {$name}";
$out = array(
"{$data->summary}",
"Version: {$data->version}",
"Created: {$data->created}"
);
$this->header($header);
$this->out(array_filter($out));
}
}
}