echo "VERSION: \t" . $plg->getVersion() . "\n"; echo "STATUS: \t" . ($plg->isInstalled() ? 'Installed ' : 'Uninstalled ') . ($plg->isActive() ? 'Activated ' : 'Inactive ') . "\n"; if ($plg->updateAvailable()) { echo "*** There is a new version of this plugin *** \n"; } } } else { if ($command == 'update_all') { $ctrl->updateAll(); } else { $arg1 or die("Plugin is required \n{$usage}"); $plg = Plugins::instance()->findOne(array("conditions" => " name = '{$arg1}'")); $plg or die("ERROR: plugin {$arg1} not found\n"); switch ($command) { case 'update': $ctrl->update($plg->getId()); break; case 'install': $ctrl->install($plg->getId()); break; case 'activate': $plg->activate(); break; case 'deactivate': $plg->deactivate(); break; case 'uninstall': $ctrl->uninstall($plg->getId()); break; default: die("Invalid command \n{$usage}");