summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSiebrand Mazeland <s.mazeland@xs4all.nl>2010-10-04 00:02:24 +0200
committerSiebrand Mazeland <s.mazeland@xs4all.nl>2010-10-04 00:02:24 +0200
commit1652ded48c9c62c40157a5142e5231adbc574ddb (patch)
tree15796c59bd411160154f2ae85e4acd44a34da047 /plugins
parent362f395e035682cd8d2437cfca904654687be867 (diff)
i18n/L10n review, extension credits added.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/SphinxSearch/SphinxSearchPlugin.php30
-rwxr-xr-xplugins/SphinxSearch/scripts/gen_config.php2
-rwxr-xr-xplugins/SphinxSearch/scripts/index_update.php8
-rw-r--r--plugins/SphinxSearch/scripts/sphinx-utils.php1
-rw-r--r--plugins/SphinxSearch/sphinxsearch.php4
5 files changed, 33 insertions, 12 deletions
diff --git a/plugins/SphinxSearch/SphinxSearchPlugin.php b/plugins/SphinxSearch/SphinxSearchPlugin.php
index 7a27a4c04..ad34a7cc1 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
{
/**
@@ -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(&$versions)
+ {
+ $url = 'http://status.net/wiki/Plugin:SphinxSearch';
+
+ $versions[] = array('name' => 'SphinxSearch',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Brion Vibber',
+ 'homepage' => $url,
+ 'rawdescription' =>
+ // TRANS: Plugin description.
+ _m('Plugin for Sphinx search backend.'));
+
+ return true;
+ }
}
diff --git a/plugins/SphinxSearch/scripts/gen_config.php b/plugins/SphinxSearch/scripts/gen_config.php
index d5a00b6b6..e7f397747 100755
--- a/plugins/SphinxSearch/scripts/gen_config.php
+++ b/plugins/SphinxSearch/scripts/gen_config.php
@@ -70,8 +70,6 @@ searchd
END;
-
-
/**
* Build config entries for a single site
* @fixme we only seem to have master DB currently available...
diff --git a/plugins/SphinxSearch/scripts/index_update.php b/plugins/SphinxSearch/scripts/index_update.php
index 23c60ced7..abac5434f 100755
--- a/plugins/SphinxSearch/scripts/index_update.php
+++ b/plugins/SphinxSearch/scripts/index_update.php
@@ -42,20 +42,20 @@ sphinx_iterate_sites('sphinx_index_update');
function sphinx_index_update($sn)
{
$base = sphinx_base();
-
+
$baseIndexes = array('notice', 'profile');
$params = array();
-
+
if (have_option('rotate')) {
$params[] = '--rotate';
}
foreach ($baseIndexes as $index) {
$params[] = "{$sn->dbname}_{$index}";
}
-
+
$params = implode(' ', $params);
$cmd = "$base/bin/indexer --config $base/etc/sphinx.conf $params";
-
+
print "$cmd\n";
system($cmd);
}
diff --git a/plugins/SphinxSearch/scripts/sphinx-utils.php b/plugins/SphinxSearch/scripts/sphinx-utils.php
index 7bbc25270..22d70fb8d 100644
--- a/plugins/SphinxSearch/scripts/sphinx-utils.php
+++ b/plugins/SphinxSearch/scripts/sphinx-utils.php
@@ -60,4 +60,3 @@ function sphinx_iterate_sites($callback)
}
}
}
-
diff --git a/plugins/SphinxSearch/sphinxsearch.php b/plugins/SphinxSearch/sphinxsearch.php
index 654b9c9d5..1ce9bfd72 100644
--- a/plugins/SphinxSearch/sphinxsearch.php
+++ b/plugins/SphinxSearch/sphinxsearch.php
@@ -91,6 +91,8 @@ class SphinxSearch extends SearchEngine
if (preg_match('!^.*?://.*?:.*?@.*?/(.*?)$!', common_config('db', 'database'), $matches)) {
return $matches[1];
}
- throw new ServerException("Sphinx search could not identify database name");
+
+ // TRANS: Server exception thrown when a database name cannot be identified.
+ throw new ServerException(_m("Sphinx search could not identify database name."));
}
}