X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSphinxSearch%2FSphinxSearchPlugin.php;h=74744f18e63bd7439c1004b6f1499160d52c2fc3;hb=b53e1439969bfa2c0b551d8cc2fc8fe15652c62a;hp=7a27a4c0424895152df2a000ec07189a7edfa017;hpb=a42e128c1532c45fd930d98c985f9a8d98ff6868;p=quix0rs-gnu-social.git diff --git a/plugins/SphinxSearch/SphinxSearchPlugin.php b/plugins/SphinxSearch/SphinxSearchPlugin.php index 7a27a4c042..74744f18e6 100644 --- a/plugins/SphinxSearch/SphinxSearchPlugin.php +++ b/plugins/SphinxSearch/SphinxSearchPlugin.php @@ -41,8 +41,6 @@ foreach($sphinxDefaults as $key => $val) { } } - - /** * Plugin for Sphinx search backend. * @@ -53,7 +51,6 @@ foreach($sphinxDefaults as $key => $val) { * @link http://laconi.ca/ * @link http://twitter.com/ */ - class SphinxSearchPlugin extends Plugin { /** @@ -69,9 +66,9 @@ class SphinxSearchPlugin extends Plugin include_once INSTALLDIR . '/plugins/SphinxSearch/' . strtolower($cls) . '.php'; return false; - default: - return true; } + + return parent::onAutoload($cls); } /** @@ -86,7 +83,8 @@ class SphinxSearchPlugin extends Plugin { if (common_config('sphinx', 'enabled')) { if (!class_exists('SphinxClient')) { - throw new ServerException('Sphinx PHP extension must be installed.'); + // TRANS: Server exception. + throw new ServerException(_m('Sphinx PHP extension must be installed.')); } $engine = new SphinxSearch($target, $table); if ($engine->is_connected()) { @@ -97,4 +95,28 @@ class SphinxSearchPlugin extends Plugin // Sphinx disabled or disconnected return true; } + + /** + * Provide plugin version information. + * + * This data is used when showing the version page. + * + * @param array &$versions array of version data arrays; see EVENTS.txt + * + * @return boolean hook value + */ + function onPluginVersion(array &$versions) + { + $url = 'http://status.net/wiki/Plugin:SphinxSearch'; + + $versions[] = array('name' => 'SphinxSearch', + 'version' => GNUSOCIAL_VERSION, + 'author' => 'Brion Vibber', + 'homepage' => $url, + 'rawdescription' => + // TRANS: Plugin description. + _m('Plugin for Sphinx search backend.')); + + return true; + } }