From bed530cc88457273561ab4410c67dc185b53922a Mon Sep 17 00:00:00 2001 From: mistic100 Date: Wed, 5 Feb 2014 20:15:05 +0000 Subject: PluginMaintain is not abstract anymore, allowing partial declaration git-svn-id: http://piwigo.org/svn/trunk@27221 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_plugins.inc.php | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/include/functions_plugins.inc.php b/include/functions_plugins.inc.php index d3825a047..b1f4645d0 100644 --- a/include/functions_plugins.inc.php +++ b/include/functions_plugins.inc.php @@ -35,7 +35,7 @@ define('EVENT_HANDLER_PRIORITY_NEUTRAL', 50); /** * Used to declare maintenance methods of a plugin. */ -abstract class PluginMaintain +class PluginMaintain { /** @var string $plugin_id */ protected $plugin_id; @@ -52,17 +52,17 @@ abstract class PluginMaintain * @param string $plugin_version * @param array &$errors - used to return error messages */ - abstract function install($plugin_version, &$errors=array()); + function install($plugin_version, &$errors=array()) {} /** * @param string $plugin_version * @param array &$errors - used to return error messages */ - abstract function activate($plugin_version, &$errors=array()); + function activate($plugin_version, &$errors=array()) {} - abstract function deactivate(); + function deactivate() {} - abstract function uninstall(); + function uninstall() {} /** * Tests if the plugin needs to be updated and call an update function @@ -104,7 +104,7 @@ UPDATE '. PLUGINS_TABLE .' /** * Used to declare maintenance methods of a theme. */ -abstract class ThemeMaintain +class ThemeMaintain { /** @var string $theme_id */ protected $theme_id; @@ -121,11 +121,11 @@ abstract class ThemeMaintain * @param string $theme_version * @param array &$errors - used to return error messages */ - abstract function activate($theme_version, &$errors=array()); + function activate($theme_version, &$errors=array()) {} - abstract function deactivate(); + function deactivate() {} - abstract function delete(); + function delete() {} /** * Tests if the theme needs to be updated and call an update function @@ -398,17 +398,11 @@ SELECT * FROM '.PLUGINS_TABLE; } if (count($clauses)) { - $query .= ' + $query .= ' WHERE '. implode(' AND ', $clauses); } - - $result = pwg_query($query); - $plugins = array(); - while ($row = pwg_db_fetch_assoc($result)) - { - $plugins[] = $row; - } - return $plugins; + + return query2array($query); } /** -- cgit v1.2.3