Skip to content

Commit

Permalink
It does not really require a separate method to get the SQL
Browse files Browse the repository at this point in the history
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
  • Loading branch information
madhuracj committed Dec 16, 2015
1 parent 3d1a52c commit 25c7812
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions libraries/controllers/server/ServerPluginsController.php
Expand Up @@ -41,27 +41,23 @@ public function indexAction()
$this->response->addHTML($this->_getPluginTab($plugins));
}

/**
* Returns the common SQL used to retrieve plugin data
*
* @return string SQL
*/
private function _getServerPluginSQL()
{
return "SELECT plugin_name, plugin_type, (plugin_status = 'ACTIVE') AS is_active,
plugin_type_version, plugin_author, plugin_description, plugin_license
FROM information_schema.plugins
ORDER BY plugin_type, plugin_name";
}

/**
* Returns details about server plugins
*
* @return array server plugins data
*/
private function _getServerPlugins()
{
$sql = $this->_getServerPluginSQL();
$sql = "SELECT plugin_name,
plugin_type,
(plugin_status = 'ACTIVE') AS is_active,
plugin_type_version,
plugin_author,
plugin_description,
plugin_license
FROM information_schema.plugins
ORDER BY plugin_type, plugin_name";

$res = $this->dbi->query($sql);
$plugins = array();
while ($row = $this->dbi->fetchAssoc($res)) {
Expand Down

0 comments on commit 25c7812

Please sign in to comment.