summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElan Ruusamäe2010-07-28 08:23:51 (GMT)
committercvs2git2012-06-24 12:13:13 (GMT)
commita7a64786b0ff7b05f4ee054840da9f447a0a0dd3 (patch)
tree8ec7fb10afddcc0ff9995c7e4b5b3fc3f4491e64
parentccaa98be180797368a488fc9e1c6a7e3c98d8519 (diff)
downloadphorum-mod-sphinx_search-a7a64786b0ff7b05f4ee054840da9f447a0a0dd3.zip
phorum-mod-sphinx_search-a7a64786b0ff7b05f4ee054840da9f447a0a0dd3.tar.gz
Changed files: cleanup-junk.patch -> 1.2 crontab -> 1.3 defaultport.patch -> 1.2 doc-updates.patch -> 1.2 errors.patch -> 1.2 forum_id-filter.patch -> 1.3 index_names.patch -> 1.3 paths.patch -> 1.3 phorum-mod-sphinx_search.spec -> 1.14 sph_counter.sql -> 1.2 sphinx.conf -> 1.5 sphinx_api.patch -> 1.2
-rw-r--r--cleanup-junk.patch88
-rw-r--r--crontab11
-rw-r--r--defaultport.patch19
-rw-r--r--doc-updates.patch189
-rw-r--r--errors.patch44
-rw-r--r--forum_id-filter.patch52
-rw-r--r--index_names.patch36
-rw-r--r--paths.patch50
-rw-r--r--phorum-mod-sphinx_search.spec38
-rw-r--r--sph_counter.sql6
-rw-r--r--sphinx.conf191
-rw-r--r--sphinx_api.patch12
12 files changed, 6 insertions, 730 deletions
diff --git a/cleanup-junk.patch b/cleanup-junk.patch
deleted file mode 100644
index c0c7c75..0000000
--- a/cleanup-junk.patch
+++ /dev/null
@@ -1,88 +0,0 @@
---- phorum-mod-sphinx_search-1.0.0/settings.php~ 2010-06-15 00:45:08.000000000 +0300
-+++ phorum-mod-sphinx_search-1.0.0/settings.php 2010-06-15 00:52:05.066204106 +0300
-@@ -4,8 +4,7 @@
- require_once 'defaults.php';
-
- // save settings
-- if (count($_POST))
-- {
-+ if (count($_POST)) {
- $PHORUM["mod_sphinx_search"] = array(
- "hostname" => $_POST["hostname"],
- "port" => $_POST["port"]
-@@ -37,75 +36,4 @@
-
- $row = $frm->addrow("What is the hostname of the sphinx daemon? (e.g. 127.0.0.1)$warn", $frm->text_box("hostname", $PHORUM["mod_sphinx_search"]["hostname"], 30));
- $row = $frm->addrow("What is the port of the sphinx daemon? (e.g. 3312)$warn", $frm->text_box("port", $PHORUM["mod_sphinx_search"]["port"], 30));
--/*
-- $userspec = array(
-- "none" => "Disable hurdle",
-- "anonymous" => "Enable for anonymous users",
-- "all" => "Enable for all users"
-- );
--
-- $blockspec = array(
-- "blockerror" => "Fully block and show an error",
-- "unapprove" => "Accept, but make unapproved",
-- );
--
-- $row = $frm->addrow("What action has to be taken when blocking a message?", $frm->select_tag("blockaction", $blockspec, $PHORUM["mod_spamhurdles"]["blockaction"]));
--
-- $row = $frm->addrow("Block message forms that are submitted multiple times", $frm->select_tag("blockmultipost", $userspec, $PHORUM["mod_spamhurdles"]["blockmultipost"]));
-- $frm->addhelp($row, "Block multiple submits", "If this option is enabled, then a unique key will be generated for each new message. As soon as the message is posted, this key will be invalidated for posting. This effectively prevents people from going back in the browser and resubmitting a (slightly changed) message (flooding) as well as spammers who directly submit posting forms to Phorum's post.php, without fetching a fresh unique key first.<br/><br/><b>User impact:</b><br/>This does not affect the way in which people can use Phorum, so the recommended value for this option is \"Enable for all users\".");
--
-- $row = $frm->addrow("Block message forms that are submitted too quickly", $frm->select_tag("blockquickpost", $userspec, $PHORUM["mod_spamhurdles"]["blockquickpost"]));
-- $frm->addhelp($row, "Block quick message submits", "If this option is enabled, Phorum will check how much time there is between starting a new message and actually posting it. If a message is posted too quickly, then it's considered to come from a posting robot. To prevent users from accidentally posting the message too quickly themselves (For example by typing only \"yes\" in the body and hitting the submit button), the posting button is disabled as long as the server would block the message. On the button, a countdown is shown to display how many seconds the user has to wait before posting.<br/><br/><b>User impact:</b><br/>This option does work for all browsers, only for the posting button to be disabled, JavaScript support is required.");
--
-- $row = $frm->addrow("Check if an HTML commented form field is submitted", $frm->select_tag("commentfieldcheck", $userspec, $PHORUM["mod_spamhurdles"]["commentfieldcheck"]));
-- $frm->addhelp($row, "Comment form field check", "If this option is enabled, then an extra form field is added to the posting form. However, this form field is embedded within an HTML comment block. Because of that, normal web browsers will fully ignore this extra field. On the other hand, some badly written spam bots will recognize the code as a form field. If such a spam bot posts a message including this extra form field, the message will be blocked.<br/><br/><b>User impact:</b><br/>This does not affect the way in which people can use Phorum, so the recommended value for this option is \"Enable for all users\".");
--
-- $row = $frm->addrow("Let the browser sign the message using JavaScript", $frm->select_tag("jsmd5check", $userspec, $PHORUM["mod_spamhurdles"]["jsmd5check"]));
-- $frm->addhelp($row, "Let the browser sign the message", "If this option is enabled, then the browser will retrieve two pieces of data from the server. The browser will have to create a signature for this data (using MD5) and does so by running some JavaScript. The signing JavaScript code is put in the message editor in a scrambled way (using iScramble) and the browser will have to descramble it using JavaScript to be able to run the signing code.<br/><br/>Functionally, this is all done to force the use of JavaScript when posting a message. This can block those spambots that do not interpret JavaScript, but only try to post the unmodified form information that is found on the message posting page.<br/><br/><b>User impact:</b><br/>This option requires JavaScript support in the browser. If a user does not have JavaScript (enabled), then posting is not possible.");
--
-- $frm->addbreak("Interactive CAPTCHA");
--
-- $row = $frm->addrow("Let visitors solve a CAPTCHA when registering a new account?", $frm->checkbox("register_captcha", 1, "Yes", $PHORUM["mod_spamhurdles"]["register_captcha"]));
-- $frm->addhelp($row, "Registering CAPTCHA", "If this option is enabled, a CAPTCHA (Completely Automated Public Turing-test to tell Computers and Humans Apart) will be used when visitors are registering a new user account. A check is added to the registering process, where the user has to prove that he/she is a human, by solving a simple puzzle. Below you can specify which type of CAPTCHA to use for this.<br/><br/><b>User impact:</b><br/>The user will have to solve the CAPTCHA before a new account can be registered. So this will require an extra action by the user. The exact user impact depends on the type of CAPTCHA that is used.");
--
-- $row = $frm->addrow("Let visitors solve a CAPTCHA when posting a new message", $frm->select_tag("posting_captcha", $userspec, $PHORUM["mod_spamhurdles"]["posting_captcha"]));
-- $frm->addhelp($row, "Posting CAPTCHA", "If this option is enabled, a CAPTCHA (Completely Automated Public Turing-test to tell Computers and Humans Apart) will be used when posting a new message. A check is added to the posting process, where the user has to prove that he/she is a human, by solving a simple puzzle. Below you can specify which type of CAPTCHA to use for this.<br/><br/><b>User impact:</b><br/>The user will have to solve the CAPTCHA before a message can be posted. So this will require an extra action by the user. The exact user impact depends on the type of CAPTCHA that is used.");
--
-- $captchaspec = array(
-- 'javascript' => 'Code, drawn using JavaScript',
-- 'image' => 'Code, drawn using a GIF image',
-- 'asciiart' => 'Code, drawn using ASCII art',
-- 'plaintext' => 'Code, plain text format',
-- 'maptcha' => 'Solve a simple math question',
-- 'recaptcha' => 'Code, using the reCAPTCHA service',
--# 'quiz' => 'Solve a quiz question',
-- );
-- $row = $frm->addrow("Which type of CAPTCHA?", $frm->select_tag("captcha_type", $captchaspec, $PHORUM["mod_spamhurdles"]["captcha_type"], "id=\"captcha_select\" onchange=\"handle_captcha_select()\""));
-- $frm->addhelp($row, "Type of CAPTCHA", "This module supports a wide range of CAPTCHA types. See the README that was bundled with this module for detailed information on these types and for deciding which one you want to use for your site.");
--
-- $row = $frm->addrow("Enable spoken CAPTCHA? You will need the program \"Flite\" for this.", $frm->checkbox("spoken_captcha", 1, "Yes", $PHORUM["mod_spamhurdles"]["spoken_captcha"]));
-- $frm->addhelp($row, "Enable spoken CAPTCHA", 'Vision impaired people can have trouble reading and thus solving a CAPTCHA. For those people, you can supply a spoken CAPTCHA code. To be able to use this option, the program "Flite" (Festival-Lite) has to be installed on the webserver. For information on this, see http://www.speech.cs.cmu.edu/flite/');
-- $warn = '';
-- if (!empty($PHORUM["mod_spamhurdles"]["flite_location"]) &&
-- !file_exists($PHORUM["mod_spamhurdles"]["flite_location"])) {
-- $warn = '<div style="color:red">The flite program does not exist at the specified location</div>';
-- }
-- $row = $frm->addrow("What is full path of the \"flite\" executable? (e.g. /usr/bin/flite)$warn", $frm->text_box("flite_location", $PHORUM["mod_spamhurdles"]["flite_location"], 30));
--
-- $frm->addmessage(
-- "<div id=\"settings_recaptcha\" class=\"input-form-td\"
-- style=\"margin:0; padding:10px; border: 1px solid navy\">
-- For using reCAPTCHA, you need a (free) public and private key.
-- Please signup at <a href=\"http://recaptcha.net\" target=\"_new\">the
-- reCAPTCHA</a> web site and enter the public and private key for your
-- web site's domain in the fields below.<br/><br/>
-- <table><tr><td>public key</td><td>" . $frm->text_box("recaptcha_pubkey", $PHORUM["mod_spamhurdles"]["recaptcha_pubkey"], 40) . "</td></tr>" .
-- "<tr><td>private key</td><td>" . $frm->text_box("recaptcha_prvkey", $PHORUM["mod_spamhurdles"]["recaptcha_prvkey"], 40) . "</td></tr></table>
-- </div>"
-- );
--*/
- $frm->show();
--?>
--
--
--
diff --git a/crontab b/crontab
deleted file mode 100644
index 5a1cbe6..0000000
--- a/crontab
+++ /dev/null
@@ -1,11 +0,0 @@
-MAILTO=root
-
-# Run nightly. Be sure that they do not run at same time.
-12 03 * * * sphinx indexer --config /etc/sphinx/sphinx.conf --rotate --quiet phorum5_msg
-22 03 * * * sphinx indexer --config /etc/sphinx/sphinx.conf --rotate --quiet phorum5_author
-
-# Run after every 10 minutes
-*/10 * * * * sphinx indexer --config /etc/sphinx/sphinx.conf --rotate --quiet phorum5_msg_d
-*/10 * * * * sphinx indexer --config /etc/sphinx/sphinx.conf --rotate --quiet phorum5_author_d
-
-# vim:ts=3:sw=3:et
diff --git a/defaultport.patch b/defaultport.patch
deleted file mode 100644
index 398be79..0000000
--- a/defaultport.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- phorum-mod-sphinx_search-1.0.0/settings.php~ 2010-06-15 07:21:50.000000000 +0300
-+++ phorum-mod-sphinx_search-1.0.0/settings.php 2010-06-15 12:28:58.068470638 +0300
-@@ -35,5 +35,5 @@
- $frm->addbreak("Hostname and port");
-
- $row = $frm->addrow("What is the hostname of the sphinx daemon? (e.g. 127.0.0.1)$warn", $frm->text_box("hostname", $PHORUM["mod_sphinx_search"]["hostname"], 30));
-- $row = $frm->addrow("What is the port of the sphinx daemon? (e.g. 3312)$warn", $frm->text_box("port", $PHORUM["mod_sphinx_search"]["port"], 30));
-+ $row = $frm->addrow("What is the port of the sphinx daemon? (e.g. 9312)$warn", $frm->text_box("port", $PHORUM["mod_sphinx_search"]["port"], 30));
- $frm->show();
---- phorum-mod-sphinx_search-1.0.0/defaults.php~ 2010-06-15 07:21:50.000000000 +0300
-+++ phorum-mod-sphinx_search-1.0.0/defaults.php 2010-06-15 12:29:20.795338455 +0300
-@@ -8,6 +8,4 @@
- $GLOBALS["PHORUM"]["mod_sphinx_search"]["hostname"] = "127.0.0.1";
-
- if (! isset($GLOBALS["PHORUM"]["mod_sphinx_search"]["port"]))
-- $GLOBALS["PHORUM"]["mod_sphinx_search"]["port"] = 3312;
--
--?>
-+ $GLOBALS["PHORUM"]["mod_sphinx_search"]["port"] = 9312;
diff --git a/doc-updates.patch b/doc-updates.patch
deleted file mode 100644
index 9fe85ab..0000000
--- a/doc-updates.patch
+++ /dev/null
@@ -1,189 +0,0 @@
---- phorum-mod-sphinx_search-1.0.0/README~ 2010-06-15 00:52:59.000000000 +0300
-+++ phorum-mod-sphinx_search-1.0.0/README 2010-06-15 07:17:23.730339149 +0300
-@@ -1,6 +1,6 @@
- Module : Sphinx Search
- Version : 1.0.0
--Author : Thomas Seiffert, updated by Martijn van Maasakkers <martijn@vanmaasakkers.net>
-+Author : Thomas Seiffert, updated by Martijn van Maasakkers <martijn@vanmaasakkers.net>, Elan Ruusamäe <glen@delfi.ee>
-
- Module for using sphinx as fulltext search-engine instead of phorum built-in search
- sphinx can be downloaded and installed from http://sphinxsearch.com/
-@@ -16,15 +16,19 @@
- - data is stored in both phorum_search-table (not needed here) and in the
- sphinx filesystem - this doubles the sizes needed for search even though
- the search-table is not needed. You can clear it out every now and then.
-+ you may disable filling phorum_search table by setting
-+ $PHORUM['DBCONFIG']['empty_search_table'] to true in db config.
-+ but then you need to rebuild search data if you want to go back to mysql
-+ fulltext search. you can rebuild search data using admin panel.
- - search-data is not updated in real-time - sphinx reindexes the data if the indexer
- is called for the index, which does a full reindexing of the sphinx index.
- There is a workaround available in sphinx http://sphinxsearch.com/doc.html#live-updates
- which works essentially with two indexes. A large one and smaller one with only the deltas
-- to the full index and which can be reindexed therefore more often, but I don't use that method yet.
-+ to the full index and which can be reindexed therefore more often.
- Still, its not realtime.
- For me the full indexing of 350,000 messages took around 5 minutes.
- I'd run the full indexing around once a day with those times.
--
-+ See crontab file for sample crontab setup, install it to /etc/cron.d/phorum-sphinx-search
-
- Before you can run a search through sphinx you will need to setup sphinx correctly and do at least one full
- indexing of your phorum-data.
-@@ -40,154 +44,6 @@
- ATTENTION:
-
- The delta indexes require MySQL-4.1 or higher because of the use of subqueries and they need a separate table
--for holding the last indexed ID, its structure is the following (install in phorum database):
--
--CREATE TABLE sph_counter (
-- counter_id int(11) unsigned NOT NULL default '0',
-- `type` enum('author','message') NOT NULL default 'message',
-- max_doc_id int(11) NOT NULL,
-- PRIMARY KEY (counter_id,`type`)
--) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
--
--
--Example (working) sphinx config. Make sure to AT LEAST change the database settings
---------------------------------------------------------------------------------------
--source phorum5_base
--{
-- # data source type
-- # for now, known types are 'mysql' and 'xmlpipe'
-- # MUST be defined
-- type = mysql
--
-- # whether to strip HTML
-- strip_html = 0
--
-- # what HTML attributes to index if stripping HTML
-- index_html_attrs =
--
-- #################################################################
--
-- # some straightforward parameters for 'mysql' source type
-- sql_host = localhost
-- sql_user = username
-- sql_pass = password
-- sql_db = database
-- sql_port = 3306 # optional, default is 3306
--
--
-- # optional, default is empty
-- sql_group_column = forum_id
-- sql_date_column = datestamp
--
--
--}
--
--index phorum5_base
--{
--
-- # morphology
-- # default is not to use any
-- morphology = none
--
-- # stopwords file
-- stopwords =
--
-- # minimum word length
-- min_word_len = 1
--
-- # charset encoding type
-- # known types are 'sbcs' (Single Byte CharSet) and 'utf-8'
-- charset_type = sbcs
--
-- path = /usr/local/sphinx/var/data/foo
--
--}
--
--source phorum5_msg : phorum5_base
--{
-- sql_query_pre = REPLACE INTO sph_counter SELECT 1, 'message', MAX(message_id) FROM phorum_messages WHERE status=2
-- sql_query = \
-- SELECT message_id, forum_id, datestamp, author, subject, body \
-- FROM phorum_messages \
-- WHERE message_id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'message' ) and status=2
--
--}
--source phorum5_msg_delta : phorum5_base
--{
--
-- # main document fetch query
-- # you can specify any number of fields
-- #
-- # mandatory
-- sql_query = \
-- SELECT message_id, forum_id, datestamp, author, subject, body \
-- FROM phorum_messages \
-- WHERE message_id>( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'message' ) and status=2
--
--}
--
--index phorum5_msg : phorum5_base
--{
-- # which document source to index
-- source = phorum5_msg
--
-- # this is path and index file name without extension
-- # files <indexpath>.spi/spd/spr will be created by indexer
-- path = /usr/local/sphinx/var/data/phorum5_msg
--
--}
--
--index phorum5_msg_d : phorum5_base
--{
-- # which document source to index
-- source = phorum5_msg_delta
--
-- # this is path and index file name without extension
-- # files <indexpath>.spi/spd/spr will be created by indexer
-- path = /usr/local/sphinx/var/data/phorum5_msg_d
--
--}
--
--source phorum5_author : phorum5_base
--{
-- sql_query_pre = REPLACE INTO sph_counter SELECT 1, 'author', MAX(message_id) FROM phorum_messages WHERE status=2
-- sql_query = \
-- SELECT message_id, forum_id, datestamp, author \
-- FROM p50_000001_messages \
-- WHERE message_id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'author' ) and status=2
--}
--
--source phorum5_author_d : phorum5_base
--{
--
-- # main document fetch query
-- # you can specify any number of fields
-- #
-- # mandatory
-- sql_query = \
-- SELECT message_id, forum_id, datestamp, author \
-- FROM phorum_messages \
-- WHERE message_id>( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'author' ) and status=2
--
--}
--
--index phorum5_author : phorum5_base
--{
-- source = phorum5_author
-- path = /usr/local/sphinx/var/data/phorum5_author
--}
--
--
--
--index phorum5_author_d : phorum5_base
--{
-- source = phorum5_author_d
-- path = /usr/local/sphinx/var/data/phorum5_author_d
--}
--
--
--
-----------------------------------------------------------------------------------------------
--
-+for holding the last indexed ID, its structure is the following (install in phorum database). see sph_counter.sql file.
-
-+For Sample (working) sphinx config see sphinx.conf. Make sure to AT LEAST change the database settings.
diff --git a/errors.patch b/errors.patch
deleted file mode 100644
index aad7680..0000000
--- a/errors.patch
+++ /dev/null
@@ -1,44 +0,0 @@
---- phorum-mod-sphinx_search-1.0.0/sphinx_search.php 2010-04-14 16:28:33.609384236 +0300
-+++ phorum-mod-sphinx_search-1.0.0/sphinx_search.php 2010-04-14 16:32:02.824588727 +0300
-@@ -84,6 +84,15 @@
-
- // do the actual query
- $results = $sphinx->Query($arrSearch['search'],$index);
-+
-+ $res = $sphinx->GetLastWarning();
-+ if ($res) {
-+ error_log("sphinx_search.php: WARNING: $res");
-+ }
-+ $res = $sphinx->GetLastError();
-+ if ($res) {
-+ error_log("sphinx_search.php: ERROR: $res");
-+ }
-
- // if no messages were found, then return empty handed.
- if (! isset($results["matches"])) {
-@@ -104,9 +113,6 @@
- krsort($found_messages);
- reset($found_messages);
-
--// print_r($found_messages);/
--
--
- // prepare the array for building highlighted excerpts
- $docs=array();
- foreach($found_messages as $id => $data) {
-@@ -123,7 +129,14 @@
- // build highlighted excerpts
- $highlighted = $sphinx->BuildExcerpts($docs,$excerpts_index,$words,$opts);
-
-- print $sphinx->GetLastError();
-+ $res = $sphinx->GetLastWarning();
-+ if ($res) {
-+ error_log("sphinx_search.php: WARNING: $res");
-+ }
-+ $res = $sphinx->GetLastError();
-+ if ($res) {
-+ error_log("sphinx_search.php: ERROR: $res");
-+ }
-
- $cnt=0;
- foreach($found_messages as $id => $content) {
diff --git a/forum_id-filter.patch b/forum_id-filter.patch
deleted file mode 100644
index 300ed08..0000000
--- a/forum_id-filter.patch
+++ /dev/null
@@ -1,52 +0,0 @@
---- phorum-mod-sphinx_search-1.0.0/sphinx_search.php~ 2010-07-14 21:59:39.326487097 +0300
-+++ phorum-mod-sphinx_search-1.0.0/sphinx_search.php 2010-07-14 21:59:08.536521000 +0300
-@@ -66,23 +66,33 @@
-
- }
-
-- // add the forum(s) to search
-- if($arrSearch['match_forum'] == 'THISONE') {
-- $forumid_clean = (int)$PHORUM['forum_id'];
-- $sphinx->SetFilter ( "forum_id", array($forumid_clean) );
--
-- } else {
--
-- // have to check what forums they can read first.
-- // $allowed_forums=phorum_user_access_list(PHORUM_USER_ALLOW_READ);
--// $allowed_forums=phorum_user_access_list(PHORUM_USER_ALLOW_READ);
-- $allowed_forums = phorum_api_user_check_access(PHORUM_USER_ALLOW_READ, PHORUM_ACCESS_LIST);
--
-- // if they are not allowed to search any forums, return the emtpy $arr;
-- if(empty($allowed_forums) || ($PHORUM['forum_id']>0 && !in_array($PHORUM['forum_id'], $allowed_forums)) ) return $arr;
-+ // Check what forums the active Phorum user can read.
-+ $allowed_forums = phorum_api_user_check_access(
-+ PHORUM_USER_ALLOW_READ, PHORUM_ACCESS_LIST
-+ );
-+
-+ // If the user is not allowed to search any forum or the current
-+ // active forum, then return the emtpy search results array.
-+ if (empty($allowed_forums) || ($PHORUM['forum_id']>0 && !in_array($PHORUM['forum_id'], $allowed_forums))) {
-+ $arrSearch['results'] = array();
-+ $arrSearch['totals'] = 0;
-+ $arrSearch['continue'] = 0;
-+ $arrSearch['raw_body'] = 1;
-+ return $arrSearch;
-+ }
-
-- $sphinx->SetFilter ( "forum_id", $allowed_forums );
-- }
-+ // Prepare forum_id restriction.
-+ $search_forums = array();
-+ foreach (explode(',', $arrSearch['match_forum']) as $forum_id) {
-+ if ($forum_id == 'ALL') {
-+ $search_forums = $allowed_forums;
-+ break;
-+ }
-+ if (isset($allowed_forums[$forum_id])) {
-+ $search_forums[] = $forum_id;
-+ }
-+ }
-+ $sphinx->SetFilter("forum_id", $search_forums);
-
- // set the sort-mode
- $sphinx->SetSortMode(SPH_SORT_ATTR_DESC,"datestamp");
diff --git a/index_names.patch b/index_names.patch
deleted file mode 100644
index fe9c4ec..0000000
--- a/index_names.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- sphinx_search/sphinx_search.php~ 2010-04-14 16:39:47.000000000 +0300
-+++ sphinx_search/sphinx_search.php 2010-06-15 00:35:42.346275766 +0300
-@@ -26,7 +26,7 @@
- // these are the index-names set in sphinx.conf - one for searching messages, the other for searching by authors only
- // both contain an additional index for the deltas - changes done after the last full reindex
- $index_name_msg = "phorum5_msg_d phorum5_msg";
-- $index_name_author = "phorum5_author phorum5_author_delta";
-+ $index_name_author = "phorum5_author phorum5_author_d";
-
- // excerpts_index is just one index as that function only accepts one, it used for determining charsets / mapping tables, nothing more
- $excerpts_index = "phorum5_msg";
---- phorum-mod-sphinx_search-1.0.0/README~ 2010-06-15 00:43:33.000000000 +0300
-+++ phorum-mod-sphinx_search-1.0.0/README 2010-06-15 00:44:08.319793287 +0300
-@@ -158,7 +158,7 @@
- WHERE message_id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'author' ) and status=2
- }
-
--source phorum5_author_delta : phorum5_base
-+source phorum5_author_d : phorum5_base
- {
-
- # main document fetch query
-@@ -180,10 +180,10 @@
-
-
-
--index phorum5_author_delta : phorum5_base
-+index phorum5_author_d : phorum5_base
- {
-- source = phorum5_author_delta
-- path = /usr/local/sphinx/var/data/phorum5_author_delta
-+ source = phorum5_author_d
-+ path = /usr/local/sphinx/var/data/phorum5_author_d
- }
-
-
diff --git a/paths.patch b/paths.patch
deleted file mode 100644
index 97a662a..0000000
--- a/paths.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- phorum-mod-sphinx_search-1.0.0/settings.php~ 2010-03-30 17:45:42.000000000 +0300
-+++ phorum-mod-sphinx_search-1.0.0/settings.php 2010-03-30 17:49:15.659963871 +0300
-@@ -1,7 +1,7 @@
- <?php
- if (!defined("PHORUM_ADMIN")) return;
-
-- require_once("./mods/sphinx_search/defaults.php");
-+ require_once 'defaults.php';
-
- // save settings
- if (count($_POST))
-@@ -28,7 +28,7 @@
- <br style="clear:both" />
- <?php
-
-- include_once "./include/admin/PhorumInputForm.php";
-+ include_once PHORUM_INCLUDES_DIR.'/admin/PhorumInputForm.php';
- $frm = new PhorumInputForm ("", "post", "Save");
- $frm->hidden("module", "modsettings");
- $frm->hidden("mod", "sphinx_search");
---- phorum-mod-sphinx_search-1.0.0/sphinx_search.php~ 2010-06-15 00:37:12.000000000 +0300
-+++ phorum-mod-sphinx_search-1.0.0/sphinx_search.php 2010-06-15 00:38:37.226287129 +0300
-@@ -15,13 +15,17 @@
-
- if (!defined("PHORUM")) return;
-
--require_once("./mods/sphinx_search/defaults.php");
-+require_once 'defaults.php';
-
- function sphinx_search_action($arrSearch)
- {
- global $PHORUM;
-
-- include './mods/sphinx_search/sphinxclient.php';
-+ // No pecl class, try php version
-+ if (!class_exists('SphinxClient')) {
-+ // loads from php include_path
-+ require_once 'sphinxapi.php';
-+ }
-
- // these are the index-names set in sphinx.conf - one for searching messages, the other for searching by authors only
- // both contain an additional index for the deltas - changes done after the last full reindex
-@@ -147,6 +164,3 @@
-
- return $arrSearch;
- }
--
--
--?>
-\ No newline at end of file
diff --git a/phorum-mod-sphinx_search.spec b/phorum-mod-sphinx_search.spec
index f1b0c5d..f6be561 100644
--- a/phorum-mod-sphinx_search.spec
+++ b/phorum-mod-sphinx_search.spec
@@ -3,23 +3,12 @@
%define module sphinx_search
Summary: Sphinx Fulltext-Search Module
Name: phorum-mod-%{module}
-Version: 1.0.0
+Version: 1.1
Release: 1
License: Apache-like
Group: Applications/WWW
-Source0: http://www.phorum.org/phorum5/file.php/download/62/3354/sphinx_search_%{version}.tar.gz
-# Source0-md5: fd6bafce5d77c1baf90bf5f5e157bfb8
-Source1: sph_counter.sql
-Source2: sphinx.conf
-Source3: crontab
-Patch0: paths.patch
-Patch1: errors.patch
-Patch2: index_names.patch
-Patch3: cleanup-junk.patch
-Patch4: doc-updates.patch
-Patch5: defaultport.patch
-Patch6: sphinx_api.patch
-Patch7: forum_id-filter.patch
+Source0: http://download.github.com/glensc-phorum-%{module}-%{version}-0-g20786ed.tar.gz
+# Source0-md5: 74498f460023d41c1d44ac6fca6518d5
URL: http://www.phorum.org/phorum5/read.php?62,136982,138325
BuildRequires: rpm-php-pearprov
BuildRequires: rpmbuild(macros) >= 1.553
@@ -48,25 +37,10 @@ built-in search.
%prep
%setup -qc
-mv %{module}/* .
-cp -a %{SOURCE1} .
-cp -a %{SOURCE2} .
-cp -a %{SOURCE3} .
-%undos *.php *.txt README Changelog
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
+mv *-%{module}-*/* .
-# php-sphinx
-rm sphinxclient.php
-
-# cleanup backups after patching
-find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+# php-sphinx (native) or php-pecl-sphinx (extension)
+rm sphinxapi.php
%install
rm -rf $RPM_BUILD_ROOT
diff --git a/sph_counter.sql b/sph_counter.sql
deleted file mode 100644
index 1a206e3..0000000
--- a/sph_counter.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-CREATE TABLE `sph_counter` (
- `counter_id` int(11) unsigned NOT NULL default '0',
- `type` enum('author','message') NOT NULL default 'message',
- `max_doc_id` int(11) NOT NULL,
- PRIMARY KEY (`counter_id`,`type`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
diff --git a/sphinx.conf b/sphinx.conf
deleted file mode 100644
index 0271625..0000000
--- a/sphinx.conf
+++ /dev/null
@@ -1,191 +0,0 @@
-#
-# Sphinx configuration for Phorum 5
-#
-
-#############################################################################
-## phony source. common defaults for other sources
-#############################################################################
-source phorum5_base
-{
- type = mysql
-
- sql_host = localhost
- sql_user = mysql
- sql_pass =
- sql_db = phorum5
- sql_port = 3306
-
- # optional, default is empty
- sql_attr_uint = forum_id
- sql_attr_timestamp = datestamp
-
- # document info query, ONLY for CLI search (ie. testing and debugging)
- # optional, default is empty
- # must contain $id macro and must fetch the document by that id
- # integer document ID field MUST be the first selected column
- sql_query_info = SELECT message_id, forum_id, datestamp, author, subject, body FROM phorum_messages WHERE message_id=$id
-}
-
-#############################################################################
-## phony index. common defaults for other indexes
-#############################################################################
-index phorum5_base
-{
- source = phorum5_base
-
- # document attribute values (docinfo) storage mode
- # optional, default is 'extern'
- # known values are 'none', 'extern' and 'inline'
- docinfo = extern
-
- # minimum indexed word length
- # default is 1 (index everything)
- min_word_len = 3
-
- # charset encoding type
- # optional, default is 'sbcs'
- # known types are 'sbcs' (Single Byte CharSet) and 'utf-8'
- charset_type = utf-8
-}
-
-# messages
-source phorum5_msg : phorum5_base
-{
- sql_query_pre = SET NAMES utf8
- sql_query_pre = REPLACE INTO sph_counter SELECT 1, 'message', MAX(message_id) FROM phorum_messages WHERE status=2
-
- sql_query = \
- SELECT message_id, forum_id, datestamp, author, subject, body \
- FROM phorum_messages \
- WHERE \
- message_id <= (SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'message') and status=2
-}
-
-source phorum5_msg_d : phorum5_base
-{
- sql_query_pre = SET NAMES utf8
- sql_query = \
- SELECT message_id, forum_id, datestamp, author, subject, body \
- FROM phorum_messages \
- WHERE \
- message_id > (SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'message') and status=2
-}
-
-# authors
-source phorum5_author : phorum5_base
-{
- sql_query_pre = SET NAMES utf8
- sql_query_pre = REPLACE INTO sph_counter SELECT 1, 'author', MAX(message_id) FROM phorum_messages WHERE status=2
- sql_query = \
- SELECT message_id, forum_id, datestamp, author \
- FROM phorum_messages \
- WHERE \
- message_id <= (SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'author') and status=2
-}
-
-source phorum5_author_d : phorum5_base
-{
- sql_query_pre = SET NAMES utf8
- sql_query = \
- SELECT message_id, forum_id, datestamp, author \
- FROM phorum_messages \
- WHERE \
- message_id > (SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'author') and status=2
-}
-
-# messages
-index phorum5_msg : phorum5_base
-{
- source = phorum5_msg
- path = /var/lib/sphinx/phorum5_msg
-}
-
-index phorum5_msg_d : phorum5_base
-{
- source = phorum5_msg_d
- path = /var/lib/sphinx/phorum5_msg_d
-}
-
-# author
-index phorum5_author : phorum5_base
-{
- source = phorum5_author
- path = /var/lib/sphinx/phorum5_author
-}
-
-index phorum5_author_d : phorum5_base
-{
- source = phorum5_author_d
- path = /var/lib/sphinx/phorum5_author_d
-}
-
-#############################################################################
-## indexer settings
-#############################################################################
-indexer
-{
- # memory limit, in bytes, kiloytes (16384K) or megabytes (256M)
- # optional, default is 32M, max is 2047M, recommended is 256M to 1024M
- mem_limit = 128M
-
- # maximum IO calls per second (for I/O throttling)
- # optional, default is 0 (unlimited)
- #
- # max_iops = 40
-
- # maximum IO call size, bytes (for I/O throttling)
- # optional, default is 0 (unlimited)
- #
- # max_iosize = 1048576
-}
-
-#############################################################################
-## searchd settings
-#############################################################################
-
-searchd
-{
- # hostname, port, or hostname:port, or /unix/socket/path to listen on
- # multi-value, multiple listen points are allowed
- # optional, default is 0.0.0.0:9312 (listen on all interfaces, port 9312)
- listen = 127.0.0.1:9312
-
- # log file, searchd run info is logged here
- # optional, default is 'searchd.log'
- log = /var/log/sphinx/searchd.log
-
- # query log file, all search queries are logged here
- # optional, default is empty (do not log queries)
- query_log = /var/log/sphinx/query.log
-
- # client read timeout, seconds
- # optional, default is 5
- read_timeout = 5
-
- # maximum amount of children to fork (concurrent searches to run)
- # optional, default is 0 (unlimited)
- max_children = 30
-
- # PID file, searchd process ID file name
- # mandatory
- pid_file = /var/run/sphinx/searchd.pid
-
- # max amount of matches the daemon ever keeps in RAM, per-index
- # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL
- # default is 1000 (just like Google)