}
}
-
-
/**
* Plugin for Sphinx search backend.
*
* @link http://laconi.ca/
* @link http://twitter.com/
*/
-
class SphinxSearchPlugin extends Plugin
{
/**
include_once INSTALLDIR . '/plugins/SphinxSearch/' .
strtolower($cls) . '.php';
return false;
- default:
- return true;
}
+
+ return parent::onAutoload($cls);
}
/**
{
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()) {
// 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;
+ }
}