diff --git a/bin/arc_tool.php b/bin/arc_tool.php index d5ac9979a..bb0111ca0 100755 --- a/bin/arc_tool.php +++ b/bin/arc_tool.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -91,7 +91,7 @@ require_once BASE_DIR."/lib/fetch_url.php"; /** Loads common constants for web crawling*/ require_once BASE_DIR."/lib/crawl_constants.php"; /* - * We'll set up multi-byte string handling to use UTF-8 + * We'll set up multi-byte string handling to use UTF-8 */ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); @@ -110,7 +110,7 @@ mb_regex_encoding("UTF-8"); * php arc_tool.php list bundle_name start_doc_num num_results * * @author Chris Pollett (non-yioop archive code derived from earlier - * stuff by Shawn Tice) + * stuff by Shawn Tice) * @package seek_quarry */ class ArcTool implements CrawlConstants @@ -243,7 +243,7 @@ class ArcTool implements CrawlConstants * bundle by calling the appropriate sub-function. * * @param string $archive_path the path of a directory that holds - * WebArchiveBundle,IndexArchiveBundle, or non-Yioop archive data + * WebArchiveBundle,IndexArchiveBundle, or non-Yioop archive data */ function outputInfo($archive_path) { @@ -266,7 +266,7 @@ class ArcTool implements CrawlConstants * Prints the IndexDictionary records for a word in an IndexArchiveBundle * * @param string $archive_path the path of a directory that holds - * an IndexArchiveBundle + * an IndexArchiveBundle * @param string $word to look up dictionary record for */ function outputDictInfo($archive_path, $word) @@ -318,7 +318,7 @@ class ArcTool implements CrawlConstants * within the $generation'th index shard in the bundle * * @param string $archive_path the path of a directory that holds - * an IndexArchiveBundle + * an IndexArchiveBundle * @param int $generation which index shard to use */ function outputShardInfo($archive_path, $generation) @@ -373,7 +373,7 @@ class ArcTool implements CrawlConstants * provided $generation and $offset * * @param string $archive_path the path of a directory that holds - * an IndexArchiveBundle + * an IndexArchiveBundle * @param int $generation which index shard to use * @param int $offset offset into posting lists for that shard * @param int $num how many postings to print info for @@ -495,8 +495,8 @@ class ArcTool implements CrawlConstants * * @param string $path file path to dictionary of an IndexArchiveBundle * @param int $max_tier tier up to which the dictionary tiers should be - * merge (typically a value greater than the max_tier of the - * dictionary) + * merge (typically a value greater than the max_tier of the + * dictionary) */ function reindexIndexArchive($path, $max_tier = -1) { @@ -547,7 +547,7 @@ class ArcTool implements CrawlConstants * bundle. * * @param array $info header info that has already been read from - * the description.txt file + * the description.txt file * @param string $archive_path file path of the folder containing the bundle */ function outputInfoIndexArchiveBundle($info, $archive_path) @@ -595,7 +595,7 @@ class ArcTool implements CrawlConstants * bundle. * * @param array $info header info that has already been read from - * the description.txt file + * the description.txt file * @param string $archive_path file path of the folder containing the bundle */ @@ -888,9 +888,9 @@ class ArcTool implements CrawlConstants * * @param string $archive_path path to non-yioop archive * @param string $iterator_type name of archive_bundle_iterator used to - * iterate over archive. + * iterate over archive. * @param return an ArchiveBundleIterator of the correct type using - * a temporary folder to store savepoints + * a temporary folder to store savepoints */ function instantiateIterator($archive_path, $iterator_type) { @@ -919,7 +919,7 @@ class ArcTool implements CrawlConstants * * @param string $archive_path the path to archive folder * @return string the archive bundle type, either: WebArchiveBundle or - * IndexArchiveBundle + * IndexArchiveBundle */ function getArchiveKind($archive_path) { @@ -943,9 +943,9 @@ class ArcTool implements CrawlConstants * Outputs the "hey, this isn't a known bundle message" and then exit()'s. * * @param string $archive_name name or path to what was supposed to be - * an archive + * an archive * @param string $allowed_archives a string list of archives types - * that $archive_name could belong to + * that $archive_name could belong to */ function badFormatMessageAndExit($archive_name, $allowed_archives = "web or index") diff --git a/bin/classifier_tool.php b/bin/classifier_tool.php index 829d36b98..f9a0041f6 100755 --- a/bin/classifier_tool.php +++ b/bin/classifier_tool.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -125,7 +125,7 @@ php bin/classifier_tool.php -a TrainAndTest -d 'DATASET' -l 'spam' EOD; /* - * We'll set up multi-byte string handling to use UTF-8 + * We'll set up multi-byte string handling to use UTF-8 */ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); @@ -160,35 +160,35 @@ class ClassifierTool * command line, where nesting is denoted by a period (e.g., cls.chi2.max). * The supported options are: * - * debug: An integer, the level of debug statements to print. Larger - * integers specify more detailed debug output; the default value of - * 0 indicates no debug output. + * debug: An integer, the level of debug statements to print. Larger + * integers specify more detailed debug output; the default value of + * 0 indicates no debug output. * - * max_train: An integer, the maximum number of examples to use when - * training a classifier. The default value of NULL indicates that - * all available training examples should be used. + * max_train: An integer, the maximum number of examples to use when + * training a classifier. The default value of NULL indicates that + * all available training examples should be used. * - * test_interval: An integer, the number of new training examples to be - * added before a round of testing on ALL test instances is to be - * executed. With an interval of 5, for example, after adding five - * new training examples, the classifier would be finalized and used - * to classify all test instances. The error is reported for each - * round of testing. The default value of NULL indicates that - * testing should only occur after all training examples have been - * added. + * test_interval: An integer, the number of new training examples to be + * added before a round of testing on ALL test instances is to be + * executed. With an interval of 5, for example, after adding five + * new training examples, the classifier would be finalized and used + * to classify all test instances. The error is reported for each + * round of testing. The default value of NULL indicates that + * testing should only occur after all training examples have been + * added. * - * split: An integer, the number of examples from the entire set of - * labeled examples to use for training. The remainder are used for - * testing. + * split: An integer, the number of examples from the entire set of + * labeled examples to use for training. The remainder are used for + * testing. * - * cls.use_nb: A boolean, whether or not to use the Naive Bayes - * classification algorithm instead of the logistic regression one - * in order to finalize the classifier. The default value is false, - * indicating that logistic regression should be used. + * cls.use_nb: A boolean, whether or not to use the Naive Bayes + * classification algorithm instead of the logistic regression one + * in order to finalize the classifier. The default value is false, + * indicating that logistic regression should be used. * - * cls.chi2.max: An integer, the maximum number of features to use when - * training the classifier. The default is a relatively - * conservative 200. + * cls.chi2.max: An integer, the maximum number of features to use when + * training the classifier. The default is a relatively + * conservative 200. * * @var array */ @@ -409,11 +409,11 @@ class ClassifierTool * * @param string $dataset_name prefix of index names to draw examples from * @param string $class_label class label of the classifier the examples - * will be used to train (used to name the crawl mix that iterates over - * each index) + * will be used to train (used to name the crawl mix that iterates over + * each index) * @return array training and test datasets in an associative array with - * keys `train' and `test', where each dataset is wrapped up in a - * PageIterator that implements the CrawlMixIterator interface. + * keys `train' and `test', where each dataset is wrapped up in a + * PageIterator that implements the CrawlMixIterator interface. */ function loadDataset($dataset_name, $class_label) { @@ -470,10 +470,10 @@ class ClassifierTool * * @param int $i the size of the current training set * @param int $total the total number of documents available to be added to - * the training set + * the training set * @return bool true if the `test_interval' option specifies that a round - * of testing should occur for the current training offset, and false - * otherwise + * of testing should occur for the current training offset, and false + * otherwise */ function isTestPoint($i, $total) { @@ -495,7 +495,7 @@ class ClassifierTool * * @param object $classifier classifier instance to test * @param array $data the array of training and test datasets, constructed - * by loadDataset, of which only the `test' dataset it used. + * by loadDataset, of which only the `test' dataset it used. */ function testClassifier($classifier, $data) { @@ -528,9 +528,9 @@ class ClassifierTool * by the `debug' option then nothing is printed. The treatment for the * available detail levels are as follows: * - * -2: Used for errors; always printed; prefix '! ' - * -1: Used for log of set options; always printed; prefix '# ' - * 0+: Used for normal messages; prefix '> ' + * -2: Used for errors; always printed; prefix '! ' + * -1: Used for log of set options; always printed; prefix '# ' + * 0+: Used for normal messages; prefix '> ' * * The second argument is a printf-style string template specifying the * message, and each following (optional) argument is used by the template. @@ -539,7 +539,7 @@ class ClassifierTool * @param int $level level of detail for the message * @param string $message printf-style template for the message * @param string $args,... optional arguments to be used for the message - * template + * template */ function log(/* varargs */) { @@ -562,6 +562,10 @@ class ClassifierTool * Logs the current options using the log method of this class. This method * is used to explicitly state which settings were used for a given run of * an activity. The detail level passed to the log method is -1. + * + * @param string $root folder to write to + * @param string $prefix to pre message (like Warning) to put at start of + * log message */ function logOptions($root = NULL, $prefix = '') { @@ -585,9 +589,9 @@ class ClassifierTool * string corresponds to an option of the same type (e.g., int). * * @param string|array $opts single option in the format NAME=VALUE, or - * array of options, each for the same target type (e.g., int) + * array of options, each for the same target type (e.g., int) * @param string $converter the name of a function that takes a string and - * casts it to a particular type (e.g., intval, floatval) + * casts it to a particular type (e.g., intval, floatval) */ function setOptions($opts, $converter = NULL) { @@ -626,6 +630,9 @@ class ClassifierTool * Sets a default value for a runtime parameter. This method is used by * activities to specify default values that may be overridden by passing * the appropriate command-line flag. + * + * @param string $name should end with name of runtime parameter to set + * @param string $value what to set it to */ function setDefault($name, $value) { @@ -706,9 +713,9 @@ class PageIterator * returned. * * @param int $n maximum number of pages to return, or -1 to return all - * remaining pages + * remaining pages * @return array next $n pages, or less if there are fewer than $n - * pages remaining + * pages remaining */ function nextPages($n = -1) { diff --git a/bin/classifier_trainer.php b/bin/classifier_trainer.php index db96ed419..c1404617c 100755 --- a/bin/classifier_trainer.php +++ b/bin/classifier_trainer.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -78,7 +78,7 @@ ini_set("memory_limit", "500M"); * second command-line argument. The following command would be used to run * this script directly from the command-line: * - * $ php bin/classifier_trainer.php terminal LABEL + * $ php bin/classifier_trainer.php terminal LABEL * * @author Shawn Tice * @package seek_quarry @@ -86,11 +86,11 @@ ini_set("memory_limit", "500M"); class ClassifierTrainer { /** - * This is the function that should be called to get the - * classifier_trainer to start training a logistic regression instance for - * a particular classifier. The class label corresponding to the - * classifier to be finalized should be passed as the second command-line - * argument. + * This is the function that should be called to get the + * classifier_trainer to start training a logistic regression instance for + * a particular classifier. The class label corresponding to the + * classifier to be finalized should be passed as the second command-line + * argument. */ function start() { diff --git a/bin/code_tool.php b/bin/code_tool.php index 48d80f09d..5c08ab467 100755 --- a/bin/code_tool.php +++ b/bin/code_tool.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Tool used to help coding with Yioop. Has commands to update copyright info, * clean trailing spaces, find long lines, and do global file searches and @@ -56,7 +56,7 @@ require_once BASE_DIR.'/models/model.php'; /** Used to get @see readInput() */ require_once BASE_DIR.'/lib/utility.php'; /* - * We'll set up multi-byte string handling to use UTF-8 + * We'll set up multi-byte string handling to use UTF-8 */ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); @@ -122,7 +122,7 @@ EOD; * * @param array $args $args[0] contains path to sub-folder/file * @return bool $no_instructions false if should output code_tool.php - * instructions + * instructions */ function clean($args) { @@ -143,7 +143,7 @@ function clean($args) * * @param array $args $args[0] contains path to sub-folder/file * @return bool $no_instructions false if should output code_tool.php - * instructions + * instructions */ function copyright($args) { @@ -166,7 +166,7 @@ function copyright($args) * * @param array $args $args[0] contains path to sub-folder/file * @return bool $no_instructions false if should output code_tool.php - * instructions + * instructions */ function longlines($args) { @@ -186,15 +186,15 @@ function longlines($args) * sub-folder/file * * @param array $args $args[0] contains path to sub-folder/file, - * $args[1] contains the regex searching for, $args[2] contains - * what it should be replaced with, $args[3] (defaults to effect) - * controls the mode of operation. One of "effect", "change", or - * "interactive". effect shows line number and lines matching pattern, - * but commits no changes; interactive for each match, prompts user - * if should do the change, change does a global search and replace - * without output + * $args[1] contains the regex searching for, $args[2] contains + * what it should be replaced with, $args[3] (defaults to effect) + * controls the mode of operation. One of "effect", "change", or + * "interactive". effect shows line number and lines matching pattern, + * but commits no changes; interactive for each match, prompts user + * if should do the change, change does a global search and replace + * without output * @return bool $no_instructions false if should output code_tool.php - * instructions + * instructions */ function replace($args) { @@ -220,9 +220,9 @@ function replace($args) * Performs a search for given pattern in files in supplied sub-folder/file * * @param array $args $args[0] contains path to sub-folder/file, - * $args[1] contains the regex searching for + * $args[1] contains the regex searching for * @return bool $no_instructions false if should output code_tool.php - * instructions + * instructions */ function search($args) { @@ -248,6 +248,8 @@ function search($args) * of the form 2009 - \d\d\d\d to the supplied copyright year * * @param string $filename name of file to check for copyright lines and updated + * @param mixed $set_year if false then set the end of the copyright period + * to the current year, otherwise, if an int sets it to the value of the int */ function changeCopyrightFile($filename, $set_year = false) { @@ -314,12 +316,12 @@ function cleanLinesFile($filename) /** * Callback function applied to each file in the directory being traversed * by @see search(). Searches $filename matching $pattern and outputs line - * numbers and lines + * numbers and lines * * @param string $filename name of file to search in * @param mixed $set_pattern if not false, then sets $set_pattern in $pattern to - * initialize the callback on subsequent calls. $pattern here is the - * search pattern + * initialize the callback on subsequent calls. $pattern here is the + * search pattern */ function searchFile($filename, $set_pattern = false) { @@ -352,17 +354,17 @@ function searchFile($filename, $set_pattern = false) /** * Callback function applied to each file in the directory being traversed * by @see replace(). Searches $filename matching $pattern. Depending - * on $mode ($arg[2] as described in replace()), it outputs and - * replaces with $replace + * on $mode ($arg[2] as described in replace()), it outputs and + * replaces with $replace * * @param string $filename name of file to search and replace in * @param mixed $set_pattern if not false, then sets $set_pattern in $pattern to - * initialize the callback on subsequent calls. $pattern here is the - * search pattern + * initialize the callback on subsequent calls. $pattern here is the + * search pattern * @param mixed $set_replace if not false, then sets $set_replace in $replace to - * initialize the callback on subsequent calls. + * initialize the callback on subsequent calls. * @param mixed $set_mode if not false, then sets $set_mode in $mode to - * initialize the callback on subsequent calls. + * initialize the callback on subsequent calls. */ function replaceFile($filename, $set_pattern = false, $set_replace = false, $set_mode = false) @@ -429,7 +431,7 @@ function replaceFile($filename, $set_pattern = false, * * @param string $path to apply map $callback to * @param string $callback function name to call with filename of each file - * in path + * in path */ function mapPath($path, $callback) { diff --git a/bin/fetcher.php b/bin/fetcher.php index e9fcb7343..16960c479 100755 --- a/bin/fetcher.php +++ b/bin/fetcher.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -58,7 +58,7 @@ define("NO_CACHE", true); require_once BASE_DIR."/models/datasources/".DBMS."_manager.php"; /** caches of web pages are stored in a - * web archive bundle, so we load in its definition + * web archive bundle, so we load in its definition */ require_once BASE_DIR."/lib/web_archive_bundle.php"; @@ -114,7 +114,7 @@ require_once BASE_DIR."/lib/index_shard.php"; require_once BASE_DIR."/lib/fetch_git_repository_urls.php"; /* - * We'll set up multi-byte string handling to use UTF-8 + * We'll set up multi-byte string handling to use UTF-8 */ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); @@ -139,9 +139,9 @@ mb_regex_encoding("UTF-8"); * each word document pair several scores. More information on these scores can * be found in the documentation for {@link buildMiniInvertedIndex()} * - * @author Chris Pollett - * @package seek_quarry - * @see buildMiniInvertedIndex() + * @author Chris Pollett + * @package seek_quarry + * @see buildMiniInvertedIndex() */ class Fetcher implements CrawlConstants { @@ -538,9 +538,9 @@ class Fetcher implements CrawlConstants $this->summarizer_option = self::BASIC_SUMMARIZER; } /** - * This is the function that should be called to get the fetcher to start - * fetching. Calls init to handle the command-line arguments then enters - * the fetcher's main loop + * This is the function that should be called to get the fetcher to start + * fetching. Calls init to handle the command-line arguments then enters + * the fetcher's main loop */ function start() { @@ -711,7 +711,7 @@ class Fetcher implements CrawlConstants * possible, pages that did not successfully get downloaded. * * @return array an associative array of web pages and meta data - * fetched from the internet + * fetched from the internet */ function downloadPagesWebCrawl() { @@ -801,7 +801,7 @@ class Fetcher implements CrawlConstants * being recrawled. * * @return array an associative array of web pages and meta data from - * the archive bundle being iterated over + * the archive bundle being iterated over */ function downloadPagesArchiveCrawl() { @@ -839,7 +839,7 @@ class Fetcher implements CrawlConstants * Deletes any crawl web archive bundles not in the provided array of crawls * * @param array $still_active_crawls those crawls which should not - * be deleted, so all others will be deleted + * be deleted, so all others will be deleted * @see loop() */ function deleteOldCrawls(&$still_active_crawls) @@ -1036,9 +1036,9 @@ class Fetcher implements CrawlConstants * the queue_server. * * @return mixed array or bool. If we are doing - * a web crawl and we still have pages to crawl then true, if the - * scheduler page fails to download then false, otherwise, returns - * an array of info from the scheduler. + * a web crawl and we still have pages to crawl then true, if the + * scheduler page fails to download then false, otherwise, returns + * an array of info from the scheduler. */ function checkScheduler() { @@ -1116,11 +1116,11 @@ class Fetcher implements CrawlConstants return $info; } /** - * During an archive crawl this method is used to get from the name server - * a collection of pages to process. The fetcher will later process these - * and send summaries to various queue_servers. + * During an archive crawl this method is used to get from the name server + * a collection of pages to process. The fetcher will later process these + * and send summaries to various queue_servers. * - * @return array containing archive page data + * @return array containing archive page data */ function checkArchiveScheduler() { @@ -1241,7 +1241,7 @@ class Fetcher implements CrawlConstants * any fetcher data we have to it. * * @param bool $at_least_once whether to send to at least one fetcher or - * to only send if memory is above threshold + * to only send if memory is above threshold */ function selectCurrentServerAndUpdateIfNeeded($at_least_once) { @@ -1271,8 +1271,8 @@ class Fetcher implements CrawlConstants * Sets parameters for fetching based on provided info struct * ($info typically would come from the queue server) * - * @param array &$info struct with info about the kind of crawl, timestamp - * of index, crawl order, etc. + * @param array& $info struct with info about the kind of crawl, timestamp + * of index, crawl order, etc. */ function setCrawlParamsFromArray(&$info) { @@ -1509,9 +1509,9 @@ class Fetcher implements CrawlConstants * for which no content was downloaded so that they can be scheduled * to be crawled again. * - * @param array &$site_pages pages to sort + * @param array& $site_pages pages to sort * @return an array conisting of two array downloaded pages and - * not downloaded pages. + * not downloaded pages. */ function reschedulePages(&$site_pages) { @@ -1880,9 +1880,11 @@ class Fetcher implements CrawlConstants * Then a crude estimate of the informaation contained in the links test: * strlen(gzip(text)) is used to extract the best remaining links. * - * @param array &$doc_info a string with a CrawlConstants::LINKS subarray - * This subarray in turn contains url => text pairs. + * @param array& $doc_info a string with a CrawlConstants::LINKS subarray + * This subarray in turn contains url => text pairs. * @param string $field field for links default is CrawlConstants::LINKS + * @param int $member_cache_time says how long allowed and disallowed url + * info should be caches by urlMemberSiteArray */ function pruneLinks(&$doc_info, $field = CrawlConstants::LINKS, $member_cache_time = 0) @@ -1919,10 +1921,10 @@ class Fetcher implements CrawlConstants * Copies fields from the array of site data to the $i indexed * element of the $summarized_site_pages and $stored_site_pages array * - * @param int &$i index to copy to - * @param array &$site web page info to copy - * @param array &$summarized_site_pages array of summaries of web pages - * @param array &$stored_site_pages array of cache info of web pages + * @param int& $i index to copy to + * @param array& $site web page info to copy + * @param array& $summarized_site_pages array of summaries of web pages + * @param array& $stored_site_pages array of cache info of web pages */ function copySiteFields(&$i, &$site, &$summarized_site_pages, &$stored_site_pages) @@ -1955,11 +1957,11 @@ class Fetcher implements CrawlConstants * documents to the summaried_size_pages and stored_site_pages * arrays constructed during the execution of processFetchPages() * - * @param int &$i index to begin adding subdocs at - * @param array &$site web page that subdocs were from and from - * which some subdoc summary info is copied - * @param array &$summarized_site_pages array of summaries of web pages - * @param array &$stored_site_pages array of cache info of web pages + * @param int& $i index to begin adding subdocs at + * @param array& $site web page that subdocs were from and from + * which some subdoc summary info is copied + * @param array& $summarized_site_pages array of summaries of web pages + * @param array& $stored_site_pages array of cache info of web pages */ function processSubdocs(&$i, &$site, &$summarized_site_pages, &$stored_site_pages) @@ -2010,7 +2012,7 @@ class Fetcher implements CrawlConstants * * @param array $sites site data to use for the update * @param bool $force_send whether to force send data back to queue_server - * or rely on usual thresholds before sending + * or rely on usual thresholds before sending */ function updateFoundSites($sites, $force_send = false) { @@ -2110,9 +2112,9 @@ class Fetcher implements CrawlConstants * @param array $link_urls an array of urls to be crawled * @param int $old_weight the weight of the web page the links came from * @param string $site_hash a hash of the web_page on which the link was - * found, for use in deduplication + * found, for use in deduplication * @param string $old_url url of page where links came from - * @param bool whether the links are coming from a sitemap + * @param bool $from_sitemap whether the links are coming from a sitemap */ function addToCrawlSites($link_urls, $old_weight, $site_hash, $old_url, $from_sitemap = false) @@ -2167,16 +2169,16 @@ class Fetcher implements CrawlConstants } } /** - * Returns the number of links in the array $links which - * which share the same company level domain (cld) as $url - * For www.yahoo.com the cld is yahoo.com, for - * www.theregister.co.uk it is theregister.co.uk. It is - * similar for organizations. + * Returns the number of links in the array $links which + * which share the same company level domain (cld) as $url + * For www.yahoo.com the cld is yahoo.com, for + * www.theregister.co.uk it is theregister.co.uk. It is + * similar for organizations. * - * @param string $url the url to compare against $links - * @param array $links an array of urls - * @return int the number of times $url shares the cld with a - * link in $links + * @param string $url the url to compare against $links + * @param array $links an array of urls + * @return int the number of times $url shares the cld with a + * link in $links */ function countCompanyLevelDomainsInCommon($url, $links) { @@ -2193,12 +2195,12 @@ class Fetcher implements CrawlConstants /** * Calculates the company level domain for the given url * - * For www.yahoo.com the cld is yahoo.com, for - * www.theregister.co.uk it is theregister.co.uk. It is - * similar for organizations. + * For www.yahoo.com the cld is yahoo.com, for + * www.theregister.co.uk it is theregister.co.uk. It is + * similar for organizations. * - * @param string $url url to determine cld for - * @return string the cld of $url + * @param string $url url to determine cld for + * @return string the cld of $url */ function getCompanyLevelDomain($url) { @@ -2416,8 +2418,8 @@ class Fetcher implements CrawlConstants * * @param string $queue_server url of the current queue server * @param array $byte_counts has four fields: TOTAL, ROBOT, SCHEDULE, - * INDEX. These give the number of bytes overall for the - * 'data' field of $post_data and for each of these components. + * INDEX. These give the number of bytes overall for the + * 'data' field of $post_data and for each of these components. * @param array $post_data data to be uploaded to the queue server web app */ function uploadCrawlData($queue_server, $byte_counts, &$post_data) @@ -2754,7 +2756,7 @@ class Fetcher implements CrawlConstants } } /* - * Instantiate and runs the Fetcher + * Instantiate and runs the Fetcher */ $fetcher = new Fetcher(); $fetcher->start(); diff --git a/bin/mirror.php b/bin/mirror.php index 2ed393697..e21815297 100644 --- a/bin/mirror.php +++ b/bin/mirror.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -61,21 +61,21 @@ require_once BASE_DIR."/lib/fetch_url.php"; /** Loads common constants for web crawling*/ require_once BASE_DIR."/lib/crawl_constants.php"; /* - * We'll set up multi-byte string handling to use UTF-8 + * We'll set up multi-byte string handling to use UTF-8 */ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); /** * This class is responsible for syncing crawl archives between machines using - * the SeekQuarry/Yioop search engine + * the SeekQuarry/Yioop search engine * * Mirror periodically queries the queue server asking for a list of files that * have changed in its parent since the last sync time. It then proceeds to * download them. * - * @author Chris Pollett - * @package seek_quarry - * @see buildMiniInvertedIndex() + * @author Chris Pollett + * @package seek_quarry + * @see buildMiniInvertedIndex() */ class Mirror implements CrawlConstants { @@ -149,9 +149,9 @@ class Mirror implements CrawlConstants $this->sync_dir = CRAWL_DIR."/cache"; } /** - * This is the function that should be called to get the mirror to start - * syncing. Calls init to handle the command line arguments then enters - * the syncer's main loop + * This is the function that should be called to get the mirror to start + * syncing. Calls init to handle the command line arguments then enters + * the syncer's main loop */ function start() { @@ -199,8 +199,8 @@ class Mirror implements CrawlConstants * from the web app of the machine we are mirroring with. * * @return mixed array or bool. Returns false if weren't succesful in - * contacting web app, otherwise, returns an array with a status - * and potentially a list of files ot sync + * contacting web app, otherwise, returns an array with a status + * and potentially a list of files ot sync */ function checkScheduler() { @@ -248,8 +248,8 @@ class Mirror implements CrawlConstants return $info; } /** - * Downloads the next file from the schedule of files to download received - * from the web app. + * Downloads the next file from the schedule of files to download received + * from the web app. */ function copyNextSyncFile() { @@ -309,7 +309,7 @@ class Mirror implements CrawlConstants } } /* - * Instantiate and runs the Mirror program + * Instantiate and runs the Mirror program */ $syncer = new Mirror(NAME_SERVER); $syncer->start(); diff --git a/bin/news_updater.php b/bin/news_updater.php index 671d3c882..b8548adb5 100644 --- a/bin/news_updater.php +++ b/bin/news_updater.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -51,7 +51,7 @@ if(!PROFILE) { */ define("NO_CACHE", true); /** We do want logging, but crawl model and other will try to turn off - * if we don't set this + * if we don't set this */ define("NO_LOGGING", false); /** @@ -77,17 +77,17 @@ if(file_exists(APP_DIR."/models/source_model.php")) { require_once BASE_DIR."/models/source_model.php"; } /* - * We'll set up multi-byte string handling to use UTF-8 + * We'll set up multi-byte string handling to use UTF-8 */ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); if (function_exists('lcfirst') === false) { /** - * Lower cases the first letter in a string + * Lower cases the first letter in a string * - * This function is only defined if the PHP version is before 5.3 - * @param string $str string to be lower cased - * @return string the lower cased string + * This function is only defined if the PHP version is before 5.3 + * @param string $str string to be lower cased + * @return string the lower cased string */ function lcfirst( $str ) { @@ -95,12 +95,12 @@ if (function_exists('lcfirst') === false) { } } /** - * Separate process/command-line script which can be used to update - * news sources for Yioop. This is as an alternative to using the web app - * for updating. Makes use of the web-apps code. + * Separate process/command-line script which can be used to update + * news sources for Yioop. This is as an alternative to using the web app + * for updating. Makes use of the web-apps code. * - * @author Chris Pollett - * @package seek_quarry + * @author Chris Pollett + * @package seek_quarry */ class NewsUpdater implements CrawlConstants { @@ -119,9 +119,9 @@ class NewsUpdater implements CrawlConstants $this->update_time = 0; } /** - * This is the function that should be called to get the newsupdater to - * start to start updating. Calls init to handle the command-line - * arguments then enters news_updaters main loop + * This is the function that should be called to get the newsupdater to + * start to start updating. Calls init to handle the command-line + * arguments then enters news_updaters main loop */ function start() { @@ -154,14 +154,14 @@ class NewsUpdater implements CrawlConstants crawlLog("News Updater shutting down!!"); } /** - * If news_update time has passed, then updates news feeds associated with - * this Yioop instance + * If news_update time has passed, then updates news feeds associated with + * this Yioop instance * - * @param array $data used by view to render itself. In this case, if there - * is a problem updating the news then we will flash a message - * @param bool $no_news_process if true than assume news_updater.php is - * not running. If false, assume being run from news_updater.php so - * update news_process cron time. + * @param array $data used by view to render itself. In this case, if there + * is a problem updating the news then we will flash a message + * @param bool $no_news_process if true than assume news_updater.php is + * not running. If false, assume being run from news_updater.php so + * update news_process cron time. */ function newsUpdate() { @@ -201,7 +201,7 @@ class NewsUpdater implements CrawlConstants } } /* - * Instantiate and runs the NewsUpdater program + * Instantiate and runs the NewsUpdater program */ $news_updater = new NewsUpdater(); $news_updater->start(); diff --git a/bin/query_tool.php b/bin/query_tool.php index 6822e0b53..3d51ce695 100755 --- a/bin/query_tool.php +++ b/bin/query_tool.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -49,7 +49,7 @@ require_once(BASE_DIR."/lib/file_cache.php"); /** NO_CACHE means don't try to use memcache*/ define("NO_CACHE", true); /** USE_FILECACHE will let us use this tool to store long running - * queries into the filecache + * queries into the filecache */ if(USE_FILECACHE) { $CACHE = new FileCache(WORK_DIRECTORY."/cache/queries"); @@ -66,7 +66,7 @@ require_once BASE_DIR."/lib/locale_functions.php"; /**Load base controller class, if needed. */ require_once BASE_DIR."/controllers/search_controller.php"; /* - * We'll set up multi-byte string handling to use UTF-8 + * We'll set up multi-byte string handling to use UTF-8 */ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); diff --git a/bin/queue_server.php b/bin/queue_server.php index dd6042826..e60b6c089 100755 --- a/bin/queue_server.php +++ b/bin/queue_server.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -86,7 +86,7 @@ foreach(glob(APP_DIR."/lib/indexing_plugins/*_plugin.php") as $filename) { require_once $filename; } /* - * We'll set up multi-byte string handling to use UTF-8 + * We'll set up multi-byte string handling to use UTF-8 */ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); @@ -298,19 +298,19 @@ class QueueServer implements CrawlConstants, Join */ var $hourly_crawl_data; /** - * Used to say what kind of queue_server this is (one of BOTH, INDEXER, - * SCHEDULER) - * @var mixed + * Used to say what kind of queue_server this is (one of BOTH, INDEXER, + * SCHEDULER) + * @var mixed */ var $server_type; /** - * String used to describe this kind of queue server (Indexer, Scheduler, - * etc. in the log files. - * @var mixed + * String used to describe this kind of queue server (Indexer, Scheduler, + * etc. in the log files. + * @var mixed */ var $server_name; /** - * Creates a Queue Server Daemon + * Creates a Queue Server Daemon */ function __construct() { @@ -445,11 +445,11 @@ class QueueServer implements CrawlConstants, Join * robot file processing is done. * * @param bool $blocking this method might be called by the indexer - * subcomponent when a merge tier phase is ongoing to allow for - * other processing to occur. If so, we don't want a regress - * where the indexer calls this code calls the indexer etc. If - * the blocking flag is set then the indexer subcomponent won't - * be called + * subcomponent when a merge tier phase is ongoing to allow for + * other processing to occur. If so, we don't want a regress + * where the indexer calls this code calls the indexer etc. If + * the blocking flag is set then the indexer subcomponent won't + * be called */ function processCrawlData($blocking = false) { @@ -647,9 +647,9 @@ class QueueServer implements CrawlConstants, Join * when QueueServer is run using command-line argument * * @param array $info associative array with info about current state of - * queue_server + * queue_server * @return array an updates version $info reflecting changes that occurred - * during the handling of the admin messages files. + * during the handling of the admin messages files. */ function handleAdminMessages($info) { @@ -807,7 +807,7 @@ class QueueServer implements CrawlConstants, Join * crawl. * * @param string $message to write into crawl_status.txt this will show - * up in the web crawl status element. + * up in the web crawl status element. */ function writeAdminMessage($message) { @@ -830,8 +830,8 @@ class QueueServer implements CrawlConstants, Join * time. * * @param bool $for_reschedule if the call was to reschedule the urls - * to be crawled at a later time as opposed to being used to - * save the urls because the crawl is being halted. + * to be crawled at a later time as opposed to being used to + * save the urls because the crawl is being halted. */ function dumpQueueToSchedules($for_reschedule = false) { @@ -1326,13 +1326,13 @@ class QueueServer implements CrawlConstants, Join * * @param string $base_dir directory for of schedules * @param string $callback_method what method should be called to handle - * a schedule + * a schedule * @param boolean $blocking this method might be called by the indexer - * subcomponent when a merge tier phase is ongoing to allow for - * other processing to occur. If so, we don't want a regress - * where the indexer calls this code calls the indexer etc. If - * the blocking flag is set then the indexer subcomponent won't - * be called + * subcomponent when a merge tier phase is ongoing to allow for + * other processing to occur. If so, we don't want a regress + * where the indexer calls this code calls the indexer etc. If + * the blocking flag is set then the indexer subcomponent won't + * be called */ function processDataFile($base_dir, $callback_method, $blocking = false) { @@ -1388,11 +1388,11 @@ class QueueServer implements CrawlConstants, Join * index archive data from fetchers then calls the function * processDataFile to process the oldest file found * @param bool $blocking this method might be called by the indexer - * subcomponent when a merge tier phase is ongoing to allow for - * other processing to occur. If so, we don't want a regress - * where the indexer calls this code calls the indexer etc. If - * the blocking flag is set then the indexer subcomponent won't - * be called + * subcomponent when a merge tier phase is ongoing to allow for + * other processing to occur. If so, we don't want a regress + * where the indexer calls this code calls the indexer etc. If + * the blocking flag is set then the indexer subcomponent won't + * be called */ function processIndexData($blocking) { @@ -1406,13 +1406,13 @@ class QueueServer implements CrawlConstants, Join * Adds the summary and index data in $file to summary bundle and word index * * @param string $file containing web pages summaries and a mini-inverted - * index for their content + * index for their content * @param bool $blocking this method might be called by the indexer - * subcomponent when a merge tier phase is ongoing to allow for - * other processing to occur. If so, we don't want a regress - * where the indexer calls this code calls the indexer etc. If - * the blocking flag is set then the indexer subcomponent won't - * be called + * subcomponent when a merge tier phase is ongoing to allow for + * other processing to occur. If so, we don't want a regress + * where the indexer calls this code calls the indexer etc. If + * the blocking flag is set then the indexer subcomponent won't + * be called */ function processIndexArchive($file, $blocking) { @@ -1594,7 +1594,7 @@ class QueueServer implements CrawlConstants, Join * robot filter and setting the delay in the delay filter of * crawled delayed hosts * @param string $file file to read of robot data, is removed after - * processing + * processing */ function processRobotArchive($file) { @@ -1925,7 +1925,7 @@ class QueueServer implements CrawlConstants, Join /** * Removes the already seen urls from the supplied array * - * @param array &$sites url data to check if seen + * @param array& $sites url data to check if seen */ function deleteSeenUrls(&$sites) { @@ -2299,7 +2299,7 @@ class QueueServer implements CrawlConstants, Join * This function is used to schedule slots for crawl-delayed host. * * @param int $index location to begin searching for an empty slot - * @param array &$arr list of slots to look in + * @param array& $arr list of slots to look in * @return int index of first available slot */ function getEarliestSlot($index, &$arr) @@ -2380,7 +2380,7 @@ class QueueServer implements CrawlConstants, Join } if(!defined("UNIT_TEST_MODE")) { /* - * Instantiate and runs the QueueSever + * Instantiate and runs the QueueSever */ $queue_server = new QueueServer($INDEXED_FILE_TYPES); $queue_server->start(); diff --git a/blog.php b/blog.php index 009e91d4e..40a9cc6dd 100755 --- a/blog.php +++ b/blog.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Web page used to display a simple blog about current crawls related to * the SeekQuarry/Yioop Search engine diff --git a/bot.php b/bot.php index d0e4d5ff6..218891a0a 100755 --- a/bot.php +++ b/bot.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Web page used to display information about the web robot used in * the SeekQuarry/Yioop Search engine diff --git a/configs/config.php b/configs/config.php index bcefc3341..7d18d48ae 100755 --- a/configs/config.php +++ b/configs/config.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Used to set the configuration settings of the SeekQuarry project. * @@ -35,7 +35,7 @@ if(!defined('BASE_DIR') || defined('PROFILE_FILE_NAME')) {echo "BAD REQUEST"; exit();} /** Version number for upgrade function - * @var int + * @var int */ define('YIOOP_VERSION', 20); /* @@ -72,8 +72,8 @@ if(!defined('TIME_ZONE')) { } /** * @global array which activities are in which Component classes (use this - * array so don't have to instantiate classes to find out. Keys are - * names of components, values are the activities in that component. + * array so don't have to instantiate classes to find out. Keys are + * names of components, values are the activities in that component. */ $COMPONENT_ACTIVITIES = array( "accountaccess" => array("signin", "manageAccount", "manageUsers", @@ -114,7 +114,7 @@ define('APP_DIR', WORK_DIRECTORY."/app"); */ define('PREP_DIR', WORK_DIRECTORY."/prepare"); /** Locale dir to use in case LOCALE_DIR does not exist yet or is - * missing some file + * missing some file */ define('FALLBACK_LOCALE_DIR', BASE_DIR."/locale"); /** name of the cookie used to manage the session @@ -133,7 +133,7 @@ define('NORMAL_AUTHENTICATION', 1); /** Authentication Mode Possibility*/ define('ZKP_AUTHENTICATION', 2); /** If ZKP Authentication via Fiat Shamir Protocol used how many iterations - * to do + * to do */ define('FIAT_SHAMIR_ITERATIONS', 20); if(file_exists(WORK_DIRECTORY.PROFILE_FILE_NAME)) { @@ -292,7 +292,7 @@ define('MAX_WAITING_HOSTS', 250); /** Minimum weight in priority queue before rebuilt */ define('MIN_QUEUE_WEIGHT', 1/100000); /** largest sized object allowed in a web archive (used to sanity check - * reading data out of a web archive) + * reading data out of a web archive) */ define('MAX_ARCHIVE_OBJECT_SIZE', 100000000); /** Treat earlier timestamps as being an indexes of format version 0 */ @@ -311,18 +311,18 @@ if(strstr(PHP_OS, "WIN")) { $memory = 1024 * intval($data[1]); } /** - * Factor to multiply sizes of Yioop data structures with in low ram memory - * setting (2GB) + * Factor to multiply sizes of Yioop data structures with in low ram memory + * setting (2GB) */ define('MEMORY_LOW', 1); /** - * Factor to multiply sizes of Yioop data structures with if have more than + * Factor to multiply sizes of Yioop data structures with if have more than * (2GB) */ define('MEMORY_STANDARD', 4); if($memory < 2200000000) { /** - * Based on system memory, either the low or high memory factor + * Based on system memory, either the low or high memory factor */ define('MEMORY_PROFILE', MEMORY_LOW); } else { @@ -358,14 +358,14 @@ define('MAX_LINKS_PER_SITEMAP', MEMORY_PROFILE * 80); /** maximum number of words from links to consider on any given page */ define('MAX_LINKS_WORD_TEXT', 100); /** maximum length of urls to try to queue, this is important for - * memory when creating schedule, since the amount of memory is - * going to be greater than the product MAX_URL_LENGTH*MAX_FETCH_SIZE - * text_processors need to promise to implement this check or rely - * on the base class which does implement it in extractHttpHttpsUrls + * memory when creating schedule, since the amount of memory is + * going to be greater than the product MAX_URL_LENGTH*MAX_FETCH_SIZE + * text_processors need to promise to implement this check or rely + * on the base class which does implement it in extractHttpHttpsUrls */ define('MAX_URL_LENGTH', 512); /** request this many bytes out of a page -- this is the default value to - * use if the user doesn't set this value in the page options GUI + * use if the user doesn't set this value in the page options GUI */ define('PAGE_RANGE_REQUEST', 50000); /** @@ -374,10 +374,10 @@ define('PAGE_RANGE_REQUEST', 50000); */ define('MAX_DESCRIPTION_LEN', 2000); /** - * Allow pages to be recrawled after this many days -- this is the - * default value to use if the user doesn't set this value in the page options - * GUI. What this controls is how often the page url filter is deleted. - * A nonpositive value means the filter will never be deleted. + * Allow pages to be recrawled after this many days -- this is the + * default value to use if the user doesn't set this value in the page options + * GUI. What this controls is how often the page url filter is deleted. + * A nonpositive value means the filter will never be deleted. */ define('PAGE_RECRAWL_FREQUENCY', -1); /** number of multi curl page requests in one go */ @@ -393,13 +393,13 @@ define('SINGLE_PAGE_TIMEOUT', 60); */ define('LOG_TIMEOUT', 30); /** - * Maximum time a crawl daemon process can go before calling - * @see CrawlDaemon::processHandler + * Maximum time a crawl daemon process can go before calling + * @see CrawlDaemon::processHandler */ define('PROCESS_TIMEOUT', 240); /** - * Number of error page 400 or greater seen from a host before crawl-delay - * host and dump remainder from current schedule + * Number of error page 400 or greater seen from a host before crawl-delay + * host and dump remainder from current schedule */ define('DOWNLOAD_ERROR_THRESHOLD', 50); /** Crawl-delay to set in the event that DOWNLOAD_ERROR_THRESHOLD exceeded*/ @@ -414,7 +414,7 @@ define('NORMALIZE_FREQUENCY', 10000); $INDEXED_FILE_TYPES = array("unknown"); /** * @global array filetypes which should be considered images. This - * array is populated in the individual lib/processors page processors + * array is populated in the individual lib/processors page processors */ $IMAGE_TYPES = array(); /** @@ -425,7 +425,7 @@ $IMAGE_TYPES = array(); $PAGE_PROCESSORS = array(); /** * @global array of indexing plugins, array itself is populated in the plugins - * after the plugin checks if it can run. + * after the plugin checks if it can run. */ $INDEXING_PLUGINS = array(); /** get any indexing plugins */ @@ -538,7 +538,7 @@ define ('MIN_QUERY_CACHE_TIME', 3600); //one hour */ define ('DEFAULT_ADMIN_PAGING_NUM', 50); /** Maximum number of bytes that the file that the suggest-a-url form - * send data to can be. + * send data to can be. */ define ('MAX_SUGGEST_URL_FILE_SIZE', 100000); /** Maximum number of a user can suggest to the suggest-a-url form in one day @@ -549,8 +549,8 @@ define ('MAX_SUGGEST_URLS_ONE_DAY', 10); */ define('MAX_MIX_FRAGMENTS', 10); /** - * Length after which to truncate names for users/groups/roles when - * they are displayed (not in DB) + * Length after which to truncate names for users/groups/roles when + * they are displayed (not in DB) */ define ('NAME_TRUNCATE_LEN', 7); /** ID of the root user */ @@ -566,8 +566,8 @@ define('PUBLIC_USER_ID', 2); /** USER STATUS value used for a user who can log in and perform activities */ define('ACTIVE_STATUS', 1); /** - * USER STATUS value used for a user whose account is created, but which - * still needs to undergo admin or email verification/activation + * USER STATUS value used for a user whose account is created, but which + * still needs to undergo admin or email verification/activation */ define('INACTIVE_STATUS', 2); /** @@ -576,62 +576,62 @@ define('INACTIVE_STATUS', 2); */ define('BANNED_STATUS', 3); /** Group status used to indicate a user that has been invited to join - * a group but who has not yet accepted + * a group but who has not yet accepted */ define('INVITED_STATUS', 4); /** - * Group registration type that only allows people to join a group by - * invitation + * Group registration type that only allows people to join a group by + * invitation */ define('NO_JOIN', 1); /** - * Group registration type that only allows people to request a membership - * in a group from the group's owner + * Group registration type that only allows people to request a membership + * in a group from the group's owner */ define('REQUEST_JOIN', 2); /** - * Group registration type that only allows anyone to obtain membership - * in the group + * Group registration type that only allows anyone to obtain membership + * in the group */ define('PUBLIC_JOIN', 3); /** - * Group access code signifying only the group owner can - * read items posted to the group or post new items + * Group access code signifying only the group owner can + * read items posted to the group or post new items */ define('GROUP_PRIVATE', 1); /** - * Group access code signifying members of the group can - * read items posted to the group but only the owner can post - * new items + * Group access code signifying members of the group can + * read items posted to the group but only the owner can post + * new items */ define('GROUP_READ', 2); /** - * Group access code signifying members of the group can - * read items posted to the group but only the owner can post - * new items + * Group access code signifying members of the group can + * read items posted to the group but only the owner can post + * new items */ define('GROUP_READ_COMMENT', 3); /** - * Group access code signifying members of the group can both - * read items posted to the group as well as post new items + * Group access code signifying members of the group can both + * read items posted to the group as well as post new items */ define('GROUP_READ_WRITE', 4); /** - * Indicates a group where people can't up and down vote threads + * Indicates a group where people can't up and down vote threads */ define("NON_VOTING_GROUP", 0); /** - * Indicates a group where people can up and down vote threads + * Indicates a group where people can up and down vote threads */ define("VOTING_GROUP", 1); /** - * Typical posts to a group feed are on user created threads and - * so are of this type + * Typical posts to a group feed are on user created threads and + * so are of this type */ define('STANDARD_GROUP_ITEM', 0); /** - * Indicates the thread was created to go alongside the creation of a wiki - * page so that people can discuss the pages contents + * Indicates the thread was created to go alongside the creation of a wiki + * page so that people can discuss the pages contents */ define('WIKI_GROUP_ITEM', 1); /** diff --git a/configs/configure_tool.php b/configs/configure_tool.php index 4dc19eb7d..e97c64291 100644 --- a/configs/configure_tool.php +++ b/configs/configure_tool.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Used to create and manipulate a profile and work directory from the * command-line for Yioop. @@ -386,8 +386,8 @@ class ConfigureTool return "nameServer"; } /** - * Used to set up the name of this instance of the Yioop robot as well - * as its description page. + * Used to set up the name of this instance of the Yioop robot as well + * as its description page. */ function robotSetUp() { @@ -435,12 +435,12 @@ class ConfigureTool return "robotSetUp"; } /** - * Used to select to confirm, cancel, or re-enter the last profile - * change + * Used to select to confirm, cancel, or re-enter the last profile + * change * - * @param string admin method to call if confirmed - * @param string $reenter_method , return value if reenter chosen - * @return string menu name to do to next + * @param string $admin_method to call if confirmed + * @param string $reenter_method , return value if reenter chosen + * @return string menu name to do to next */ function confirmChange($admin_method, $reenter_method) { @@ -484,12 +484,12 @@ class ConfigureTool return $next_menu; } /** - * Draws a list of options to the screen and gets a choice - * from this list from the user. + * Draws a list of options to the screen and gets a choice + * from this list from the user. * - * @param array $items as associative array (return value => description) - * @param string $currentView value to return if invalid choice made - * @return string a choice from the user + * @param array $items as associative array (return value => description) + * @param string $currentView value to return if invalid choice made + * @return string a choice from the user */ function drawChooseItems($items, $currentView) { @@ -517,7 +517,7 @@ class ConfigureTool } } /** - * Prints the banner used by this configuration tool + * Prints the banner used by this configuration tool */ function banner() { @@ -553,7 +553,7 @@ class ConfigureTool * * @param array $data an array of profile and other fields * @return array a new array containing a copy of just the profile fields - * from the orginal array + * from the orginal array */ function copyProfileFields($data) { diff --git a/configs/createdb.php b/configs/createdb.php index e82f1dfb0..a66d2a79f 100755 --- a/configs/createdb.php +++ b/configs/createdb.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * This script can be used to set up the database and filesystem for the * seekquarry database system. The SeekQuarry system is deployed with a diff --git a/configs/token_tool.php b/configs/token_tool.php index 1087753b0..2dea9a6ff 100644 --- a/configs/token_tool.php +++ b/configs/token_tool.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * token_tool is used to create suggest word dictionaries and 'n' word gram * filter files for the Yioop! search engine. @@ -29,7 +29,7 @@ * * * @author Ravi Dhillon ravi.dhillon@yahoo.com, Chris Pollett (modified for n - * ngrams) + * ngrams) * @package seek_quarry * @license http://www.gnu.org/licenses/ GPL3 * @link http://www.seekquarry.com/ @@ -48,12 +48,12 @@ define("BASE_DIR", substr( /** Load in global configuration settings */ require_once BASE_DIR.'/configs/config.php'; /** - * Contains makeNWordGramsTextFile and - * and makeNWordGramsFilterFile used to create the bloom filter + * Contains makeNWordGramsTextFile and + * and makeNWordGramsFilterFile used to create the bloom filter */ require_once BASE_DIR."/lib/nword_grams.php"; /** - * Contains Trie Class used to store suggest terms + * Contains Trie Class used to store suggest terms */ require_once BASE_DIR."/lib/trie.php"; /** @@ -197,7 +197,7 @@ if(!PROFILE) { * is run and writes it into the resources folder of the given locale * * @param array $args command line arguments with first two elements of $argv - * removed. For details on which arguments do what see the $usage variable + * removed. For details on which arguments do what see the $usage variable */ function makeNWordGramsFiles($args) { @@ -262,9 +262,9 @@ function makeSuggestTrie($dict_file, $locale, $end_marker) $trie = new Trie($end_marker); /** Ignore the words in the following cases. If the word - * - contains punctuation - * - is less than 3 characters - * - is a stop word + * - contains punctuation + * - is less than 3 characters + * - is a stop word */ foreach($words as $word) { if(mb_ereg_match("\p{P}", $word) == 0 && mb_strlen($word) > 2) { diff --git a/controllers/admin_controller.php b/controllers/admin_controller.php index df28a740f..72611d601 100755 --- a/controllers/admin_controller.php +++ b/controllers/admin_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -256,7 +256,7 @@ class AdminController extends Controller implements CrawlConstants * This is called from {@link processRequest()} once a user is logged in. * * @return array $data the results of doing the activity for display in the - * view + * view */ function processSession() { @@ -340,8 +340,8 @@ class AdminController extends Controller implements CrawlConstants * current web crawl * * @return array $data contains crawl status of current crawl as well as - * info about prior crawls and which crawl is being used for default - * search results + * info about prior crawls and which crawl is being used for default + * search results */ function crawlStatus() { @@ -389,10 +389,10 @@ class AdminController extends Controller implements CrawlConstants * of the machines managed by this Yioop instance and then passes * this data the the machinestatus view. * @return array $data MACHINES field has information about each - * machine managed by this Yioop instance as well the on off - * status of its queue_servers and fetchers. - * The REFRESH field is used to tell the controller that the - * view shouldn't have its own sidemenu. + * machine managed by this Yioop instance as well the on off + * status of its queue_servers and fetchers. + * The REFRESH field is used to tell the controller that the + * view shouldn't have its own sidemenu. */ function machineStatus() { @@ -413,11 +413,11 @@ class AdminController extends Controller implements CrawlConstants /** * Used to update the yioop installation profile based on $_REQUEST data * - * @param array &$data field data to be sent to the view - * @param array &$profile used to contain the current and updated profile - * field values + * @param array& $data field data to be sent to the view + * @param array& $profile used to contain the current and updated profile + * field values * @param array $check_box_fields fields whose data comes from a html - * checkbox + * checkbox */ function updateProfileFields(&$data, &$profile, $check_box_fields = array()) { @@ -453,21 +453,21 @@ class AdminController extends Controller implements CrawlConstants } } /** - * Used to set up view data for table search form (might make use of - * $_REQUEST if form was submitted, results gotten, and we want to preserve - * form drop down). Table search forms - * are used by manageUsers, manageRoles, manageGroups, to do advanced - * search of the entity they are responsible for. + * Used to set up view data for table search form (might make use of + * $_REQUEST if form was submitted, results gotten, and we want to preserve + * form drop down). Table search forms + * are used by manageUsers, manageRoles, manageGroups, to do advanced + * search of the entity they are responsible for. * - * @param array &$data modified to contain the field data needed for - * the view to draw the search form - * @param array $comparison_fields those fields of the entity - * in question ( for example, users) which we can search both with - * string comparison operators and equality operators - * @param array $equal_comparison_fields those fields of the entity in - * question which can only be search by equality/inequality operators - * @param string $field_postfix suffix to append onto field names in - * case there are multiple forms on the same page + * @param array& $data modified to contain the field data needed for + * the view to draw the search form + * @param array $comparison_fields those fields of the entity + * in question ( for example, users) which we can search both with + * string comparison operators and equality operators + * @param array $equal_comparison_fields those fields of the entity in + * question which can only be search by equality/inequality operators + * @param string $field_postfix suffix to append onto field names in + * case there are multiple forms on the same page */ function tableSearchRequestHandler(&$data, $comparison_fields = array(), $equal_comparison_fields = array(), $field_postfix = "") diff --git a/controllers/archive_controller.php b/controllers/archive_controller.php index 968cc5bee..0af31b7bf 100755 --- a/controllers/archive_controller.php +++ b/controllers/archive_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/controllers/classifier_controller.php b/controllers/classifier_controller.php index 5ad89a4a9..4e99caee7 100644 --- a/controllers/classifier_controller.php +++ b/controllers/classifier_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -94,7 +94,6 @@ class ClassifierController extends Controller implements CrawlConstants if (isset($_REQUEST['index'])) { $index = $this->clean($_REQUEST['index'], 'int'); if (intval($index) == 1) { - // TODO Fail in case that there's no current index $index = $this->model("crawl")->getCurrentIndexDatabaseName(); } $source_type = $this->clean($_REQUEST['type'], 'string'); @@ -220,12 +219,12 @@ class ClassifierController extends Controller implements CrawlConstants * on. * * @param string $label class label of the classifier the new crawl mix - * will be associated with + * will be associated with * @param int $crawl_time timestamp of the index to be iterated over * @param string $keywords an optional query used to restrict the pages - * retrieved by the crawl mix + * retrieved by the crawl mix * @return object A MixArchiveBundleIterator instance that will iterate - * over the pages of the requested index + * over the pages of the requested index */ function buildClassifierCrawlMix($label, $crawl_time, $keywords) { @@ -262,9 +261,9 @@ class ClassifierController extends Controller implements CrawlConstants * previous one left off. * * @param string $label class label of the classifier this crawl mix is - * associated with + * associated with * @return object new MixArchiveBundleIterator instance that picks up where - * the previous one left off + * the previous one left off */ function retrieveClassifierCrawlMix($label) { @@ -278,13 +277,13 @@ class ClassifierController extends Controller implements CrawlConstants * * @param array $page original page summary array * @param float $score classification score (estimated by the Naive Bayes - * text classification algorithm) for $page + * text classification algorithm) for $page * @param float $disagreement disagreement score computed for $page * @param int $crawl_time index the page came from * @param string $keywords query supplied to the crawl mix used to find - * $page + * $page * @return array reduced page summary structure containing only the - * information that the client needs to display a summary of the page + * information that the client needs to display a summary of the page */ function prepareUnlabelledDocument($page, $score, $disagreement, $crawl_time, $keywords) diff --git a/controllers/components/accountaccess_component.php b/controllers/components/accountaccess_component.php index aa10b9f1d..e2b7cf696 100644 --- a/controllers/components/accountaccess_component.php +++ b/controllers/components/accountaccess_component.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -202,7 +202,7 @@ class AccountaccessComponent extends Component * deleted and allows roles to be added to/deleted from a user * * @return array $data infomation about users of the system, roles, etc. - * as well as status messages on performing a given sub activity + * as well as status messages on performing a given sub activity */ function manageUsers() { @@ -558,13 +558,13 @@ class AccountaccessComponent extends Component return $data; } /** - * Uses $_REQUEST and $user_id to look up all the roles that a user - * has subject to $_REQUEST['role_limit'] and $_REQUEST['role_filter']. - * Information about these roles is added as fields to - * $data[NUM_USER_ROLES'] and $data['USER_ROLES'] + * Uses $_REQUEST and $user_id to look up all the roles that a user + * has subject to $_REQUEST['role_limit'] and $_REQUEST['role_filter']. + * Information about these roles is added as fields to + * $data[NUM_USER_ROLES'] and $data['USER_ROLES'] * - * @param array &$data data for the manageUsers view. - * @param int $user_id user to look up roles for + * @param array& $data data for the manageUsers view. + * @param int $user_id user to look up roles for */ function getUserRolesData(&$data, $user_id) { @@ -599,13 +599,13 @@ class AccountaccessComponent extends Component $role_limit); } /** - * Uses $_REQUEST and $user_id to look up all the groups that a user - * belongs to subject to $_REQUEST['group_limit'] and - * $_REQUEST['group_filter']. Information about these roles is added as - * fields to $data[NUM_USER_GROUPS'] and $data['USER_GROUPS'] + * Uses $_REQUEST and $user_id to look up all the groups that a user + * belongs to subject to $_REQUEST['group_limit'] and + * $_REQUEST['group_filter']. Information about these roles is added as + * fields to $data[NUM_USER_GROUPS'] and $data['USER_GROUPS'] * - * @param array &$data data for the manageUsers view. - * @param int $user_id user to look up roles for + * @param array& $data data for the manageUsers view. + * @param int $user_id user to look up roles for */ function getUserGroupsData(&$data, $user_id) { @@ -646,7 +646,7 @@ class AccountaccessComponent extends Component * deleted and allows activities to be added to/deleted from a role * * @return array $data information about roles in the system, activities, - * etc. as well as status messages on performing a given sub activity + * etc. as well as status messages on performing a given sub activity * */ function manageRoles() diff --git a/controllers/components/component.php b/controllers/components/component.php index 6dae1a371..5e91567dd 100644 --- a/controllers/components/component.php +++ b/controllers/components/component.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -52,13 +52,14 @@ class Component var $parent = NULL; /** - * Sets up this component by storing in its parent field a reference to - * controller this component lives on + * Sets up this component by storing in its parent field a reference to + * controller this component lives on * - * @param object reference to the controller this component lives on + * @param object $parent_controller reference to the controller this + * component lives on */ function __construct($parent_controller) { $this->parent = $parent_controller; } -} \ No newline at end of file +} diff --git a/controllers/components/crawl_component.php b/controllers/components/crawl_component.php index 00a481900..f9ced4729 100644 --- a/controllers/components/crawl_component.php +++ b/controllers/components/crawl_component.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -52,7 +52,7 @@ class CrawlComponent extends Component implements CrawlConstants * by which a crawl is conducted * * @return array $data information and statistics about crawls in the system - * as well as status messages on performing a given sub activity + * as well as status messages on performing a given sub activity */ function manageCrawls() { @@ -170,9 +170,11 @@ class CrawlComponent extends Component implements CrawlConstants * Called from @see manageCrawls to start a new crawl on the machines * $machine_urls. Updates $data array with crawl start message * - * @param array &$data an array of info to supply to AdminView + * @param array& $data an array of info to supply to AdminView * @param array $machine_urls string urls of machines managed by this - * Yioop name server on which to perform the crawl + * Yioop name server on which to perform the crawl + * @param array $seed_info allowed, disallowed, seed urls, etc to use in + * crawl */ function startCrawl(&$data, $machine_urls, $seed_info = NULL) { @@ -233,7 +235,7 @@ class CrawlComponent extends Component implements CrawlConstants * Reads the parameters for a crawl from an array gotten from a crawl.ini * file * - * @param array &$crawl_params parameters to write to queue_server + * @param array& $crawl_params parameters to write to queue_server * @param array $seed_info data from crawl.ini file */ function getCrawlParametersFromSeedInfo(&$crawl_params, $seed_info) @@ -305,9 +307,9 @@ class CrawlComponent extends Component implements CrawlConstants * crawl (or current crawl) to be carried out by the machines * $machine_urls. Updates $data array to be supplied to AdminView * - * @param array &$data an array of info to supply to AdminView + * @param array& $data an array of info to supply to AdminView * @param array $machine_urls string urls of machines managed by this - * Yioop name server on which to perform the crawl + * Yioop name server on which to perform the crawl */ function editCrawlOption(&$data, $machine_urls) { @@ -682,9 +684,9 @@ class CrawlComponent extends Component implements CrawlConstants * * @param array $data data to be passed on to the view * @param array $classifiers map from class labels to their associated - * classifiers + * classifiers * @param array $machine_urls string urls of machines managed by this - * Yioop name server + * Yioop name server */ function editClassifier(&$data, $classifiers, $machine_urls) { @@ -1253,7 +1255,7 @@ class CrawlComponent extends Component implements CrawlConstants * filtered out the search results * * @return array $data info about the groups and their contents for a - * particular crawl mix + * particular crawl mix */ function resultsEditor() { @@ -1338,7 +1340,7 @@ class CrawlComponent extends Component implements CrawlConstants * appear on the SearchView page * * @return array $data info about current search sources, and current - * sub-searches + * sub-searches */ function searchSources() { diff --git a/controllers/components/social_component.php b/controllers/components/social_component.php index 6cb10dce2..f5e917d7e 100644 --- a/controllers/components/social_component.php +++ b/controllers/components/social_component.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -34,12 +34,12 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Provides activities to AdminController related to creating, updating - * blogs (and blog entries), static web pages, and crawl mixes. + * Provides activities to AdminController related to creating, updating + * blogs (and blog entries), static web pages, and crawl mixes. * - * @author Chris Pollett - * @package seek_quarry - * @subpackage component + * @author Chris Pollett + * @package seek_quarry + * @subpackage component */ class SocialComponent extends Component implements CrawlConstants { @@ -447,13 +447,13 @@ class SocialComponent extends Component implements CrawlConstants } /** - * Uses $_REQUEST and $user_id to look up all the userss that a group - * has to subject to $_REQUEST['user_limit'] and - * $_REQUEST['user_filter']. Information about these roles is added as - * fields to $data[NUM_USERS_GROUP'] and $data['GROUP_USERS'] + * Uses $_REQUEST and $user_id to look up all the userss that a group + * has to subject to $_REQUEST['user_limit'] and + * $_REQUEST['user_filter']. Information about these roles is added as + * fields to $data[NUM_USERS_GROUP'] and $data['GROUP_USERS'] * - * @param array &$data data for the manageGroups view. - * @param int $user_id user to look up groups for + * @param array& $data data for the manageGroups view. + * @param int $group_id group to look up users for */ function getGroupUsersData(&$data, $group_id) { @@ -489,18 +489,18 @@ class SocialComponent extends Component implements CrawlConstants } /** - * Used by $this->manageGroups to check and clean $_REQUEST variables - * related to groups, to check that a user has the correct permissions - * if the current group is to be modfied, and if so, to call model to - * handle the update + * Used by $this->manageGroups to check and clean $_REQUEST variables + * related to groups, to check that a user has the correct permissions + * if the current group is to be modfied, and if so, to call model to + * handle the update * - * @param array &$data used to add any information messages for the view - * about changes or non-changes to the model - * @param array &$group current group which might be altered - * @param array $update_field which fields in the current group might be - * changed. Elements of this array are triples, the name of the - * group field, name of the request field to use for data, and an - * array of allowed values for the field + * @param array& $data used to add any information messages for the view + * about changes or non-changes to the model + * @param array& $group current group which might be altered + * @param array $update_fields which fields in the current group might be + * changed. Elements of this array are triples, the name of the + * group field, name of the request field to use for data, and an + * array of allowed values for the field */ function updateGroup(&$data, &$group, $update_fields) { @@ -544,10 +544,10 @@ class SocialComponent extends Component implements CrawlConstants } } /** - * Used to support requests related to posting, editing, modifying, - * and deleting group feed items. + * Used to support requests related to posting, editing, modifying, + * and deleting group feed items. * - * @return array $data fields to be used by GroupfeedElement + * @return array $data fields to be used by GroupfeedElement */ function groupFeeds() { @@ -893,7 +893,7 @@ class SocialComponent extends Component implements CrawlConstants * Handles requests to reading, editing, viewing history, reverting, etc * wiki pages * @return $data an associative array of form variables used to draw - * the appropriate wiki page + * the appropriate wiki page */ function wiki() { @@ -1200,13 +1200,13 @@ class SocialComponent extends Component implements CrawlConstants * Called to include the Javascript Wiki Editor (wiki.js) on a page * and to send any localizations needed from PHP to Javascript-land * - * @param array &$data an asscoiative array of data to be used by the - * view and layout that the wiki editor will be drawn on - * This method tacks on to INCLUDE_SCRIPTS to make the layout load - * wiki.js. + * @param array& $data an asscoiative array of data to be used by the + * view and layout that the wiki editor will be drawn on + * This method tacks on to INCLUDE_SCRIPTS to make the layout load + * wiki.js. * @param $id if "" then all textareas on page will get editor buttons - * otherwise just the on with $id will. (Can call this method - * multiple times, if want more than one but not all) + * otherwise just the on with $id will. (Can call this method + * multiple times, if want more than one but not all) */ function initializeWikiEditor(&$data, $id = "") { @@ -1267,8 +1267,8 @@ class SocialComponent extends Component implements CrawlConstants * weighted combinations of search indexes * * @return array $data info about available crawl mixes and changes to them - * as well as any messages about the success or failure of a - * sub activity. + * as well as any messages about the success or failure of a + * sub activity. */ function mixCrawls() { @@ -1452,7 +1452,7 @@ class SocialComponent extends Component implements CrawlConstants * Handles admin request related to the editing a crawl mix activity * * @param array $data info about the fragments and their contents for a - * particular crawl mix (changed by this method) + * particular crawl mix (changed by this method) */ function editMix(&$data) { diff --git a/controllers/components/system_component.php b/controllers/components/system_component.php index a7f345316..afdbc0335 100755 --- a/controllers/components/system_component.php +++ b/controllers/components/system_component.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -47,14 +47,14 @@ class SystemComponent extends Component { /** * Handles admin request related to the managing the machines which perform - * crawls + * crawls * * With this activity an admin can add/delete machines to manage. For each * managed machine, the admin can stop and start fetchers/queue_servers * as well as look at their log files * * @return array $data MACHINES, their MACHINE_NAMES, data for - * FETCHER_NUMBERS drop-down + * FETCHER_NUMBERS drop-down */ function manageMachines() { @@ -325,9 +325,9 @@ class SystemComponent extends Component * statistics about a locale as well as edit the string for that locale * * @return array $data info about current locales, statistics for each - * locale as well as potentially the currently set string of a - * locale and any messages about the success or failure of a - * sub activity. + * locale as well as potentially the currently set string of a + * locale and any messages about the success or failure of a + * sub activity. */ function manageLocales() { @@ -487,11 +487,11 @@ class SystemComponent extends Component return $data; } /** - * Handles admin panel requests for mail, database, tor, proxy server - * settings + * Handles admin panel requests for mail, database, tor, proxy server + * settings * - * @return array $data data for the view concerning the current settings - * so they can be displayed + * @return array $data data for the view concerning the current settings + * so they can be displayed */ function serverSettings() { @@ -719,7 +719,7 @@ EOD; * test info, as well as which machine acts as the queue server. * * @return array $data fields for available language, dbms, etc as well as - * results of processing sub activity if any + * results of processing sub activity if any */ function configure() { @@ -1000,7 +1000,7 @@ EOD; * Yioop! can run. * * @return string a message indicatign which required and optional - * components are missing; or "Passed" if nothing missing. + * components are missing; or "Passed" if nothing missing. */ function systemCheck() { diff --git a/controllers/controller.php b/controllers/controller.php index f91c0e23b..f24275b32 100755 --- a/controllers/controller.php +++ b/controllers/controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -85,10 +85,10 @@ abstract class Controller */ var $component_activities = array(); /** - * Associative array of activity => component activity is on, used - * by @see Controller::call method to actually invoke a given activity - * on a given component - * @var array + * Associative array of activity => component activity is on, used + * by @see Controller::call method to actually invoke a given activity + * on a given component + * @var array */ var $activity_component = array(); /** @@ -96,6 +96,12 @@ abstract class Controller * @var array */ var $indexing_plugins = array(); + /** + * Sets up component activities, instance array, and plugins. + * + * @param array $indexing_plugins which post processing indexing plugins + * are available + */ function __construct($indexing_plugins = array()) { global $INDEXED_FILE_TYPES, $COMPONENT_ACTIVITIES; @@ -112,7 +118,7 @@ abstract class Controller $this->view_instances = array(); } /** - * This function should be overriden to web handle requests + * This function should be overriden to web handle requests */ public abstract function processRequest(); /** @@ -198,12 +204,12 @@ abstract class Controller return $this->view_instances[$view]; } /** - * Send the provided view to output, drawing it with the given - * data variable, using the current locale for translation, and - * writing mode + * Send the provided view to output, drawing it with the given + * data variable, using the current locale for translation, and + * writing mode * - * @param string $view the name of the view to draw - * @param array $data an array of values to use in drawing the view + * @param string $view the name of the view to draw + * @param array $data an array of values to use in drawing the view */ function displayView($view, $data) { @@ -251,38 +257,38 @@ abstract class Controller $this->view($view)->render($data); } /** - * When an activity involves displaying tabular data (such as rows of - * users, groups, etc), this method might be called to set up $data - * fields for next, prev, and page links, it also makes the call to the - * model to get the row data sorted and restricted as desired. For some - * data sources, rather than directly make a call to the model to get the - * data it might be passed directly to this method. + * When an activity involves displaying tabular data (such as rows of + * users, groups, etc), this method might be called to set up $data + * fields for next, prev, and page links, it also makes the call to the + * model to get the row data sorted and restricted as desired. For some + * data sources, rather than directly make a call to the model to get the + * data it might be passed directly to this method. * - * @param array &$data used to send data to the view will be updated by - * this method with row and paging data - * @param mixed $field_or_model if an object, this is assumed to be a model - * and so the getRows method of this model is called to get row data, - * sorted and restricted according to $search_array; if a string - * then the row data is assumed to be in $data[$field_or_model] and - * pagingLogic itself does the sorting and restricting. - * @param string $output_field output rows for the view will be stored in - * $data[$output_field] - * @param int $default_show if not specified by $_REQUEST, then this will - * be used to determine the maximum number of rows that will be - * written to $data[$output_field] - * @param array $search_array used to sort and restrict in - * the getRows call or the data from $data[$field_or_model]. - * Each element of this is a quadruple name of a field, what comparison - * to perform, a value to check, and an order (ascending/descending) - * to sort by - * @param string $var_prefix if there are multiple uses of pagingLogic - * presented on the same view then $var_prefix can be prepended to - * to the $data field variables like num_show, start_row, end_row - * to distinguish between them - * @param array $args additional arguments that are passed to getRows and - * in turn to selectCallback, fromCallback, and whereCallback that - * might provide user_id, etc to further control which rows are - * returned + * @param array& $data used to send data to the view will be updated by + * this method with row and paging data + * @param mixed $field_or_model if an object, this is assumed to be a model + * and so the getRows method of this model is called to get row data, + * sorted and restricted according to $search_array; if a string + * then the row data is assumed to be in $data[$field_or_model] and + * pagingLogic itself does the sorting and restricting. + * @param string $output_field output rows for the view will be stored in + * $data[$output_field] + * @param int $default_show if not specified by $_REQUEST, then this will + * be used to determine the maximum number of rows that will be + * written to $data[$output_field] + * @param array $search_array used to sort and restrict in + * the getRows call or the data from $data[$field_or_model]. + * Each element of this is a quadruple name of a field, what comparison + * to perform, a value to check, and an order (ascending/descending) + * to sort by + * @param string $var_prefix if there are multiple uses of pagingLogic + * presented on the same view then $var_prefix can be prepended to + * to the $data field variables like num_show, start_row, end_row + * to distinguish between them + * @param array $args additional arguments that are passed to getRows and + * in turn to selectCallback, fromCallback, and whereCallback that + * might provide user_id, etc to further control which rows are + * returned */ function pagingLogic(&$data, $field_or_model, $output_field, $default_show, $search_array = array(), $var_prefix = "", $args = NULL) @@ -387,8 +393,8 @@ abstract class Controller $data[$d['NUM_TOTAL']] = $num_rows; } /** - * Used to invoke an activity method of the current controller or one - * its components + * Used to invoke an activity method of the current controller or one + * its components * * @param $activity method to invoke */ @@ -438,13 +444,13 @@ abstract class Controller return $token_okay; } /** - * Checks if the timestamp in $_REQUEST[$token_name] - * matches the timestamp of the last CSRF token accessed by this user. - * This is to avoid accidental replays of postings etc if the back button - * used. + * Checks if the timestamp in $_REQUEST[$token_name] + * matches the timestamp of the last CSRF token accessed by this user. + * This is to avoid accidental replays of postings etc if the back button + * used. * - * @param string $token_name name of a $_REQUEST field used to hold a - * CSRF_TOKEN + * @param string $token_name name of a $_REQUEST field used to hold a + * CSRF_TOKEN */ function checkCSRFTime($token_name) { @@ -464,8 +470,8 @@ abstract class Controller * @param mixed $value tainted data * @param string $type type of data in value: one of int, hash, or string * @param mixed $default if $value is not set default value is returned, - * this isn't used much since if the error_reporting is E_ALL - * or -1 you would still get a Notice. + * this isn't used much since if the error_reporting is E_ALL + * or -1 you would still get a Notice. * @return string the clean input matching the type provided */ function clean($value, $type, $default = NULL) @@ -543,7 +549,7 @@ abstract class Controller * * @param array $arr the array of lines to be process * @param string $endline_string what string should be used to indicate - * the end of a line + * the end of a line * @param bool $clean whether to clean each line * @return string a concatenated string of cleaned lines */ @@ -569,8 +575,8 @@ abstract class Controller * * @param string $str contains the url data * @param string $line_type does additional cleaning depending on the type - * of the lines. For instance, if is "url" then a line not beginning - * with a url scheme will have http:// prepended. + * of the lines. For instance, if is "url" then a line not beginning + * with a url scheme will have http:// prepended. * @return $lines an array of clean lines */ function convertStringCleanArray($str, $line_type="url") diff --git a/controllers/crawl_controller.php b/controllers/crawl_controller.php index 07d017f8e..a21d44b65 100644 --- a/controllers/crawl_controller.php +++ b/controllers/crawl_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -296,11 +296,11 @@ class CrawlController extends Controller implements CrawlConstants NULL); } /** - * A save point is used to store to disk a sequence generation-doc-offset - * pairs of a particular mix query when doing an archive crawl of a crawl - * mix. This is used so that the mix can remember where it was the next - * time it is invoked by the web app on the machine in question. - * This function deletes such a save point associated with a timestamp + * A save point is used to store to disk a sequence generation-doc-offset + * pairs of a particular mix query when doing an archive crawl of a crawl + * mix. This is used so that the mix can remember where it was the next + * time it is invoked by the web app on the machine in question. + * This function deletes such a save point associated with a timestamp */ function clearQuerySavePoint() { diff --git a/controllers/fetch_controller.php b/controllers/fetch_controller.php index 51701a059..613e9dda2 100755 --- a/controllers/fetch_controller.php +++ b/controllers/fetch_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -63,9 +63,9 @@ class FetchController extends Controller implements CrawlConstants var $activities = array("schedule", "archiveSchedule", "update", "crawlTime"); /** - * Number of seconds that must elapse after last call before doing - * cron activities (mainly check liveness of fetchers which should be - * alive) + * Number of seconds that must elapse after last call before doing + * cron activities (mainly check liveness of fetchers which should be + * alive) */ const CRON_INTERVAL = 300; /** @@ -242,7 +242,7 @@ class FetchController extends Controller implements CrawlConstants /** * Checks if the queue server crawl needs to be restarted * @param string $crawl_type if it does use restart the crawl as a crawl - * of this type. For example, self::WEB_CRAWL or self::ARCHIVE_CRAWL + * of this type. For example, self::WEB_CRAWL or self::ARCHIVE_CRAWL */ function checkRestart($crawl_type) { @@ -395,11 +395,11 @@ class FetchController extends Controller implements CrawlConstants * deleted. * * @param string $filename name of temp file used to upload big string. - * If uploaded data was small enough to be uploaded in one go, then - * this should be "" -- the variable $_REQUEST["part"] will be used - * instead + * If uploaded data was small enough to be uploaded in one go, then + * this should be "" -- the variable $_REQUEST["part"] will be used + * instead * @return string $logging diagnostic info to be sent to fetcher about - * what was done + * what was done */ function handleUploadedData($filename = "") { @@ -460,8 +460,8 @@ class FetchController extends Controller implements CrawlConstants * $time to a subfolder $day of a folder $dir * * @param string $schedule_name the name of the kind of schedule being saved - * @param string &$data_string encoded, compressed, serialized data the - * schedule is to contain + * @param string& $data_string encoded, compressed, serialized data the + * schedule is to contain */ function addScheduleToScheduleDirectory($schedule_name, &$data_string) { @@ -579,9 +579,9 @@ class FetchController extends Controller implements CrawlConstants $this->displayView($view, $data); } /** - * Used to do periodic maintenance tasks for the Name Server. - * For now, just checks if any fetchers which the user turned on - * have crashed and if so restarts them + * Used to do periodic maintenance tasks for the Name Server. + * For now, just checks if any fetchers which the user turned on + * have crashed and if so restarts them */ function doCronTasks() { diff --git a/controllers/group_controller.php b/controllers/group_controller.php index e79c33687..4110b832f 100644 --- a/controllers/group_controller.php +++ b/controllers/group_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -39,8 +39,8 @@ require_once BASE_DIR."/lib/crawl_constants.php"; require_once BASE_DIR."/lib/wiki_parser.php"; /** * Controller used to handle user group activities outside of - * the admin panel setting. This either could be because the admin panel - * is "collapsed" or because the request concerns a wiki page. + * the admin panel setting. This either could be because the admin panel + * is "collapsed" or because the request concerns a wiki page. * * @author Chris Pollett * @package seek_quarry @@ -56,9 +56,9 @@ class GroupController extends Controller implements CrawlConstants */ var $activities = array("groupFeeds", "wiki"); /** - * Used to process requests related to user group activities outside of - * the admin panel setting. This either could be because the admin panel - * is "collapsed" or because the request concerns a wiki page. + * Used to process requests related to user group activities outside of + * the admin panel setting. This either could be because the admin panel + * is "collapsed" or because the request concerns a wiki page. */ function processRequest() { @@ -143,11 +143,11 @@ class GroupController extends Controller implements CrawlConstants * sets up any particular $data fields needed for displaying that * view correctly. * - * @param string $format can be one of rss, json, or serialize, - * if different, default HTML GroupView used. - * @param string &$view variable used to set the view in calling - * method - * @param array &$data used to send data to the view for drawing + * @param string $format can be one of rss, json, or serialize, + * if different, default HTML GroupView used. + * @param string& $view variable used to set the view in calling + * method + * @param array& $data used to send data to the view for drawing */ function setupViewFormatOutput($format, &$view, &$data) { diff --git a/controllers/machine_controller.php b/controllers/machine_controller.php index 66c04aac9..47aee0d3d 100644 --- a/controllers/machine_controller.php +++ b/controllers/machine_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -122,8 +122,8 @@ class MachineController extends Controller implements CrawlConstants } } /** - * Used to retrieve a fetcher/queue_server logfile for the the current - * Yioop instance + * Used to retrieve a fetcher/queue_server logfile for the the current + * Yioop instance */ function log() { diff --git a/controllers/register_controller.php b/controllers/register_controller.php index 999224c49..7400d5c94 100755 --- a/controllers/register_controller.php +++ b/controllers/register_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base controller class, if needed + * Load base controller class, if needed */ require_once BASE_DIR."/controllers/controller.php"; /** @@ -113,8 +113,8 @@ class RegisterController extends Controller implements CrawlConstants */ const HASH_CAPTCHA_LEVEL = 2; /** - * Besides invoking the base controller, sets up in field variables - * the captcha and recovery question and possible answers. + * Besides invoking the base controller, sets up in field variables + * the captcha and recovery question and possible answers. */ function __construct() { @@ -167,11 +167,11 @@ class RegisterController extends Controller implements CrawlConstants parent::__construct(); } /** - * Main entry method for this controller. Determine which account - * creation/recovery activity needs to be performed. Calls the - * appropriate method, then sends the return $data to a view - * determined by that activity. $this->displayView then renders that - * view + * Main entry method for this controller. Determine which account + * creation/recovery activity needs to be performed. Calls the + * appropriate method, then sends the return $data to a view + * determined by that activity. $this->displayView then renders that + * view */ function processRequest() { @@ -282,12 +282,12 @@ class RegisterController extends Controller implements CrawlConstants $this->displayView($view, $data); } /** - * Sets up the form variables need to present the initial account creation - * form. If this form is submitted with missing fields, this method - * would also be called to set up an appropriate MISSING field + * Sets up the form variables need to present the initial account creation + * form. If this form is submitted with missing fields, this method + * would also be called to set up an appropriate MISSING field * - * @return array $data field correspond to values needed for account - * creation form + * @return array $data field correspond to values needed for account + * creation form */ function createAccount() { @@ -295,15 +295,15 @@ class RegisterController extends Controller implements CrawlConstants return $data; } /** - * Used to process account data from completely filled in create account - * forms. Depending on the registration type: no_activation, - * email registration, or admin activation, either the account is - * immediately activated or it is created in an active state and an email - * to the person who could activate it is sent. + * Used to process account data from completely filled in create account + * forms. Depending on the registration type: no_activation, + * email registration, or admin activation, either the account is + * immediately activated or it is created in an active state and an email + * to the person who could activate it is sent. * - * @return array $data will contain a SCRIPT field with the - * Javascript doMessage call saying whether this step was successful - * or not + * @return array $data will contain a SCRIPT field with the + * Javascript doMessage call saying whether this step was successful + * or not */ function processAccountData() { @@ -401,12 +401,12 @@ class RegisterController extends Controller implements CrawlConstants return $data; } /** - * Used to verify the email sent to a user try to set up an account. - * If the email is legit the account is activated + * Used to verify the email sent to a user try to set up an account. + * If the email is legit the account is activated * - * @return array $data will contain a SCRIPT field with the - * Javascript doMessage call saying whether verification was - * successful or not + * @return array $data will contain a SCRIPT field with the + * Javascript doMessage call saying whether verification was + * successful or not */ function emailVerification() { @@ -458,12 +458,12 @@ class RegisterController extends Controller implements CrawlConstants return $data; } /** - * Sets up the form variables need to present the initial recover account - * form. If this form is submitted with missing fields, this method - * would also be called to set up an appropriate MISSING field + * Sets up the form variables need to present the initial recover account + * form. If this form is submitted with missing fields, this method + * would also be called to set up an appropriate MISSING field * - * @return array $data field correspond to values needed for account - * recovery form + * @return array $data field correspond to values needed for account + * recovery form */ function recoverPassword() { @@ -472,14 +472,14 @@ class RegisterController extends Controller implements CrawlConstants return $data; } /** - * Called with the data from the initial recover form was completely - * provided and captcha was correct. This method - * sends the recover email provided the account had - * recover questions set otherwise sets up an error message. + * Called with the data from the initial recover form was completely + * provided and captcha was correct. This method + * sends the recover email provided the account had + * recover questions set otherwise sets up an error message. * - * @return array $data will contain a SCRIPT field with the - * Javascript doMessage call saying whether email sent or if there - * was a problem + * @return array $data will contain a SCRIPT field with the + * Javascript doMessage call saying whether email sent or if there + * was a problem */ function processRecoverData() { @@ -526,12 +526,12 @@ class RegisterController extends Controller implements CrawlConstants return $data; } /** - * This activity either verifies the recover email and sets up the - * appropriate data for a change password form or it verifies the - * change password form data and changes the password. If verifications - * error messages are set up + * This activity either verifies the recover email and sets up the + * appropriate data for a change password form or it verifies the + * change password form data and changes the password. If verifications + * error messages are set up * - * @return array form data to be used by recover or signin views + * @return array form data to be used by recover or signin views */ function recoverComplete() { @@ -635,12 +635,12 @@ class RegisterController extends Controller implements CrawlConstants return $data; } /** - * Used to handle data from the suggest-a-url to crawl form - * (suggest_view.php). Basically, it saves any data submitted to - * a file which can then be imported in manageCrawls + * Used to handle data from the suggest-a-url to crawl form + * (suggest_view.php). Basically, it saves any data submitted to + * a file which can then be imported in manageCrawls * - * @return array $data contains fields with the current value for - * the url (if set but not submitted) as well as for a captcha + * @return array $data contains fields with the current value for + * the url (if set but not submitted) as well as for a captcha */ function suggestUrl() { @@ -823,12 +823,12 @@ class RegisterController extends Controller implements CrawlConstants return $data; } /** - * Sets up the captcha question and or recovery questions in a $data - * associative array so that they can be drawn by the register or recover - * views. + * Sets up the captcha question and or recovery questions in a $data + * associative array so that they can be drawn by the register or recover + * views. * - * @return array $data associate array with field to help the register and - * recover view draw themselves + * @return array $data associate array with field to help the register and + * recover view draw themselves */ function setupQuestionViewData() { @@ -894,9 +894,9 @@ class RegisterController extends Controller implements CrawlConstants * Sets up the graphical captcha view * Draws the string for graphical captcha * - * @param array &$data used by view to draw any dynamic content - * in this case we append a field "CAPTCHA_IMAGE" with a data - * url of the captcha to draw. + * @param array& $data used by view to draw any dynamic content + * in this case we append a field "CAPTCHA_IMAGE" with a data + * url of the captcha to draw. */ function setupGraphicalCaptchaViewData(&$data) { @@ -920,24 +920,24 @@ class RegisterController extends Controller implements CrawlConstants $this->model("captcha")->makeGraphicalCaptcha($word); } /** - * Picks $num_select most/least questions from an array of triplets of - * the form a string question: Which is the most ..?, a string - * question: Which is the least ..?, followed by a comma separated list - * of choices ranked from least to most. For each question pick, - * $num_choices many items from the last element of the triplet are - * chosen. + * Picks $num_select most/least questions from an array of triplets of + * the form a string question: Which is the most ..?, a string + * question: Which is the least ..?, followed by a comma separated list + * of choices ranked from least to most. For each question pick, + * $num_choices many items from the last element of the triplet are + * chosen. * - * @param array $questions_answers an array t_1, t_2, t_3, t_4, where - * each t_i is an associative array containing the most - * and least arrays as described above - * @param int $num_select number of triples from the list to pick - * for each triple pick either the most question or the least - * question - * @param int $num_choices from the list component of a triplet we - * we pick this many elements - * @return array a pair consisting of an array of questions and possible - * choice for least/most, and another array of the correct answers - * to the least/most problem. + * @param array $question_answers an array t_1, t_2, t_3, t_4, where + * each t_i is an associative array containing the most + * and least arrays as described above + * @param int $num_select number of triples from the list to pick + * for each triple pick either the most question or the least + * question + * @param int $num_choices from the list component of a triplet we + * we pick this many elements + * @return array a pair consisting of an array of questions and possible + * choice for least/most, and another array of the correct answers + * to the least/most problem. */ function selectQuestionsAnswers($question_answers, $num_select, $num_choices = -1) @@ -984,20 +984,20 @@ class RegisterController extends Controller implements CrawlConstants return array($questions, $answers); } /** - * Used to select which activity a controller will do. If the $activity - * is $activity_success, then this method checks the prereqs for - * $activity_success. If they are not met then the view $data array is - * updated with an error message and $activity_fail is set to be the - * next activity. If the prereq is met then the $activity is left as - * $activity_success. If $activity was not initially equal to - * $activity_success then this method does nothing. + * Used to select which activity a controller will do. If the $activity + * is $activity_success, then this method checks the prereqs for + * $activity_success. If they are not met then the view $data array is + * updated with an error message and $activity_fail is set to be the + * next activity. If the prereq is met then the $activity is left as + * $activity_success. If $activity was not initially equal to + * $activity_success then this method does nothing. * - * @param string &$activity current tentative activity - * @param string $activity_success activity to test for and to test prereqs - * for. - * @param string $activity_fail if prereqs not met which acitivty to switch - * to - * @param array &$data data to help render the view this controller draws + * @param string& $activity current tentative activity + * @param string $activity_success activity to test for and to test prereqs + * for. + * @param string $activity_fail if prereqs not met which acitivty to switch + * to + * @param array& $data data to help render the view this controller draws */ function preactivityPrerequisiteCheck(&$activity, $activity_success, $activity_fail, &$data) @@ -1058,12 +1058,12 @@ class RegisterController extends Controller implements CrawlConstants } } /** - * Add SCRIPT tags for errors to the view $data array if there were any - * missing fields on a create account or recover account form. - * also adds error info if try to create an existing using. + * Add SCRIPT tags for errors to the view $data array if there were any + * missing fields on a create account or recover account form. + * also adds error info if try to create an existing using. * - * @param array &$data contains info for the view on which the above - * forms are to be drawn. + * @param array& $data contains info for the view on which the above + * forms are to be drawn. */ function dataIntegrityCheck(&$data) { @@ -1089,10 +1089,10 @@ class RegisterController extends Controller implements CrawlConstants } } /** - * Checks whether the answers to the captcha question presented to a user - * are all correct or if any were mis-answered + * Checks whether the answers to the captcha question presented to a user + * are all correct or if any were mis-answered * - * @return bool true if only if all were correct + * @return bool true if only if all were correct */ function checkCaptchaAnswers() { @@ -1107,11 +1107,11 @@ class RegisterController extends Controller implements CrawlConstants return $captcha_passed; } /** - * Checks whether the answers to the account recovery questions match + * Checks whether the answers to the account recovery questions match * those provided earlier by an account user * - * @param array $user who to check recovery answers for - * @return bool true if only if all were correct + * @param array $user who to check recovery answers for + * @return bool true if only if all were correct */ function checkRecoveryQuestions($user) { @@ -1132,17 +1132,17 @@ class RegisterController extends Controller implements CrawlConstants return $recovery_passed; } /** - * Used to clean the inputs for form variables - * for creating/recovering an account. It also puts - * in blank values for missing fields into a "MISSING" - * array + * Used to clean the inputs for form variables + * for creating/recovering an account. It also puts + * in blank values for missing fields into a "MISSING" + * array * - * @param array &$data an array of data to be sent to the view - * After this method is done it will have cleaned versions - * of the $_REQUEST variables from create or recover account - * forms as well as a "MISSING" field which is an array of - * those items which did not have values on the create/recover - * account form + * @param array& $data an array of data to be sent to the view + * After this method is done it will have cleaned versions + * of the $_REQUEST variables from create or recover account + * forms as well as a "MISSING" field which is an array of + * those items which did not have values on the create/recover + * account form */ function getCleanFields(&$data) { @@ -1212,12 +1212,12 @@ class RegisterController extends Controller implements CrawlConstants $data['MISSING'] = $missing; } /** - * Calculates the sha1 of a string consist of a randomString,request_time - * send by a server and the nonce send by a client.It checks - * whether the sha1 produces expected number of a leading zeroes + * Calculates the sha1 of a string consist of a randomString,request_time + * send by a server and the nonce send by a client.It checks + * whether the sha1 produces expected number of a leading zeroes * - * @return bool true if the sha1 produces expected number - * of a leading zeroes. + * @return bool true if the sha1 produces expected number + * of a leading zeroes. */ function validateHashCode() { diff --git a/controllers/resource_controller.php b/controllers/resource_controller.php index 59215d609..8a94fc442 100644 --- a/controllers/resource_controller.php +++ b/controllers/resource_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -38,7 +38,7 @@ require_once BASE_DIR."/lib/crawl_constants.php"; /** Loads url_parser to clean resource name*/ require_once BASE_DIR."/lib/url_parser.php"; /** - * Used to serve resources, css, or scripts such as images from APP_DIR + * Used to serve resources, css, or scripts such as images from APP_DIR * * @author Chris Pollett * @package seek_quarry @@ -138,8 +138,8 @@ class ResourceController extends Controller implements CrawlConstants } } /** - * Used to notify a machine that another machine acting as a mirror - * is still alive. Data is stored in a txt file self::mirror_table_name + * Used to notify a machine that another machine acting as a mirror + * is still alive. Data is stored in a txt file self::mirror_table_name */ function syncNotify() { diff --git a/controllers/search_controller.php b/controllers/search_controller.php index 9e99f69e2..54094818d 100755 --- a/controllers/search_controller.php +++ b/controllers/search_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -172,18 +172,18 @@ class SearchController extends Controller implements CrawlConstants $this->displayView($view, $data); } /** - * Determines how this query is being run and return variables for the view + * Determines how this query is being run and return variables for the view * - * A query might be run as a web-based where HTML is expected as the - * output, an RSS query, an API query, or as a serial query from a - * name_server or mirror instance back to one of the other queue servers - * in a Yioop installation. A query might also request different numbers - * of pages back beginning at different starting points in the result. + * A query might be run as a web-based where HTML is expected as the + * output, an RSS query, an API query, or as a serial query from a + * name_server or mirror instance back to one of the other queue servers + * in a Yioop installation. A query might also request different numbers + * of pages back beginning at different starting points in the result. * - * @return array consisting of (view to be used to render results, - * flag for whether html results should be used, int code for what - * kind of group of similar urls should be done on the results, - * number of search results to return, start from which result) + * @return array consisting of (view to be used to render results, + * flag for whether html results should be used, int code for what + * kind of group of similar urls should be done on the results, + * number of search results to return, start from which result) */ function initializeResponseFormat() { @@ -217,14 +217,14 @@ class SearchController extends Controller implements CrawlConstants return array($view, $web_flag, $raw, $results_per_page, $limit); } /** - * Determines if query results are using a subsearch, and if so - * initializes them, also it sets up list of subsearches to draw - * at top of screen. + * Determines if query results are using a subsearch, and if so + * initializes them, also it sets up list of subsearches to draw + * at top of screen. * - * @return array (subsearches, no_query) where subsearches is itself - * an array of data about each subsearch to draw, and no_query - * is a bool flag used in the case of a news subsearch when no query - * was entered by the user but still want to display news + * @return array (subsearches, no_query) where subsearches is itself + * an array of data about each subsearch to draw, and no_query + * is a bool flag used in the case of a news subsearch when no query + * was entered by the user but still want to display news */ function initializeSubsearches() { @@ -264,18 +264,18 @@ class SearchController extends Controller implements CrawlConstants return array($subsearches, $no_query); } /** - * Determines the kind of user session that this search request is for + * Determines the kind of user session that this search request is for * - * This function is called by @see processRequest(). The user session - * might be one without a login, one with a login so need to validate - * against to prevent CSRF attacks, just after someone logged out, or - * a bot session (googlebot, etc) so remove the query request + * This function is called by @see processRequest(). The user session + * might be one without a login, one with a login so need to validate + * against to prevent CSRF attacks, just after someone logged out, or + * a bot session (googlebot, etc) so remove the query request * - * @param array &$data that will eventually be sent to the view. We might - * update with error messages - * @return array consisting of (query based on user info, whether - * if a cache request highlighting should be userd, what activity - * user wants, any arguments to this activity) + * @param array& $data that will eventually be sent to the view. We might + * update with error messages + * @return array consisting of (query based on user info, whether + * if a cache request highlighting should be userd, what activity + * user wants, any arguments to this activity) * */ function initializeUserAndDefaultActivity(&$data) @@ -343,21 +343,21 @@ class SearchController extends Controller implements CrawlConstants return array($query, $activity, $arg); } /** - * Determines which crawl or mix timestamp should be in use for this - * query. It also determines info and returns associated with this - * timestamp. + * Determines which crawl or mix timestamp should be in use for this + * query. It also determines info and returns associated with this + * timestamp. * - * @param bool $web_flag whether this is a web based query or one from - * the search API - * @param int and so should validate against list of known crawls or an - * internal (say network) query that doesn't require validation - * (faster without). - * @param array &$data that will eventually be sent to the view. We set - * the 'its' (index_time_stamp) field here - * @return array consisting of index timestamp of crawl or mix in use, - * $index_info an array of info about that index, and $save_timestamp - * timestamp of last savepoint, used if this query is being is the - * query for a crawl mix archive crawl. + * @param bool $web_flag whether this is a web based query or one from + * the search API + * @param int $raw and so should validate against list of known crawls or an + * internal (say network) query that doesn't require validation + * (faster without). + * @param array& $data that will eventually be sent to the view. We set + * the 'its' (index_time_stamp) field here + * @return array consisting of index timestamp of crawl or mix in use, + * $index_info an array of info about that index, and $save_timestamp + * timestamp of last savepoint, used if this query is being is the + * query for a crawl mix archive crawl. */ function initializeIndexInfo($web_flag, $raw, &$data) { @@ -467,18 +467,18 @@ class SearchController extends Controller implements CrawlConstants return ($query_okay) ? $query : ""; } /** - * Prepares the array $data so the SearchView can draw search results + * Prepares the array $data so the SearchView can draw search results * - * @param array $index_info an array of info about that index in use - * @param bool $no_query true in the case of a news subsearch when no query - * was entered by the user but still want to display news - * @param int $raw $raw what kind of grouping of identical results should - * be done (0 is default, 1 and higher used for internal queries) - * @param string $view name of view class search results are for - * @param array $subsearches an array of data about each subsearch to draw - * to the view - * @param array &$data that will eventually be sent to the view for - * rendering. This method adds fields to the array + * @param array $index_info an array of info about that index in use + * @param bool $no_query true in the case of a news subsearch when no query + * was entered by the user but still want to display news + * @param int $raw $raw what kind of grouping of identical results should + * be done (0 is default, 1 and higher used for internal queries) + * @param string $view name of view class search results are for + * @param array $subsearches an array of data about each subsearch to draw + * to the view + * @param array& $data that will eventually be sent to the view for + * rendering. This method adds fields to the array */ function addSearchViewData($index_info, $no_query, $raw, $view, $subsearches, &$data) @@ -518,8 +518,8 @@ class SearchController extends Controller implements CrawlConstants /* Only set up spell correction if single conjunctive query without without meta words */ - if(isset($data['QUERY']) && - !preg_match('/(\%7C|\%3A)/u', $data['QUERY'])) { + if(isset($data['QUERY']) && + !preg_match('/(\%7C|\%3A|%26quot%3B)/u', $data['QUERY'])) { $data['INCLUDE_SCRIPTS'] = array("suggest"); } if(!isset($data['SCRIPT'])) { @@ -579,34 +579,34 @@ class SearchController extends Controller implements CrawlConstants * Searches the database for the most relevant pages for the supplied search * terms. Renders the results to the HTML page. * - * @param array &$data an array of view data that will be updated to include - * at most results_per_page many search results + * @param array& $data an array of view data that will be updated to include + * at most results_per_page many search results * @param string $query a string containing the words to search on * @param string $activity besides a straight search for words query, - * one might have other searches, such as a search for related pages. - * this argument says what kind of search to do. + * one might have other searches, such as a search for related pages. + * this argument says what kind of search to do. * @param string $arg for a search other than a straight word query this - * argument provides auxiliary information on how to conduct the - * search. For instance on a related web page search, it might provide - * the url of the site with which to perform the related search. + * argument provides auxiliary information on how to conduct the + * search. For instance on a related web page search, it might provide + * the url of the site with which to perform the related search. * @param int $results_per_page the maixmum number of search results - * that can occur on a page + * that can occur on a page * @param int $limit the first page of all the pages with the query terms - * to return. For instance, if 10 then the tenth highest ranking page - * for those query terms will be return, then the eleventh, etc. + * to return. For instance, if 10 then the tenth highest ranking page + * for those query terms will be return, then the eleventh, etc. * @param int $index_name the timestamp of an index to use, if 0 then - * default used + * default used * @param int $raw ($raw == 0) normal grouping, $raw > 0 - * no grouping done on data. If $raw == 1 no summary returned (used - * with f=serial, end user probably does not want) - * In this case, will get offset, generation, etc so could later lookup + * no grouping done on data. If $raw == 1 no summary returned (used + * with f=serial, end user probably does not want) + * In this case, will get offset, generation, etc so could later lookup * @param mixed $save_timestamp if this timestamp is nonzero, then save - * iterate position, so can resume on future queries that make - * use of the timestamp. $save_time_stamp may also be in the format - * of string timestamp-query_part to handle networked queries involving - * presentations + * iterate position, so can resume on future queries that make + * use of the timestamp. $save_time_stamp may also be in the format + * of string timestamp-query_part to handle networked queries involving + * presentations * @param bool $limit_news if true the number of media:news items to - * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT + * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT */ function processQuery(&$data, $query, $activity, $arg, $results_per_page, $limit = 0, $index_name = 0, $raw = 0, $save_timestamp = 0, @@ -737,18 +737,18 @@ class SearchController extends Controller implements CrawlConstants $data['RESULTS_PER_PAGE'] = $results_per_page; } /** - * Extracts from the query string any control words: - * mix:, m:, raw:, no: and returns an array consisting - * of the query with these words removed, and then variables - * for their values. + * Extracts from the query string any control words: + * mix:, m:, raw:, no: and returns an array consisting + * of the query with these words removed, and then variables + * for their values. * - * @param string $query original query string - * @param bool $raw the $_REQUEST['raw'] value - * @param bool if the current index name is that of a crawl mix - * @param string $index_name timestamp of current mix or index + * @param string $query original query string + * @param bool $raw the $_REQUEST['raw'] value + * @param bool $is_mix if the current index name is that of a crawl mix + * @param string $index_name timestamp of current mix or index * - * @return array ($query, $raw, $use_network, - * $use_cache_if_possible, $guess_semantics) + * @return array ($query, $raw, $use_network, + * $use_cache_if_possible, $guess_semantics) */ function calculateControlWords($query, $raw, $is_mix, $index_name) { @@ -818,7 +818,7 @@ class SearchController extends Controller implements CrawlConstants * before * * @param $pages an array of search result pages to group those pages - * with thumbs within + * with thumbs within * @return array $pages after the grouping has been done */ function makeMediaGroups($pages) @@ -854,8 +854,8 @@ class SearchController extends Controller implements CrawlConstants * * @param string $crawl_item a page summary * @param int $num number of key phrase to return - * @param int $index_name the timestamp of an index to use, if 0 then - * default used + * @param int $crawl_time the timestamp of an index to use, if 0 then + * default used * @return array an array of most selective key phrases */ function getTopPhrases($crawl_item, $num, $crawl_time = 0) @@ -927,12 +927,12 @@ class SearchController extends Controller implements CrawlConstants return array($out_query, $activity, $arg); } /** - * Used in rendering a cached web page to highlight the search terms. + * Used in rendering a cached web page to highlight the search terms. * - * @param object $node DOM object to mark html elements of - * @param array $words an array of words to be highlighted - * @param object $dom a DOM object for the whole document - * @return object the node modified to now have highlighting + * @param object $node DOM object to mark html elements of + * @param array $words an array of words to be highlighted + * @param object $dom a DOM object for the whole document + * @return object the node modified to now have highlighting */ function markChildren($node, $words, $dom) { @@ -1032,18 +1032,18 @@ class SearchController extends Controller implements CrawlConstants * associative array of query results * * @param string $query this can be any query string that could be - * entered into the search bar on Yioop! (other than related: and - * cache: queries) + * entered into the search bar on Yioop! (other than related: and + * cache: queries) * @param int $results_per_page number of results to return * @param int $limit first result to return from the ordered query results * @param int $grouping ($grouping == 0) normal grouping of links - * with associated document, ($grouping > 0) - * no grouping done on data + * with associated document, ($grouping > 0) + * no grouping done on data * @param int $save_timestamp if this timestamp is nonzero, then save - * iterate position, so can resume on future queries that make - * use of the timestamp + * iterate position, so can resume on future queries that make + * use of the timestamp * @param bool $limit_news if true the number of media:news items to - * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT + * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT * * @return array associative array of results for the query performed */ @@ -1076,14 +1076,15 @@ class SearchController extends Controller implements CrawlConstants * @param string $url to find related documents for * @param int $results_per_page number of results to return * @param int $limit first result to return from the ordered query results + * @param string $crawl_time timestamp of crawl to look for related request * @param int $grouping ($grouping == 0) normal grouping of links - * with associated document, ($grouping > 0) - * no grouping done on data + * with associated document, ($grouping > 0) + * no grouping done on data * @param int $save_timestamp if this timestamp is nonzero, then save - * iterate position, so can resume on future queries that make - * use of the timestamp + * iterate position, so can resume on future queries that make + * use of the timestamp * @param bool $limit_news if true the number of media:news items to - * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT + * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT * * @return array associative array of results for the query performed */ @@ -1104,10 +1105,10 @@ class SearchController extends Controller implements CrawlConstants * * @param string $url to get cached page for * @param array $ui_flags array of ui features which - * should be added to the cache page. For example, "highlight" - * would way search terms should be highlighted, "history" - * says add history navigation for all copies of this cache page in - * yioop system. + * should be added to the cache page. For example, "highlight" + * would way search terms should be highlighted, "history" + * says add history navigation for all copies of this cache page in + * yioop system. * @param string $terms space separated list of search terms * @param string $crawl_time timestamp of crawl to look for cached page in * @return string with contents of cached page @@ -1129,14 +1130,15 @@ class SearchController extends Controller implements CrawlConstants * * @param string $url the url of the page to find the cached version of * @param array $ui_flags array of ui features which - * should be added to the cache page. For example, "highlight" - * would say search terms should be highlighted, "history" - * says add history navigation for all copies of this cache page in - * yioop system. "summaries" says add a toggle headers and extracted - * summaries link. "cache_link_referrer" says a link on a cache page - * referred us to the current cache request + * should be added to the cache page. For example, "highlight" + * would say search terms should be highlighted, "history" + * says add history navigation for all copies of this cache page in + * yioop system. "summaries" says add a toggle headers and extracted + * summaries link. "cache_link_referrer" says a link on a cache page + * referred us to the current cache request + * @param string $terms from orginal query responsible for cache request * @param int $crawl_time the timestamp of the crawl to look up the cached - * page in + * page in */ function cacheRequestAndOutput($url, $ui_flags = array(), $terms ="", $crawl_time = 0) @@ -1317,14 +1319,14 @@ class SearchController extends Controller implements CrawlConstants echo $newDoc; } /** - * Makes an HTML web page for an image cache item + * Makes an HTML web page for an image cache item * - * @param string $url original url of the image - * @param array $cache_item details about the image item - * @param string $cache_file string with image - * @param $queue_servers machines used by yioop for the current index - * cache item is from. Used to find out urls on which image occurred - * @return string an HTML page with the image embedded as a data url + * @param string $url original url of the image + * @param array $cache_item details about the image item + * @param string $cache_file string with image + * @param $queue_servers machines used by yioop for the current index + * cache item is from. Used to find out urls on which image occurred + * @return string an HTML page with the image embedded as a data url */ function imageCachePage($url, $cache_item, $cache_file, $queue_servers) { @@ -1350,7 +1352,7 @@ class SearchController extends Controller implements CrawlConstants * for output in a cache page * * @param array $crawl_item summary information of a web page (title, - * description, etc) + * description, etc) * @return string suitable string formatting of item */ function crawlItemSummary($crawl_item) @@ -1391,16 +1393,16 @@ class SearchController extends Controller implements CrawlConstants * @param string $cache_file contains current web page before formatting * @param string $url that cache web page was originally from * @param string $summary_string summary data that was extracted from the - * web page to be put in the actually inverted index + * web page to be put in the actually inverted index * @param int $crawl_time timestamp of crawl cache page was from * @param array $all_crawl_times timestamps of all crawl times currently - * in Yioop system + * in Yioop system * @param string $terms from orginal query responsible for cache request * @param array $ui_flags array of ui features which - * should be added to the cache page. For example, "highlight" - * would way search terms should be highlighted, "history" - * says add history navigation for all copies of this cache page in - * yioop system. + * should be added to the cache page. For example, "highlight" + * would way search terms should be highlighted, "history" + * says add history navigation for all copies of this cache page in + * yioop system. * return string of formatted cached page */ function formatCachePage($cache_item, $cache_file, $url, @@ -1537,13 +1539,13 @@ class SearchController extends Controller implements CrawlConstants return $new_doc; } /** - * Function used to add links for keyword searches in keyword_links - * array of $cache_item to the text of the $web_page we are going to - * display the cache of as part of a pache page request + * Function used to add links for keyword searches in keyword_links + * array of $cache_item to the text of the $web_page we are going to + * display the cache of as part of a pache page request * - * @param string $web_page to add links to - * @param array $cache_item original cache item web page generated from - * @return string modified web page + * @param string $web_page to add links to + * @param array $cache_item original cache item web page generated from + * @return string modified web page */ function addKeywordLinks($web_page, &$cache_item) { @@ -1559,11 +1561,11 @@ class SearchController extends Controller implements CrawlConstants return $web_page; } /** - * Creates the toggle link and hidden div for extracted header and - * summary element on cache pages + * Creates the toggle link and hidden div for extracted header and + * summary element on cache pages * * @param DOMDocument $dom used to create new nodes to add to body object - * for page + * for page * @param string $text_align whether rtl or ltr language * @param DOMElement $body represent body of cached page * @param string $summary_string header and summary that were extraced @@ -1625,15 +1627,15 @@ class SearchController extends Controller implements CrawlConstants return $divNode; } /** - * Get crawl items based on queue server setting. + * Get crawl items based on queue server setting. * - * @param string $url is the URL of the cached page - * @param array $crawl_times is an array storing crawl times for all - * indexes - * @param array $queue_servers is an array containing URLs for queue - * servers - * @return array($all_crawl_times, $all_crawl_items) is an array containing - * an array of crawl times and an array of their respective crawl items + * @param string $url is the URL of the cached page + * @param array $crawl_times is an array storing crawl times for all + * indexes + * @param array $queue_servers is an array containing URLs for queue + * servers + * @return array($all_crawl_times, $all_crawl_items) is an array containing + * an array of crawl times and an array of their respective crawl items */ function getCrawlItems($url, $crawl_times, $queue_servers) { @@ -1654,19 +1656,19 @@ class SearchController extends Controller implements CrawlConstants return array($all_crawl_times, $all_crawl_items); } /** - * User Interface for history feature + * User Interface for history feature * - * @param long $crawl_time is the crawl time - * @param array $all_crawl_times is an array storing all crawl time - * @param DOMElement $divNode is the section that contains the History UI - * @param DOMDocument $dom is the DOM of the cached page - * @param string $terms is a string containing query terms - * @param boolean $hist_ui_open is a flag to check if History UI should be - * open by default - * @param string $url is the URL of the page + * @param long $crawl_time is the crawl time + * @param array $all_crawl_times is an array storing all crawl time + * @param DOMElement $divNode is the section that contains the History UI + * @param DOMDocument $dom is the DOM of the cached page + * @param string $terms is a string containing query terms + * @param boolean $hist_ui_open is a flag to check if History UI should be + * open by default + * @param string $url is the URL of the page * - * @return DOMElement the section containing the options for - * selecting year and month + * @return DOMElement the section containing the options for + * selecting year and month */ function historyUI($crawl_time, $all_crawl_times, $divNode, $dom, $terms, $hist_ui_open, $url) @@ -1695,7 +1697,7 @@ class SearchController extends Controller implements CrawlConstants /** * The history toggle displays the year and month associated with * the timestamp at which the page was cached. - * @param array months is an array storing months + * @param array $months used to store month names for which we have a cache * @param DOMElement $divNode is the section that contains the History UI * @param DOMDocument $dom is the DOM of the cached page */ @@ -1776,9 +1778,9 @@ class SearchController extends Controller implements CrawlConstants * months * @param DOMDocument $dom is the DOM for the cached page * @param string $url is the URL for the cached page - * @param array years is an array storing years associated with all indexes + * @param array $years is an array storing years associated with all indexes * @param boolean $hist_ui_open checks if the History UI state should be - * open + * open * @param string $terms is a string containing the query terms * @param long $crawl_time is the crawl time for the cached page * @return DOMElement $d1 is the section containing the options for @@ -1851,8 +1853,8 @@ class SearchController extends Controller implements CrawlConstants } /** * Display links based on selected year and month in History UI - * @param array years is an array storing years associated with all indexes - * @param array months is an array storing months + * @param array $years is an array storing years associated with all indexes + * @param array $months is an array storing months * @param string $current_year is the year associated with the timestamp * of the cached page * @param string $current_month is the month associated with the timestamp @@ -1921,7 +1923,7 @@ class SearchController extends Controller implements CrawlConstants * libraries used to display cache pages * * @param DOMDocument $dom used to create new nodes - * @param DomElement &$node what to add script node to + * @param DomElement& $node what to add script node to */ function addCacheJavascriptTags($dom, &$node) { diff --git a/controllers/settings_controller.php b/controllers/settings_controller.php index b3becd907..32d6dfdf5 100755 --- a/controllers/settings_controller.php +++ b/controllers/settings_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base controller class, if needed + * Load base controller class, if needed */ require_once BASE_DIR."/controllers/controller.php"; /** @@ -47,9 +47,9 @@ require_once BASE_DIR."/controllers/controller.php"; class SettingsController extends Controller { /** - * Sets up the available perpage language options. - * If handling data sent from a form, it stores cleaned versions of - * the number of results per page and language options into a sesssion + * Sets up the available perpage language options. + * If handling data sent from a form, it stores cleaned versions of + * the number of results per page and language options into a sesssion * */ function processRequest() @@ -132,11 +132,11 @@ class SettingsController extends Controller $this->displayView($view, $data); } /** - * Changes settings for a logged in user, this might involve storing - * data into the active session. + * Changes settings for a logged in user, this might involve storing + * data into the active session. * - * @param array &$data fields which might be sent to the view - * @return bool if any settings were changed + * @param array& $data fields which might be sent to the view + * @return bool if any settings were changed */ function loggedInChangeSettings(&$data) { diff --git a/controllers/static_controller.php b/controllers/static_controller.php index 383f0f29d..89149a6a9 100644 --- a/controllers/static_controller.php +++ b/controllers/static_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -50,9 +50,9 @@ class StaticController extends Controller */ var $activities = array("showPage"); /** - * This is the main entry point for handling people arriving to view - * a static page. It determines which page to draw and class the view - * to draw it. + * This is the main entry point for handling people arriving to view + * a static page. It determines which page to draw and class the view + * to draw it. */ function processRequest() { @@ -82,7 +82,7 @@ class StaticController extends Controller * by the Yioop Web Site * * @return array $data has title and page contents of the static page to - * display + * display */ function showPage() { @@ -144,11 +144,11 @@ class StaticController extends Controller return $data; } /** - * Used to read in a PUBLIC_GROUP_ID wiki page that will be presented - * to non-logged in visitors to the site. + * Used to read in a PUBLIC_GROUP_ID wiki page that will be presented + * to non-logged in visitors to the site. * - * @param string $page_name name of file less extension to read in - * @return string text of page + * @param string $page_name name of file less extension to read in + * @return string text of page */ function getPage($page_name) { diff --git a/controllers/statistics_controller.php b/controllers/statistics_controller.php index c89fd052b..0050e4157 100644 --- a/controllers/statistics_controller.php +++ b/controllers/statistics_controller.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -39,11 +39,11 @@ require_once BASE_DIR."/lib/crawl_constants.php"; require_once BASE_DIR."/lib/url_parser.php"; define("NO_FEEDS", true); /** - * Responsible for handling requests about global crawl statistics for - * a web crawl. These statistics include: httpd code distribution, - * filetype distribution, num hosts, language distribution, - * os distribution, server distribution, site distribution, file size - * distribution, download time distribution, etc + * Responsible for handling requests about global crawl statistics for + * a web crawl. These statistics include: httpd code distribution, + * filetype distribution, num hosts, language distribution, + * os distribution, server distribution, site distribution, file size + * distribution, download time distribution, etc * * @author Chris Pollett * @package seek_quarry @@ -173,16 +173,16 @@ class StatisticsController extends Controller implements CrawlConstants $this->displayView($view, $data); } /** - * Runs the queries necessary to determine httpd code distribution, - * filetype distribution, num hosts, language distribution, - * os distribution, server distribution, site distribution, file size - * distribution, download time distribution, etc for the web crawl - * set in $this->index_time_stamp. If these queries take to long it - * saves partial results and returns with the field $data["UNFINISHED"] - * set to true. + * Runs the queries necessary to determine httpd code distribution, + * filetype distribution, num hosts, language distribution, + * os distribution, server distribution, site distribution, file size + * distribution, download time distribution, etc for the web crawl + * set in $this->index_time_stamp. If these queries take to long it + * saves partial results and returns with the field $data["UNFINISHED"] + * set to true. * - * @param array &$data associative array which receive all the statistics - * data collected. + * @param array& $data associative array which receive all the statistics + * data collected. */ function computeStatistics(&$data) { @@ -346,6 +346,7 @@ class StatisticsController extends Controller implements CrawlConstants * across queue servers). Returns the count of the number of results that * would be returned by that query. * + * @param string $query to use and count the results of * @return int number of results that would be returned by the given query */ function countQuery($query) diff --git a/css/editor.css b/css/editor.css index e246a4217..057d5915c 100755 --- a/css/editor.css +++ b/css/editor.css @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Eswara Rajesh Pinapala * @package seek_quarry diff --git a/css/search.css b/css/search.css index 937f56611..88b20d0cd 100755 --- a/css/search.css +++ b/css/search.css @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/error.php b/error.php index 3fddda82d..b19ec27ea 100755 --- a/error.php +++ b/error.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Web page used to HTTP display error pages for * the SeekQuarry/Yioop Search engine @@ -34,7 +34,7 @@ * @filesource */ /** Calculate base directory of script - * @ignore + * @ignore */ $pathinfo = pathinfo($_SERVER['SCRIPT_FILENAME']); if(!defined('BASE_DIR')) { diff --git a/examples/search_api.php b/examples/search_api.php index ff3b6f96f..b3a328689 100644 --- a/examples/search_api.php +++ b/examples/search_api.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -37,8 +37,8 @@ // this example should be only run from the command-line if(php_sapi_name() != 'cli') {echo "BAD REQUEST"; exit();} /** Calculate base directory of script @ignore - * If you have Yioop! in a separate folder from your web-site - * You should change BASE_DIR to the location of the Yioop! directory + * If you have Yioop! in a separate folder from your web-site + * You should change BASE_DIR to the location of the Yioop! directory */ define("BASE_DIR", substr( dirname(realpath($_SERVER['PHP_SELF'])), 0, @@ -78,11 +78,11 @@ if(class_exists("ZipArchive")) { } if (function_exists('lcfirst') === false) { /** - * Lower cases the first letter in a string + * Lower cases the first letter in a string * - * This function is only defined if the PHP version is before 5.3 - * @param string $str string to be lower cased - * @return string the lower cased string + * This function is only defined if the PHP version is before 5.3 + * @param string $str string to be lower cased + * @return string the lower cased string */ function lcfirst( $str ) { @@ -100,7 +100,7 @@ require_once(BASE_DIR."/lib/file_cache.php"); define("NO_CACHE", true); /** USE_FILECACHE will let us use this tool to store long running - * queries into the filecache + * queries into the filecache */ if(USE_FILECACHE) { $CACHE = new FileCache(WORK_DIRECTORY."/cache/queries"); @@ -121,7 +121,7 @@ require_once BASE_DIR."/lib/crawl_constants.php"; /**Load search controller class needed to get search results*/ require_once BASE_DIR."/controllers/search_controller.php"; /* - * Set-up multi-byte string handling to use UTF-8 + * Set-up multi-byte string handling to use UTF-8 */ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); diff --git a/index.php b/index.php index 7577891ba..fdc5b22eb 100755 --- a/index.php +++ b/index.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Main web interface entry point for Yioop! * search site. Used to both get and display @@ -35,7 +35,7 @@ * @filesource */ /** Calculate base directory of script - * @ignore + * @ignore */ $pathinfo = pathinfo($_SERVER['SCRIPT_FILENAME']); define("BASE_DIR", $pathinfo["dirname"].'/'); @@ -113,11 +113,11 @@ mb_internal_encoding("UTF-8"); mb_regex_encoding("UTF-8"); if (function_exists('lcfirst') === false) { /** - * Lower cases the first letter in a string + * Lower cases the first letter in a string * - * This function is only defined if the PHP version is before 5.3 - * @param string $str string to be lower cased - * @return string the lower cased string + * This function is only defined if the PHP version is before 5.3 + * @param string $str string to be lower cased + * @return string the lower cased string */ function lcfirst( $str ) { @@ -184,7 +184,7 @@ $controller->processRequest(); * SeekQuarry app * * @param string $controller_name name of controller - * (this usually come from the query string) + * (this usually come from the query string) * @return bool whether it is a valid controller */ function checkAllowedController($controller_name) diff --git a/lib/analytics_manager.php b/lib/analytics_manager.php index 7a0fce5f9..14671785b 100644 --- a/lib/analytics_manager.php +++ b/lib/analytics_manager.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -44,7 +44,10 @@ require_once BASE_DIR."/lib/crawl_constants.php"; */ class AnalyticsManager { - //where get and set field values are stored + /** + * Where get and set field values are stored + * @var array + */ private static $data = array(); /** * Used to get the timing statistic associated with $attribute @@ -59,7 +62,7 @@ class AnalyticsManager * Used to set the timing statistic $value associated with $attribute * @param string $attribute to get statistic for * @param mixed $value whatever timing information is to be associated with - * value + * value */ static function set($attribute, $value) { diff --git a/lib/archive_bundle_iterators/arc_archive_bundle_iterator.php b/lib/archive_bundle_iterators/arc_archive_bundle_iterator.php index 829a39fbf..fddde021f 100644 --- a/lib/archive_bundle_iterators/arc_archive_bundle_iterator.php +++ b/lib/archive_bundle_iterators/arc_archive_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -54,10 +54,10 @@ class ArcArchiveBundleIterator extends TextArchiveBundleIterator * Creates an arc archive iterator with the given parameters. * * @param string $iterate_timestamp timestamp of the arc archive bundle to - * iterate over the pages of + * iterate over the pages of * @param string $iterate_dir folder of files to iterate over * @param string $result_timestamp timestamp of the arc archive bundle - * results are being stored in + * results are being stored in * @param string $result_dir where to write last position checkpoints to */ function __construct($iterate_timestamp, $iterate_dir, diff --git a/lib/archive_bundle_iterators/archive_bundle_iterator.php b/lib/archive_bundle_iterators/archive_bundle_iterator.php index 127a7047b..1e406dced 100644 --- a/lib/archive_bundle_iterators/archive_bundle_iterator.php +++ b/lib/archive_bundle_iterators/archive_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -117,7 +117,7 @@ abstract class ArchiveBundleIterator implements CrawlConstants * the particular archive iterator * @param $site an associative array containing info about a web page * @return mixed a 4-bit number or false if iterator doesn't uses default - * ranking method + * ranking method */ abstract function weight(&$site); /** diff --git a/lib/archive_bundle_iterators/database_bundle_iterator.php b/lib/archive_bundle_iterators/database_bundle_iterator.php index 6737293d6..f37e3cebd 100644 --- a/lib/archive_bundle_iterators/database_bundle_iterator.php +++ b/lib/archive_bundle_iterators/database_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -85,13 +85,13 @@ class DatabaseBundleIterator extends ArchiveBundleIterator var $encoding; /** - * File handle for current arc file - * @var resource + * File handle for current arc file + * @var resource */ var $db; /** - * Current result row of query iterator has processed to - * @var int + * Current result row of query iterator has processed to + * @var int */ var $limit; /** @@ -100,10 +100,10 @@ class DatabaseBundleIterator extends ArchiveBundleIterator * to a database, so that the results might be indexed by Yioop. * * @param string $iterate_timestamp timestamp of the arc archive bundle to - * iterate over the pages of + * iterate over the pages of * @param string $iterate_dir folder of files to iterate over * @param string $result_timestamp timestamp of the arc archive bundle - * results are being stored in + * results are being stored in * @param string $result_dir where to write last position checkpoints to */ function __construct($iterate_timestamp, $iterate_dir, @@ -165,7 +165,7 @@ class DatabaseBundleIterator extends ArchiveBundleIterator * the particular archive iterator * @param $site an associative array containing info about a web page * @return bool false we assume arc files were crawled according to - * OPIC and so we use the default doc_depth to estimate page importance + * OPIC and so we use the default doc_depth to estimate page importance */ function weight(&$site) { diff --git a/lib/archive_bundle_iterators/mediawiki_bundle_iterator.php b/lib/archive_bundle_iterators/mediawiki_bundle_iterator.php index adb45adaf..39f6dea2d 100644 --- a/lib/archive_bundle_iterators/mediawiki_bundle_iterator.php +++ b/lib/archive_bundle_iterators/mediawiki_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -95,10 +95,10 @@ class MediaWikiArchiveBundleIterator extends TextArchiveBundleIterator * Creates a media wiki archive iterator with the given parameters. * * @param string $iterate_timestamp timestamp of the arc archive bundle to - * iterate over the pages of + * iterate over the pages of * @param string $iterate_dir folder of files to iterate over * @param string $result_timestamp timestamp of the arc archive bundle - * results are being stored in + * results are being stored in * @param string $result_dir where to write last position checkpoints to */ function __construct($iterate_timestamp, $iterate_dir, @@ -117,7 +117,7 @@ class MediaWikiArchiveBundleIterator extends TextArchiveBundleIterator * the particular archive iterator * @param $site an associative array containing info about a web page * @return int a 4-bit number based on the log_2 size - 10 of the wiki - * entry (@see nextPage). + * entry (@see nextPage). */ function weight(&$site) { diff --git a/lib/archive_bundle_iterators/mix_archive_bundle_iterator.php b/lib/archive_bundle_iterators/mix_archive_bundle_iterator.php index 0e26ffc28..21d51c9bc 100644 --- a/lib/archive_bundle_iterators/mix_archive_bundle_iterator.php +++ b/lib/archive_bundle_iterators/mix_archive_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -80,9 +80,9 @@ class MixArchiveBundleIterator extends ArchiveBundleIterator * Creates a web archive iterator with the given parameters. * * @param string $mix_timestamp timestamp of the crawl mix to - * iterate over the pages of + * iterate over the pages of * @param string $result_timestamp timestamp of the web archive bundle - * results are being stored in + * results are being stored in */ function __construct($mix_timestamp, $result_timestamp) { @@ -104,11 +104,11 @@ class MixArchiveBundleIterator extends ArchiveBundleIterator } } /** - * Get the filename of the file that says information about the - * current archive iterator (such as whether the end of the iterator - * has been reached) + * Get the filename of the file that says information about the + * current archive iterator (such as whether the end of the iterator + * has been reached) * - * @param int $timestamp of current archive crawl + * @param int $timestamp of current archive crawl */ function getArchiveName($timestamp) { @@ -117,6 +117,10 @@ class MixArchiveBundleIterator extends ArchiveBundleIterator /** * Saves the current state so that a new instantiation can pick up just * after the last batch of pages extracted. + * + * @param array $info data needed to restore where we are in the process + * of iterating through archive. By default save fields LIMIT and + * END_OF_ITERATOR */ function saveCheckpoint($info = array()) { @@ -151,7 +155,7 @@ class MixArchiveBundleIterator extends ArchiveBundleIterator * the particular archive iterator * @param $site an associative array containing info about a web page * @return bool false we assume files were crawled roughly according to - * page importance so we use default estimate of doc rank + * page importance so we use default estimate of doc rank */ function weight(&$site) { @@ -162,7 +166,7 @@ class MixArchiveBundleIterator extends ArchiveBundleIterator * * @param int $num number of docs to get * @param bool $no_process this flag is inherited from base class but - * does not do anything in this case + * does not do anything in this case * @return array associative arrays for $num pages */ function nextPages($num, $no_process = false) diff --git a/lib/archive_bundle_iterators/odp_rdf_bundle_iterator.php b/lib/archive_bundle_iterators/odp_rdf_bundle_iterator.php index 8129fd7a4..8f79f4522 100644 --- a/lib/archive_bundle_iterators/odp_rdf_bundle_iterator.php +++ b/lib/archive_bundle_iterators/odp_rdf_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -51,9 +51,9 @@ class OdpRdfArchiveBundleIterator extends TextArchiveBundleIterator implements CrawlConstants { /** - * Associative array containing global properties like base url of the - * current open odp rdf file - * @var array + * Associative array containing global properties like base url of the + * current open odp rdf file + * @var array */ var $header; /** @@ -65,10 +65,10 @@ class OdpRdfArchiveBundleIterator extends TextArchiveBundleIterator * Creates an open directory rdf archive iterator with the given parameters. * * @param string $iterate_timestamp timestamp of the arc archive bundle to - * iterate over the pages of + * iterate over the pages of * @param string $iterate_dir folder of files to iterate over * @param string $result_timestamp timestamp of the arc archive bundle - * results are being stored in + * results are being stored in * @param string $result_dir where to write last position checkpoints to */ function __construct($iterate_timestamp, $iterate_dir, @@ -90,7 +90,7 @@ class OdpRdfArchiveBundleIterator extends TextArchiveBundleIterator * the particular archive iterator * @param $site an associative array containing info about a web page * @return int a 4-bit number based on the topic path of the odp entry - * (@see processTopic @see processExternalPage) + * (@see processTopic @see processExternalPage) */ function weight(&$site) { @@ -195,12 +195,12 @@ class OdpRdfArchiveBundleIterator extends TextArchiveBundleIterator return $site; } /** - * Computes an HTML page for a Topic tag parsed from the ODP RDF - * document + * Computes an HTML page for a Topic tag parsed from the ODP RDF + * document * - * @param object $dom document object for one Topic tag tag - * @param array &$site a reference to an array of header and page info - * for an html page + * @param object $dom document object for one Topic tag tag + * @param array& $site a reference to an array of header and page info + * for an html page */ function processTopic($dom, &$site) { @@ -231,12 +231,12 @@ class OdpRdfArchiveBundleIterator extends TextArchiveBundleIterator $site[self::PAGE] .= "</body></html>"; } /** - * Computes an HTML page for an ExternalPage tag parsed from the ODP RDF - * document + * Computes an HTML page for an ExternalPage tag parsed from the ODP RDF + * document * - * @param object $dom document object for one Topic tag tag - * @param array &$site a reference to an array of header and page info - * for an html page + * @param object $dom document object for one Topic tag tag + * @param array& $site a reference to an array of header and page info + * for an html page */ function processExternalPage($dom, &$site) { @@ -259,10 +259,10 @@ class OdpRdfArchiveBundleIterator extends TextArchiveBundleIterator $site[self::PAGE] .= "<div>$description</div></body></html>"; } /** - * Computes links for prefix topics of an ODP topic path + * Computes links for prefix topics of an ODP topic path * - * @param string $topic_path to compute links for - * @return array url => text pairs for each prefix of path + * @param string $topic_path to compute links for + * @return array url => text pairs for each prefix of path */ function computeTopicLinks($topic_path) { @@ -277,11 +277,11 @@ class OdpRdfArchiveBundleIterator extends TextArchiveBundleIterator return $links; } /** - * Makes an unordered HTML list out of an associative array of - * url => link_text pairs. + * Makes an unordered HTML list out of an associative array of + * url => link_text pairs. * - * @param array $links url=>link_text pairs - * @return string containing html for unorderlisted list of links + * @param array $links url=>link_text pairs + * @return string containing html for unorderlisted list of links */ function linksToHtml($links) { diff --git a/lib/archive_bundle_iterators/text_archive_bundle_iterator.php b/lib/archive_bundle_iterators/text_archive_bundle_iterator.php index da425f9ab..146bf583f 100644 --- a/lib/archive_bundle_iterators/text_archive_bundle_iterator.php +++ b/lib/archive_bundle_iterators/text_archive_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -60,57 +60,57 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator var $iterate_dir; /** * The number of arc files in this arc archive bundle - * @var int + * @var int */ var $num_partitions; /** - * Counting in glob order for this arc archive bundle directory, the - * current active file number of the arc file being process. + * Counting in glob order for this arc archive bundle directory, the + * current active file number of the arc file being process. * - * @var int + * @var int */ var $current_partition_num; /** - * current number of pages into the current arc file - * @var int + * current number of pages into the current arc file + * @var int */ var $current_page_num; /** - * current byte offset into the current arc file - * @var int + * current byte offset into the current arc file + * @var int */ var $current_offset; /** - * Array of filenames of arc files in this directory (glob order) - * @var array + * Array of filenames of arc files in this directory (glob order) + * @var array */ var $partitions; /** - * File handle for current archive file - * @var resource + * File handle for current archive file + * @var resource */ var $fh; /** - * Used to buffer data from the currently opened file - * @var string + * Used to buffer data from the currently opened file + * @var string */ var $buffer; /** - * Starting delimiters for records - * @var string + * Starting delimiters for records + * @var string */ var $start_delimiter; /** - * Ending delimiters for records - * @var string + * Ending delimiters for records + * @var string */ var $end_delimiter; /** - * File name to write this archive iterator status messages to - * @var string + * File name to write this archive iterator status messages to + * @var string */ var $status_filename; @@ -158,11 +158,11 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator */ const BUFFER_SIZE = 16384000; /** - * Estimate of the maximum size of a record stored in a text archive - * Data in archives is split into chunk of buffer size plus two record - * sizes. This is used to provide a two record overlap between successive - * chunks. This si further used to ensure that records that go over - * the basic chunk boundary of BUFFER_SIZE will be processed. + * Estimate of the maximum size of a record stored in a text archive + * Data in archives is split into chunk of buffer size plus two record + * sizes. This is used to provide a two record overlap between successive + * chunks. This si further used to ensure that records that go over + * the basic chunk boundary of BUFFER_SIZE will be processed. */ const MAX_RECORD_SIZE = 49152; @@ -170,15 +170,15 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator * Creates an text archive iterator with the given parameters. * * @param string $iterate_timestamp timestamp of the arc archive bundle to - * iterate over the pages of + * iterate over the pages of * @param string $iterate_dir folder of files to iterate over. If this - * iterator is used in a fetcher and the data is on a name server - * set this to false + * iterator is used in a fetcher and the data is on a name server + * set this to false * @param string $result_timestamp timestamp of the arc archive bundle - * results are being stored in + * results are being stored in * @param string $result_dir where to write last position checkpoints to * @param array $ini describes start_ and end_delimiter, file_extension, - * encoding, and compression method used for pages in this archive + * encoding, and compression method used for pages in this archive */ function __construct($iterate_timestamp, $iterate_dir, $result_timestamp, $result_dir, $ini = array()) @@ -221,11 +221,11 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator } } /** - * Mutator Method for controller how this text archive iterator behaves - * Normally, data, on compression, start, stop delimiter read from an ini - * file. This reads it from the supplied array. + * Mutator Method for controller how this text archive iterator behaves + * Normally, data, on compression, start, stop delimiter read from an ini + * file. This reads it from the supplied array. * - * @param array $ini configuration settings for this archive iterator + * @param array $ini configuration settings for this archive iterator */ function setIniInfo($ini) { @@ -261,7 +261,7 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator * the particular archive iterator * @param $site an associative array containing info about a web page * @return bool false we assume arc files were crawled according to - * OPIC and so we use the default doc_depth to estimate page importance + * OPIC and so we use the default doc_depth to estimate page importance */ function weight(&$site) { @@ -290,13 +290,13 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator } } /** - * Called to get the next chunk of BUFFER_SIZE + 2 MAX_RECORD_SIZE bytes - * of data from the text archive. This data is returned unprocessed in - * self::ARC_DATA together with ini and header information about the - * archive. This method is typically called in the name server setting - * from FetchController. + * Called to get the next chunk of BUFFER_SIZE + 2 MAX_RECORD_SIZE bytes + * of data from the text archive. This data is returned unprocessed in + * self::ARC_DATA together with ini and header information about the + * archive. This method is typically called in the name server setting + * from FetchController. * - * @return array with contents as described above + * @return array with contents as described above */ function nextChunk() { @@ -318,11 +318,11 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator return $info; } /** - * Helper function for nextChunk to advance the parition if we are - * at the end of the current archive file + * Helper function for nextChunk to advance the parition if we are + * at the end of the current archive file * - * @param &$info a struct with data about current chunk. will up start - * partition flag + * @param array& $info a struct with data about current chunk. will up start + * partition flag */ function updatePartition(&$info) { @@ -346,7 +346,7 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator * * @param int $num number of docs to get * @param bool $no_process if true then just an array of page strings found - * not any additional meta data. + * not any additional meta data. * @return array associative arrays for $num pages */ function nextPages($num, $no_process = false) @@ -391,7 +391,7 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator /** * Gets the next doc from the iterator * @param bool $no_process if true then just return page string found - * not any additional meta data. + * not any additional meta data. * @return mixed associative array for doc or just string of doc */ function nextPage($no_process = false) @@ -446,7 +446,7 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator /** * Reads and return the block of data from the current partition * @return mixed a uncompressed string from the current partitin - * or NULL if iterator not set up, or false if EOF reached. + * or NULL if iterator not set up, or false if EOF reached. */ function getFileBlock() { @@ -486,11 +486,11 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator return $read_string; } /** - * If reading from a gzbuffer file goes off the end of the current - * buffer, reads in the next block from archive file. - * @param string $buffer - * @param bool $return_string - * @return bool whether successfully read in next block or not + * If reading from a gzbuffer file goes off the end of the current + * buffer, reads in the next block from archive file. + * @param string $buffer + * @param bool $return_string + * @return bool whether successfully read in next block or not */ function updateBuffer($buffer= "", $return_string = false) { @@ -501,12 +501,12 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator return $this->makeBuffer($buffer, $return_string); } /** - * Reads in block $this->buffer_block_num of size self::BUFFER_SIZE from - * the archive file + * Reads in block $this->buffer_block_num of size self::BUFFER_SIZE from + * the archive file * - * @param string $buffer - * @param bool $return_string - * @return mixed whether successfully read in block or not + * @param string $buffer + * @param bool $return_string + * @return mixed whether successfully read in block or not */ function makeBuffer($buffer= "", $return_string = false) { @@ -563,9 +563,9 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator } /** - * Checks if have a valid handle to object's archive's current partition + * Checks if have a valid handle to object's archive's current partition * - * @return bool whether it has or not (true -it has) + * @return bool whether it has or not (true -it has) */ function checkFileHandle() { @@ -578,9 +578,9 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator } } /** - * Checks if this object's archive's current partition is at an end of file + * Checks if this object's archive's current partition is at an end of file * - * @return bool whether end of file has been reached (true -it has) + * @return bool whether end of file has been reached (true -it has) */ function checkEof() { @@ -604,10 +604,10 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator return $eof; } /** - * Wrapper around particular compression scheme fopen function + * Wrapper around particular compression scheme fopen function * - * @param string filename to open - * @param bool $make_buffer_if_needed + * @param string $filename name of file to open + * @param bool $make_buffer_if_needed */ function fileOpen($filename, $make_buffer_if_needed = true) { @@ -638,7 +638,7 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator $this->current_offset = 0; } /** - * Wrapper around particular compression scheme fclose function + * Wrapper around particular compression scheme fclose function */ function fileClose() { @@ -661,10 +661,10 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator fclose($this->buffer_fh); } /** - * Returns the current position in the current iterator partition file - * for the given compression scheme. - * @return int a position into the currently being processed file of the - * iterator + * Returns the current position in the current iterator partition file + * for the given compression scheme. + * @return int a position into the currently being processed file of the + * iterator */ function fileTell() { @@ -749,8 +749,8 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator * @param array $tags array of tagnames to look for * * @return array of two elements: the first element is a string consisting - * of start tag contents close tag of first tag found, the second - * has the name of the tag amongst $tags found + * of start tag contents close tag of first tag found, the second + * has the name of the tag amongst $tags found */ function getNextTagsData($tags) { diff --git a/lib/archive_bundle_iterators/warc_archive_bundle_iterator.php b/lib/archive_bundle_iterators/warc_archive_bundle_iterator.php index d4bde9dde..423eb7a39 100644 --- a/lib/archive_bundle_iterators/warc_archive_bundle_iterator.php +++ b/lib/archive_bundle_iterators/warc_archive_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -56,10 +56,10 @@ class WarcArchiveBundleIterator extends TextArchiveBundleIterator * Creates an warc archive iterator with the given parameters. * * @param string $iterate_timestamp timestamp of the arc archive bundle to - * iterate over the pages of + * iterate over the pages of * @param string $iterate_dir folder of files to iterate over * @param string $result_timestamp timestamp of the arc archive bundle - * results are being stored in + * results are being stored in * @param string $result_dir where to write last position checkpoints to */ function __construct($iterate_timestamp, $iterate_dir, @@ -127,8 +127,8 @@ class WarcArchiveBundleIterator extends TextArchiveBundleIterator * Used to parse the header portion of a WARC record * * @return array fields of WARC record mapped to their Yioop equivalents. - * Also, return 'line' the last line and 'warc-type' the kind of - * record. + * Also, return 'line' the last line and 'warc-type' the kind of + * record. */ function getWarcHeaders() { diff --git a/lib/archive_bundle_iterators/web_archive_bundle_iterator.php b/lib/archive_bundle_iterators/web_archive_bundle_iterator.php index 41a7ece8f..f09222884 100644 --- a/lib/archive_bundle_iterators/web_archive_bundle_iterator.php +++ b/lib/archive_bundle_iterators/web_archive_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -95,7 +95,7 @@ class WebArchiveBundleIterator extends ArchiveBundleIterator * * @param string $timestamp the archive timestamp * @return string the path to the archive, based off of the fetcher prefix - * used when this iterator was constructed + * used when this iterator was constructed */ function getArchiveName($timestamp) { @@ -107,9 +107,9 @@ class WebArchiveBundleIterator extends ArchiveBundleIterator * * @param string $prefix fetcher number this bundle is associated with * @param string $iterate_timestamp timestamp of the web archive bundle to - * iterate over the pages of + * iterate over the pages of * @param string $result_timestamp timestamp of the web archive bundle - * results are being stored in + * results are being stored in */ function __construct($prefix, $iterate_timestamp, $result_timestamp) { @@ -128,6 +128,9 @@ class WebArchiveBundleIterator extends ArchiveBundleIterator /** * Saves the current state so that a new instantiation can pick up just * after the last batch of pages extracted. + * + * @param array $info data needed to restore where we are in the process + * of iterating through archive. */ function saveCheckpoint($info = array()) { @@ -164,7 +167,7 @@ class WebArchiveBundleIterator extends ArchiveBundleIterator * the particular archive iterator * @param $site an associative array containing info about a web page * @return bool false we assume files were crawled roughly according to - * page importance so we use default estimate of doc rank + * page importance so we use default estimate of doc rank */ function weight(&$site) { @@ -175,7 +178,7 @@ class WebArchiveBundleIterator extends ArchiveBundleIterator * * @param int $num number of docs to get * @param bool $no_process this flag is inherited from base class but - * does not do anything in this case + * does not do anything in this case * @return array associative arrays for $num pages */ function nextPages($num, $no_process= false) diff --git a/lib/bloom_filter_bundle.php b/lib/bloom_filter_bundle.php index de86810fb..836e40788 100644 --- a/lib/bloom_filter_bundle.php +++ b/lib/bloom_filter_bundle.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -80,7 +80,7 @@ class BloomFilterBundle * * @param $dir_name directory when this bundles data is stored * @param $filter_size the size of an individual filter in this bundle - * once a filter is filled a new one is added to the directory + * once a filter is filled a new one is added to the directory */ function __construct($dir_name, $filter_size = self::default_filter_size ) @@ -132,9 +132,9 @@ class BloomFilterBundle * Removes from the passed array those elements $elt who either are in * the filter bundle or whose $elt[$field_name] is in the bundle. * - * @param array &$arr the array to remove elements from + * @param array& $arr the array to remove elements from * @param array $field_names if not NULL an array of field names of $arr - * to use to do filtering + * to use to do filtering */ function differenceFilter(&$arr, $field_names = NULL) { @@ -210,8 +210,8 @@ class BloomFilterBundle file_put_contents($this->dir_name.'/meta.txt', serialize($meta)); } /** - * Empties the contents of the bloom filter bundle and resets - * it to start storing new data. + * Empties the contents of the bloom filter bundle and resets + * it to start storing new data. */ function reset() { diff --git a/lib/bloom_filter_file.php b/lib/bloom_filter_file.php index c48dc088e..4cc7e08ce 100755 --- a/lib/bloom_filter_file.php +++ b/lib/bloom_filter_file.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -75,8 +75,8 @@ class BloomFilterFile extends PersistentStructure * * @param string $fname name of the file to store the BloomFilter data in * @param int $num_values the maximum number of values that will be stored - * in the BloomFilter. Filter will be sized so the odds of a false - * positive are roughly one over this value + * in the BloomFilter. Filter will be sized so the odds of a false + * positive are roughly one over this value * @param int $save_frequency how often to store the BloomFilter to disk */ function __construct($fname, $num_values, @@ -126,6 +126,8 @@ class BloomFilterFile extends PersistentStructure * Hashes $value to a bit position in the BloomFilter * * @param string $value value to map to a bit position in the filter + * @param int $num_keys number of bit positions in the Bloom filter + * used to say an item isin the filter * @return int the bit position mapped to */ function getHashBitPositionArray($value, $num_keys) diff --git a/lib/btree.php b/lib/btree.php index 5283285e0..8b9a0ce67 100644 --- a/lib/btree.php +++ b/lib/btree.php @@ -1,27 +1,27 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -43,8 +43,8 @@ define('MIN_DEGREE', 501); * by T.H. Cormen, C.E. Leiserson, R.L. Rivest, and C. Stein. Second * Edition, 2001, The MIT Press * - * @author Akshat Kukreti - * @package seek_quarry + * @author Akshat Kukreti + * @package seek_quarry */ class BTree { @@ -77,6 +77,7 @@ class BTree * Creates/Loads B-Tree having specified directory and minimum_degree. The * default minimum_degree is 501. * @param string $dir is the directory for storing the B-Tree files + * @param int $min_degree minimum degree of a B-tree node */ function __construct($dir, $min_degree = MIN_DEGREE) { @@ -281,8 +282,9 @@ class BTree /** * Splits a full node into two child node. The median key-value pair is * added to the parent node of the node being split. + * * @param object $parent is the parent node - * @paran int $i is the link to child node + * @param int $i is the link to child node * @param object $child is the child node */ function bTreeSplitChild($parent, $i, $child) @@ -431,8 +433,8 @@ class BTree } /** * Deletes key-value pair from a leaf node in a B-Tree - * @param object $node is the leaf node containing the key-value pair - * @param int $key is the key to be deleted + * @param object& $node is the leaf node containing the key-value pair + * @param int $pos in node to delete */ function deleteFromLeaf(&$node, $pos) { @@ -441,7 +443,7 @@ class BTree $node->count -= 1; $this->writeNode($node); } else { - for($i = $pos + 1;$i < $node->count;$i++) { + for($i = $pos + 1; $i < $node->count; $i++) { $node->keys[$i - 1] = $node->keys[$i]; } $node->keys = array_slice($node->keys, 0, $node->count - 1); @@ -455,8 +457,8 @@ class BTree } /** * Deletes key-value pair from a non-leaf node in a B-Tree - * @param object $node is the non-leaf node containing the key-value pair - * @param int $key is the key to be deleted + * @param object& $node is the non-leaf node containing the key-value pair + * @param int $pos link position in node to delete */ function deleteFromNonLeaf(&$node, $pos) { @@ -528,7 +530,7 @@ class BTree * Otherwise, the node is adjusted using one of its sibling nodes and the * parent node so that the resultant node has $min_degree keys. * @param object $parent is the parent node - * @param int pos is the link to the root of the sub-tree + * @param int $pos is the link to the root of the sub-tree * @return object $child is the child node to which the recursion will * descend */ @@ -630,10 +632,11 @@ class BTree * Gives a child node an extra key by moving a key from the parent to the * child node, and by moving a key from the child's right sibling to the * parent node - * @param object $parent is the parent node - * @param object $child is the child node - * @param object $pred is the $child's left sibling node - * @param $pos is the link from $parent to $child + * @param object& $parent is the parent node + * @param object& $child is the child node + * @param object& $pred is the $child's left sibling node + * @param object& $next is the $child's right sibling node + * @param int $pos is the link from $parent to $child */ function adjustChildUsingRightSiblingAndParent(&$parent, &$child, &$next, $pos) diff --git a/lib/bzip2_block_iterator.php b/lib/bzip2_block_iterator.php index c4449d77a..f6468accb 100644 --- a/lib/bzip2_block_iterator.php +++ b/lib/bzip2_block_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Shawn Tice, (docs added by Chris Pollett chris@pollett.org) * @package seek_quarry @@ -53,10 +53,10 @@ class BZip2BlockIterator /** String at the end of each bz2 block*/ const BLOCK_ENDMARK = "\x17\x72\x45\x38\x50\x90"; /** - * Blocks are NOT byte-aligned, so the block header (and endmark) may show - * up shifted right by 0-8 bits in various places throughout the file. This - * regular expression matches any of the possible shifts for both the block - * header and the block endmark. + * Blocks are NOT byte-aligned, so the block header (and endmark) may show + * up shifted right by 0-8 bits in various places throughout the file. This + * regular expression matches any of the possible shifts for both the block + * header and the block endmark. */ const BLOCK_LEADER_RE = ' / @@ -69,10 +69,10 @@ class BZip2BlockIterator |\x5d\xc9\x14\xe1\x42 | \x2e\xe4\x8a\x70\xa1 /x'; /** - * Lookup table fpr the number of bits by which the magic - * number for the next block has been shifted right. Second - * components of sub-arrays say whether block header or endmark - * @var array + * Lookup table fpr the number of bits by which the magic + * number for the next block has been shifted right. Second + * components of sub-arrays say whether block header or endmark + * @var array */ static $header_info = array( "\x41" => array(0, true), "\xa0" => array(1, true), @@ -296,8 +296,8 @@ class BZip2BlockIterator * Computes a new bzip2 block portions and bits left over after adding * $bytes to the passed $block. * - * @param string &$block the block to add to - * @param int &$bits used to hold bits left over + * @param string& $block the block to add to + * @param int& $bits used to hold bits left over * @param string $bytes what to add to the bzip block * @param int $num_extra_bits how many extra bits there are */ diff --git a/lib/centroid_summarizer.php b/lib/centroid_summarizer.php index 30e2be9db..1c15d69ac 100644 --- a/lib/centroid_summarizer.php +++ b/lib/centroid_summarizer.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Mangesh Dahale mangeshadahale@gmail.com * @package seek_quarry @@ -50,9 +50,9 @@ foreach(glob(LOCALE_DIR."/*/resources/tokenizer.php") as $filename) { require_once $filename; } /** - * Class which may be used by TextProcessors to get a summary for a text - * document that may later be used for indexing. It does this by doing - * centroid-based clustering. It also generates a word cloud for a document + * Class which may be used by TextProcessors to get a summary for a text + * document that may later be used for indexing. It does this by doing + * centroid-based clustering. It also generates a word cloud for a document */ class CentroidSummarizer { @@ -68,13 +68,13 @@ class CentroidSummarizer */ const LONG_SENTENCE_THRESHOLD = 200; /** - * Generates a centroid with which every sentence is ranked with cosine - * ranking method and also generates a word cloud. - * @param string $doc complete raw page to generate the summary from. - * @param string $lang language of the page to decide which stop words to - * call proper tokenizer.php of the specified language. + * Generates a centroid with which every sentence is ranked with cosine + * ranking method and also generates a word cloud. + * @param string $doc complete raw page to generate the summary from. + * @param string $lang language of the page to decide which stop words to + * call proper tokenizer.php of the specified language. * - * @return array array of summary and word cloud + * @return array array of summary and word cloud */ static function getCentroidSummary($doc, $lang) { @@ -196,13 +196,13 @@ class CentroidSummarizer return array($summary, $word_cloud); } /** - * Calculates how many sentences to put in the summary to match the - * MAX_DESCRIPTION_LEN. - * @param string $doc complete raw page to generate the summary from. - * @param string $lang language of the page to decide which stop words to - * call proper tokenizer.php of the specified language. + * Calculates how many sentences to put in the summary to match the + * MAX_DESCRIPTION_LEN. * - * @return array array of summary and word cloud + * @param array $sentences sentences in doc in their original order + * @param array $sim associative array of sentence-number-in-doc => + * similarity score to centroid (sorted from highest to lowest score). + * @return int number of sentences */ static function summarySentenceCount($sentences, $sim) { @@ -218,10 +218,10 @@ class CentroidSummarizer return $top; } /** - * Breaks any content into sentences by splitting it on spaces or carriage - * returns - * @param string $content complete page. - * @return array array of sentences from that content. + * Breaks any content into sentences by splitting it on spaces or carriage + * returns + * @param string $content complete page. + * @return array array of sentences from that content. */ static function getSentences($content) { @@ -251,10 +251,10 @@ class CentroidSummarizer return $out; } /** - * Formats the sentences to remove all characters except words, - * digits and spaces - * @param string $sent complete page. - * @return string formatted sentences. + * Formats the sentences to remove all characters except words, + * digits and spaces + * @param string $sent complete page. + * @return string formatted sentences. */ static function formatSentence($sent) { @@ -263,12 +263,12 @@ class CentroidSummarizer return $sent; } /** - * Formats the document to remove carriage returns, hyphens and digits - * as we will not be using digits in word cloud. - * The formatted document generated by this function is only used to - * compute centroid. - * @param string $content formatted page. - * @return string formatted document. + * Formats the document to remove carriage returns, hyphens and digits + * as we will not be using digits in word cloud. + * The formatted document generated by this function is only used to + * compute centroid. + * @param string $content formatted page. + * @return string formatted document. */ static function formatDoc($content) { @@ -277,10 +277,10 @@ class CentroidSummarizer return $content; } /** - * This function does an additional processing on the page - * such as removing all the tags from the page - * @param string $page complete page. - * @return string processed page. + * This function does an additional processing on the page + * such as removing all the tags from the page + * @param string $page complete page. + * @return string processed page. */ static function pageProcessing($page) { diff --git a/lib/classifiers/classifier.php b/lib/classifiers/classifier.php index 6c978eeb0..9d98ce1bc 100644 --- a/lib/classifiers/classifier.php +++ b/lib/classifiers/classifier.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -178,25 +178,25 @@ class Classifier implements CrawlConstants * Default per-classifier options, which may be overridden when * constructing a new classifier. The supported options are: * - * float density.lambda: Lambda parameter used in the computation of a - * candidate document's density (smoothing for 0-frequency terms). + * float density.lambda: Lambda parameter used in the computation of a + * candidate document's density (smoothing for 0-frequency terms). * - * float density.beta: Beta parameter used in the computation of a - * candidate document's density (sharpness of the KL-divergence). + * float density.beta: Beta parameter used in the computation of a + * candidate document's density (sharpness of the KL-divergence). * - * int label_fs.max: Use the `label_fs' most informative features to - * train the Naive Bayes classifiers used during labeling to - * compute disagreement for a document. + * int label_fs.max: Use the `label_fs' most informative features to + * train the Naive Bayes classifiers used during labeling to + * compute disagreement for a document. * - * float threshold: Threshold used to convert a pseudo-probability to a - * hard classification decision. Documents with pseudo-probability - * >= `threshold' are classified as positive instances. + * float threshold: Threshold used to convert a pseudo-probability to a + * hard classification decision. Documents with pseudo-probability + * >= `threshold' are classified as positive instances. * - * string final_algo: Algorithm to use for finalization; 'lr' for - * logistic regression, or 'nb' for Naive Bayes; default 'lr'. + * string final_algo: Algorithm to use for finalization; 'lr' for + * logistic regression, or 'nb' for Naive Bayes; default 'lr'. * - * int final_fs.max: Use the `final_fs' most informative features to - * train the final classifier. + * int final_fs.max: Use the `final_fs' most informative features to + * train the final classifier. * * @var array */ @@ -337,9 +337,9 @@ class Classifier implements CrawlConstants * the time of construction. * * @param string $label class label applied to positive instances of the - * class this classifier is trained to recognize + * class this classifier is trained to recognize * @param array $options optional associative array of options that will - * override the default options + * override the default options */ function __construct($label, $options = array()) { @@ -354,7 +354,7 @@ class Classifier implements CrawlConstants * stored in individual, compressed files. * * @return array names of properties to store when serializing this - * instance + * instance */ function __sleep() { @@ -462,7 +462,7 @@ class Classifier implements CrawlConstants * @param string $key key used to select the document from the docs array * @param int $label new label (-1, 1, or 0) * @param bool $is_active whether this operation is being carried out - * during active labeling + * during active labeling * @return bool true if the training set was modified, and false otherwise */ function labelDocument($key, $label, $is_active = true) @@ -523,7 +523,7 @@ class Classifier implements CrawlConstants * @param object $mix_iterator crawl mix iterator to draw documents from * @param int $label label to apply to every document; -1 or 1, but NOT 0 * @param int $limit optional upper bound on the number of documents to - * add; defaults to no limit + * add; defaults to no limit * @return int total number of newly-labeled documents */ function addAllDocuments($mix_iterator, $label, $limit = INF) { @@ -558,7 +558,7 @@ class Classifier implements CrawlConstants * * @param object $mix_iterator crawl mix iterator to draw documents from * @param int $buffer_size optional buffer size to use; defaults to the - * runtime parameter + * runtime parameter * @return int final buffer size */ function initBuffer($mix_iterator, $buffer_size = NULL) @@ -583,7 +583,7 @@ class Classifier implements CrawlConstants * * @param object $mix_iterator crawl mix iterator to draw documents from * @param int $buffer_size optional buffer size to use; defaults to the - * runtime parameter + * runtime parameter * @return int final buffer size */ function refreshBuffer($mix_iterator, $buffer_size = NULL) @@ -662,9 +662,9 @@ class Classifier implements CrawlConstants * set of features. * * @return array two-element array containing first the best candidate, and - * second the disagreement score, obtained by dividing the disagreement - * for the document by the maximum disagreement possible for the committee - * size + * second the disagreement score, obtained by dividing the disagreement + * for the document by the maximum disagreement possible for the committee + * size */ function findNextDocumentToLabel() { @@ -704,9 +704,9 @@ class Classifier implements CrawlConstants * Trains the Naive Bayes classification algorithm used during labeling on * the current training set, and optionally updates the estimated accuracy. * - * @param bool update_accuracy optional parameter specifying whether or not - * to update the accuracy estimate after training completes; defaults to - * false + * @param bool $update_accuracy optional parameter specifying whether or not + * to update the accuracy estimate after training completes; defaults + * to false */ function train($update_accuracy = false) { @@ -733,10 +733,10 @@ class Classifier implements CrawlConstants * blocks have been used for testing, and the average accuracy recorded. * * @param object $X optional sparse matrix representing the already-mapped - * training set to use; if not provided, the current training set is - * mapped using the label_features property + * training set to use; if not provided, the current training set is + * mapped using the label_features property * @param array $y optional array of document labels corresponding to the - * training set; if not provided the current training set labels are used + * training set; if not provided the current training set labels are used */ function updateAccuracy($X = NULL, $y = NULL) { @@ -817,7 +817,7 @@ class Classifier implements CrawlConstants * * @param array $page page summary array for the page to be classified * @return float pseudo-probability that the page is a positive instance of - * the target class + * the target class */ function classify($page) { @@ -843,7 +843,7 @@ class Classifier implements CrawlConstants * * @param array $page page summary for the document to add to the buffer * @param bool $is_active whether this operation is part of active - * training, in which case some extra statistics must be maintained + * training, in which case some extra statistics must be maintained */ function addBufferDoc($page, $is_active = true) { @@ -875,7 +875,7 @@ class Classifier implements CrawlConstants * document being removed are maintained. * * @param bool $is_active whether this operation is part of active - * training, in which case some extra statistics must be maintained + * training, in which case some extra statistics must be maintained */ function dropBufferDoc($is_active = true) { @@ -908,7 +908,7 @@ class Classifier implements CrawlConstants * * @param string $description string to tokenize * @return array associative array mapping terms to their within-string - * frequencies + * frequencies */ function tokenizeDescription($description) { @@ -940,7 +940,7 @@ class Classifier implements CrawlConstants * as a variable number of arguments. * * @param string $property_name,... variably-sized list of property names - * to try to load data for + * to try to load data for */ function loadProperties(/* args... */) { @@ -993,9 +993,9 @@ class Classifier implements CrawlConstants * * @param array $summary page summary to classify, passed by reference * @param array $classifiers list of Classifier instances, each prepared - * for classifying (via the prepareToClassify method) - * @param array &$active_classifiers - * @param array &$active_rankers + * for classifying (via the prepareToClassify method) + * @param array& $active_classifiers + * @param array& $active_rankers */ static function labelPage(&$summary, $classifiers, &$active_classifiers, &$active_rankers) @@ -1032,7 +1032,7 @@ class Classifier implements CrawlConstants * containing only summary statistics. * * @return array associative array of class labels mapped to their - * corresponding classifier instances + * corresponding classifier instances */ static function getClassifierList() { @@ -1052,7 +1052,7 @@ class Classifier implements CrawlConstants * * @param string $label classifier's class label * @return object classifier instance with the relevant class label, or - * NULL if no such classifier exists on disk + * NULL if no such classifier exists on disk */ static function getClassifier($label) { @@ -1074,7 +1074,7 @@ class Classifier implements CrawlConstants * * @param array $labels flat array of class labels for which to load data * @return array associative array mapping class labels to arrays of data - * necessary for initializing the associated classifier + * necessary for initializing the associated classifier */ static function loadClassifiersData($labels) { @@ -1109,7 +1109,7 @@ class Classifier implements CrawlConstants * name server when establishing a new crawl. * * @param array $data associative array mapping property names to their - * serialized and compressed data + * serialized and compressed data * @return object Classifier instance built from the passed-in data */ static function newClassifierFromData($data) @@ -1135,7 +1135,7 @@ class Classifier implements CrawlConstants * The classifier directory and all of its contents are made world-writable * so that they can be manipulated without hassle from the command line. * - * @param object Classifier instance to store to disk + * @param object $classifier Classifier instance to store to disk */ static function setClassifier($classifier) { @@ -1182,7 +1182,7 @@ class Classifier implements CrawlConstants * * @param string $label class label associated with the crawl mix * @return string name that can be used for the crawl mix associated with - * $label + * $label */ static function getCrawlMixName($label) { @@ -1209,9 +1209,9 @@ class Classifier implements CrawlConstants * classification score to the same document. * * @param array $ps probabilities describing several discrete two-element - * probability distributions + * probability distributions * @return float KL-divergence to the mean for the collection of - * distributions + * distributions */ static function klDivergenceToMean($ps) { diff --git a/lib/classifiers/classifier_algorithm.php b/lib/classifiers/classifier_algorithm.php index 962ccf5b5..a54ea5975 100644 --- a/lib/classifiers/classifier_algorithm.php +++ b/lib/classifiers/classifier_algorithm.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -44,9 +44,16 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} */ abstract class ClassifierAlgorithm { - // TODO: Add in automatic parameter setting, and better logging facilities, - // similar to those used by classifier_tool. + /** + * Flag used to control level of debug messages for now 0 == no messages, + * anything else causes messages to be output + * @var int + */ var $debug = 0; + /** + * Write a message to log file depending on debug level for this subpackage + * @param string $message what to write to the log + */ function log($message) { if ($this->debug > 0) { diff --git a/lib/classifiers/feature_selection.php b/lib/classifiers/feature_selection.php index de413d371..75f8b99d1 100644 --- a/lib/classifiers/feature_selection.php +++ b/lib/classifiers/feature_selection.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -49,7 +49,7 @@ abstract class FeatureSelection * Sets any passed runtime parameters. * * @param array $parameters optional associative array of parameters to - * replace the default ones with + * replace the default ones with */ function __construct($parameters = array()) { @@ -63,9 +63,9 @@ abstract class FeatureSelection * which is used as an intercept term. * * @param object $selected max heap containing entries ordered by - * informativeness and feature index. + * informativeness and feature index. * @return array associative array mapping a subset of the original feature - * indices to the new indices + * indices to the new indices */ function buildMap($selected) { @@ -87,7 +87,7 @@ abstract class FeatureSelection * * @param object $features Features instance * @return array associative array mapping a subset of the original feature - * indices to new indices + * indices to new indices */ abstract function select(Features $features); } @@ -116,7 +116,7 @@ class ChiSquaredFeatureSelection extends FeatureSelection * * @param object $features full feature set * @return array associative array mapping a subset of the original feature - * indices to new indices + * indices to new indices */ function select(Features $features) { diff --git a/lib/classifiers/features.php b/lib/classifiers/features.php index 51972156f..c6c2b2313 100644 --- a/lib/classifiers/features.php +++ b/lib/classifiers/features.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -83,7 +83,7 @@ abstract class Features * terms with feature indices. * * @param array $terms array of terms mapped to the number of times they - * occur in the example + * occur in the example * @param int $label label for this example, either -1 or 1 * @return array input example with terms replaced by feature indices */ @@ -119,10 +119,10 @@ abstract class Features * one occurrence of a term per example. * * @param array $features feature vector from when the example was - * originally added + * originally added * @param int $old_label old example label in {-1, 1} * @param int $new_label new example label in {-1, 0, 1}, where 0 indicates - * that the example should be removed entirely + * that the example should be removed entirely */ function updateExampleLabel($features, $old_label, $new_label) { @@ -154,7 +154,7 @@ abstract class Features * Returns the positive and negative label counts for the training set. * * @return array positive and negative label counts indexed by label, - * either 1 or -1 + * either 1 or -1 */ function labelStats() { @@ -166,10 +166,10 @@ abstract class Features * fails to appear in examples with or without the target label. They are * returned in a flat array, in the following order: * - * 0 => # examples where feature present, label matches - * 1 => # examples where feature present, label doesn't match - * 2 => # examples where feature absent, label matches - * 3 => # examples where feature absent, label doesn't match + * 0 => # examples where feature present, label matches + * 1 => # examples where feature present, label doesn't match + * 2 => # examples where feature absent, label matches + * 3 => # examples where feature absent, label doesn't match * * @param int $j feature index * @param int $label target label @@ -196,7 +196,7 @@ abstract class Features * indices from the larger feature set to indices for the reduced set. * * @param object $fs FeatureSelection instance to be used to select the - * most informative terms + * most informative terms * @return object new Features instance using the restricted feature set */ function restrict(FeatureSelection $fs) @@ -243,10 +243,10 @@ abstract class Features * returned unmodified. * * @param array $features feature vector mapping feature indices to - * frequencies + * frequencies * @return array original feature vector with indices mapped - * according to the feature_map property, and any features that don't - * occcur in feature_map dropped + * according to the feature_map property, and any features that don't + * occcur in feature_map dropped */ function mapToRestrictedFeatures($features) { @@ -271,9 +271,9 @@ abstract class Features * set prior to its input to a classification algorithm. * * @param array $docs array of training examples represented as feature - * vectors where the values are per-example counts + * vectors where the values are per-example counts * @return object SparseMatrix instance whose rows are the transformed - * feature vectors + * feature vectors */ abstract function mapTrainingSet($docs); /** @@ -283,9 +283,9 @@ abstract class Features * document prior to classification. * * @param array $tokens associative array of terms mapped to their - * within-document counts + * within-document counts * @return array feature vector corresponding to the tokens, mapped - * according to the implementation of a particular Features subclass + * according to the implementation of a particular Features subclass */ abstract function mapDocument($tokens); } @@ -312,9 +312,9 @@ class BinaryFeatures extends Features * more thorough introduction to the interface. * * @param array $docs array of training examples represented as feature - * vectors where the values are per-example counts + * vectors where the values are per-example counts * @return object SparseMatrix instance whose rows are the transformed - * feature vectors + * feature vectors */ function mapTrainingSet($docs) { @@ -341,9 +341,9 @@ class BinaryFeatures extends Features * corresponding sparse binary feature vector used for classification. * * @param array $tokens associative array of terms mapped to their - * within-document counts + * within-document counts * @return array feature vector corresponding to the tokens, mapped - * according to the implementation of a particular Features subclass + * according to the implementation of a particular Features subclass */ function mapDocument($tokens) { @@ -370,9 +370,24 @@ class BinaryFeatures extends Features */ class WeightedFeatures extends Features { + /** + * Number of trainin examples + * @var int + */ var $D = 0; + /** + * Number of elements in Vocabulary + * @var int + */ var $n = array(); - + /** + * {@inheritDocs} + * + * @param array $docs array of training examples represented as feature + * vectors where the values are per-example counts + * @return object SparseMatrix instance whose rows are the transformed + * feature vectors + */ function mapTrainingSet($docs) { $m = count($this->examples); @@ -411,6 +426,14 @@ class WeightedFeatures extends Features } return array($X, $y); } + /** + * {@inheritDocs} + * + * @param array $tokens associative array of terms mapped to their + * within-document counts + * @return array feature vector corresponding to the tokens, mapped + * according to the implementation of a particular Features subclass + */ function mapDocument($tokens) { $u = array(); @@ -495,7 +518,7 @@ class SparseMatrix implements Iterator //Iterator is built-in to PHP */ function columns() { - return $this->n; + return $this->n; } /** * Accessor method which the number of nonzero entries in the matrix @@ -524,7 +547,7 @@ class SparseMatrix implements Iterator //Iterator is built-in to PHP * @param array $a_indices row indices for first new sparse matrix * @param array $b_indices row indices for second new sparse matrix * @return array array with two entries corresponding to the first and - * second new matrices + * second new matrices */ function partition($a_indices, $b_indices) { @@ -541,10 +564,29 @@ class SparseMatrix implements Iterator //Iterator is built-in to PHP return array($a, $b); } /* Iterator Interface */ + /** + * Resets the iterator + */ function rewind() { reset($this->data); } + /** + * Returns the current iterated over row + * @return array current row + */ function current() { return current($this->data); } + /** + * Returns the index of the current row + * @return int index of row + */ function key() { return key($this->data); } + /** + * Returns the next row to be iterated over + * @return array next row + */ function next() { return next($this->data); } + /** + * Whether the current key position is not null + * @return bool whether it is null or not + */ function valid() { return !is_null(key($this->data)); } } ?> diff --git a/lib/classifiers/lasso_regression.php b/lib/classifiers/lasso_regression.php index eceb82840..5f1fb43ee 100644 --- a/lib/classifiers/lasso_regression.php +++ b/lib/classifiers/lasso_regression.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -192,7 +192,7 @@ class LassoRegression extends ClassifierAlgorithm * examples of the target class. * * @param array $x feature vector represented by an associative array - * mapping features to their weights + * mapping features to their weights */ function classify($x) { @@ -208,14 +208,14 @@ class LassoRegression extends ClassifierAlgorithm * returns it as a pair <numerator, denominator>. * * @param object $Xj iterator over the non-zero entries in column j of the - * data + * data * @param array $y labels corresponding to entries in $Xj; each label is 1 - * if example i has the target label, and -1 otherwise + * if example i has the target label, and -1 otherwise * @param array $r cached dot products of the beta vector and feature - * weights for each example i + * weights for each example i * @param float $d trust region for feature j * @return array two-element array containing the numerator and denominator - * of the likelihood + * of the likelihood */ function computeApproxLikelihood($Xj, $y, $r, $d) { @@ -243,12 +243,12 @@ class LassoRegression extends ClassifierAlgorithm * much a given optimization step improved the likelihood of the data set. * * @param array $r cached dot products of the beta vector and feature - * weights for each example i + * weights for each example i * @param array $y labels for each example * @param array $beta beta vector of feature weights (used to - * penalize large weights) + * penalize large weights) * @return float value proportional to the likelihood of the data, - * penalized by the magnitude of the beta vector + * penalized by the magnitude of the beta vector */ function score($r, $y, $beta) { @@ -261,7 +261,7 @@ class LassoRegression extends ClassifierAlgorithm * Estimates the lambda parameter from the dataset. * * @param object $invX inverted X matrix for dataset (essentially a posting - * list of features in X) + * list of features in X) * @return float lambda estimate */ function estimateLambdaNorm($invX) diff --git a/lib/classifiers/naive_bayes.php b/lib/classifiers/naive_bayes.php index a8bb1db99..d33e17fc8 100644 --- a/lib/classifiers/naive_bayes.php +++ b/lib/classifiers/naive_bayes.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -103,8 +103,8 @@ class NaiveBayes extends ClassifierAlgorithm * construct classifier committees. * * @param object $features Features instance for the training set, used to - * determine how often a given feature occurs in positive and negative - * examples + * determine how often a given feature occurs in positive and negative + * examples */ function sampleBeta($features) { @@ -133,7 +133,7 @@ class NaiveBayes extends ClassifierAlgorithm * examples of the target class. * * @param array $x feature vector represented by an associative array - * mapping features to their weights + * mapping features to their weights */ function classify($x) { @@ -171,9 +171,9 @@ class NaiveBayes extends ClassifierAlgorithm * of the uniform deviates. * * @param int $alpha parameter to Gamma distribution (in practice, a count - * of occurrences of some feature) + * of occurrences of some feature) * @return float a deviate from the Gamma distribution parameterized by - * $alpha + * $alpha */ function sampleGammaDeviate($alpha) { diff --git a/lib/compressors/compressor.php b/lib/compressors/compressor.php index 3024d498a..f15ffdcc9 100755 --- a/lib/compressors/compressor.php +++ b/lib/compressors/compressor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -71,7 +71,7 @@ interface Compressor * the compression algorithm underlying the compressor. * * @param string $my_compressed_int the fixed length string containing - * the packed int to extract + * the packed int to extract * @return int the integer contained in that string */ function uncompressInt($my_compressed_int); diff --git a/lib/compressors/gzip_compressor.php b/lib/compressors/gzip_compressor.php index 44d5e5f8a..dbfabc888 100755 --- a/lib/compressors/gzip_compressor.php +++ b/lib/compressors/gzip_compressor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -99,7 +99,7 @@ class GzipCompressor implements Compressor * gzip header. * * @param string $my_compressed_int the fixed length string containing - * the packed int to extract + * the packed int to extract * @return int the integer contained in that string */ function uncompressInt($my_compressed_int) diff --git a/lib/compressors/non_compressor.php b/lib/compressors/non_compressor.php index 4bc09b871..353a53a6c 100755 --- a/lib/compressors/non_compressor.php +++ b/lib/compressors/non_compressor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -40,9 +40,9 @@ require_once "compressor.php"; */ require_once BASE_DIR."/lib/utility.php"; /** - * Implementation of a trivial Compressor. + * Implementation of a trivial Compressor. * - * NonCompressor's compress and uncompress filter return the string unchanged + * NonCompressor's compress and uncompress filter return the string unchanged * * @author Chris Pollett * @package seek_quarry @@ -92,7 +92,7 @@ class NonCompressor implements Compressor * compressor doesn't compress we just use unpack * * @param string $my_compressed_int the fixed length string containing - * the packed int to extract + * the packed int to extract * @return int the integer contained in that string */ function uncompressInt($my_compressed_int) { diff --git a/lib/crawl_constants.php b/lib/crawl_constants.php index 6e62f4d7b..011f31fe5 100755 --- a/lib/crawl_constants.php +++ b/lib/crawl_constants.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -42,15 +42,15 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} interface CrawlConstants { /** - * Used to say what kind of queue_server this is + * Used to say what kind of queue_server this is */ const BOTH = "IndexerAndScheduler"; /** - * Used to say what kind of queue_server this is + * Used to say what kind of queue_server this is */ const INDEXER = "Indexer"; /** - * Used to say what kind of queue_server this is + * Used to say what kind of queue_server this is */ const SCHEDULER = "Scheduler"; const queue_base_name = "QueueBundle"; diff --git a/lib/crawl_daemon.php b/lib/crawl_daemon.php index 6cd7e1b8d..ec38ab556 100644 --- a/lib/crawl_daemon.php +++ b/lib/crawl_daemon.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -40,7 +40,7 @@ require_once BASE_DIR."/configs/config.php"; */ require_once BASE_DIR."/lib/utility.php"; /** - * Load common constants for crawling + * Load common constants for crawling */ require_once BASE_DIR."/lib/crawl_constants.php"; /** @@ -62,9 +62,9 @@ class CrawlDaemon implements CrawlConstants */ static $name; /** - * Subname of the name prefix used on files associated with this daemon - * For example, the name might be fetcher, the subname might 2 to indicate - * which fetcher daemon instance. + * Subname of the name prefix used on files associated with this daemon + * For example, the name might be fetcher, the subname might 2 to indicate + * which fetcher daemon instance. * * @var string * @static @@ -82,7 +82,7 @@ class CrawlDaemon implements CrawlConstants * time has elapsed since the last processHandler call it stops the process * * @param bool $continue if true only stop if lock file not present, - * ignore PROCESS_TIMEOUT time being exceeded. + * ignore PROCESS_TIMEOUT time being exceeded. */ static function processHandler($continue = false) { @@ -119,17 +119,17 @@ class CrawlDaemon implements CrawlConstants * foreground. * * @param array $argv an array of command line arguments. The argument - * start will check if the process control functions exists if these - * do they will fork and detach a child process to act as a daemon. - * a lock file will be created to prevent additional daemons from - * running. If the message is stop then a message file is written to - * tell the daemon to stop. If the argument is terminal then the - * program won't be run as a daemon. + * start will check if the process control functions exists if these + * do they will fork and detach a child process to act as a daemon. + * a lock file will be created to prevent additional daemons from + * running. If the message is stop then a message file is written to + * tell the daemon to stop. If the argument is terminal then the + * program won't be run as a daemon. * @param string $name the prefix to use for lock and message files * @param bool $exit_type whether this function should exit or return - * by default a lock file is only written if exit (this allows - * both queue server processes (Indexer and Scheduler) to use the - * same lock file + * by default a lock file is only written if exit (this allows + * both queue server processes (Indexer and Scheduler) to use the + * same lock file */ static function init($argv, $name, $exit_type = 1) { @@ -201,14 +201,14 @@ class CrawlDaemon implements CrawlConstants * Used to start a daemon running in the background * * @param string $name the main name of this daemon such as queue_server - * or fetcher. + * or fetcher. * @param string $subname the instance name if it is possible for more - * than one copy of the daemon to be running at the same time + * than one copy of the daemon to be running at the same time * @param string $options a string of additional command line options * @param bool $exit whether this function should exit or return - * by default a lock file is only written if exit (this allows - * both queue server processes (Indexer and Scheduler) to use the - * same lock file + * by default a lock file is only written if exit (this allows + * both queue server processes (Indexer and Scheduler) to use the + * same lock file */ static function start($name, $subname = "", $options = "", $exit = 1) { @@ -259,9 +259,11 @@ class CrawlDaemon implements CrawlConstants * Used to stop a daemon that is running in the background * * @param string $name the main name of this daemon such as queue_server - * or fetcher. + * or fetcher. * @param string $subname the instance name if it is possible for more - * than one copy of the daemon to be running at the same time + * than one copy of the daemon to be running at the same time + * @param bool $exit whether this method should just return (false) or + * call exit() (true) */ static function stop($name, $subname = "", $exit = true) { @@ -282,12 +284,12 @@ class CrawlDaemon implements CrawlConstants * messages to a daemon running in the background * * @param string $name the main name of this daemon such as queue_server - * or fetcher. + * or fetcher. * @param string $subname the instance name if it is possible for more - * than one copy of the daemon to be running at the same time + * than one copy of the daemon to be running at the same time * * @return string the name of the message file for the daemon with - * the given name and subname + * the given name and subname */ static function getMesssageFileName($name, $subname = "") { @@ -299,12 +301,12 @@ class CrawlDaemon implements CrawlConstants * by a daemon * * @param string $name the main name of this daemon such as queue_server - * or fetcher. + * or fetcher. * @param string $subname the instance name if it is possible for more - * than one copy of the daemon to be running at the same time + * than one copy of the daemon to be running at the same time * * @return string the name of the lock file for the daemon with - * the given name and subname + * the given name and subname */ static function getLockFileName($name, $subname = "") { @@ -315,9 +317,9 @@ class CrawlDaemon implements CrawlConstants * Used to return a string name for a given daemon instance * * @param string $name the main name of this daemon such as queue_server - * or fetcher. + * or fetcher. * @param string $subname the instance name if it is possible for more - * than one copy of the daemon to be running at the same time + * than one copy of the daemon to be running at the same time * * @return string a single name that combines the name and subname */ diff --git a/lib/fetch_git_repository_urls.php b/lib/fetch_git_repository_urls.php index c0fd33827..2aaf54840 100755 --- a/lib/fetch_git_repository_urls.php +++ b/lib/fetch_git_repository_urls.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Snigdha Rao Parvatneni * @package seek_quarry @@ -220,13 +220,17 @@ class FetchGitRepositoryUrls implements CrawlConstants return $repository_type; } /** - * Checks repository type based on extension + * Sets up the seed sites with urls from a git repository (updates + * these sites if have already started downloading from repository) * * @param string $url_to_check url needs to be processed * @param int $counter to keep track of number of urls processed * @param array $seeds store sites which are ready to be downloaded * @param array $repository_indicator indicates the type of the repository * @param array $site_pair contains original Git url crawled + * @param int $total_git_urls number of urls in repository less those + * already processed + * @param array $all_git_urls current list of urls from git repository * @return array $git_internal_urls containing all the internal Git urls * fetched from the parent Git url */ @@ -306,7 +310,7 @@ class FetchGitRepositoryUrls implements CrawlConstants * * @param string $url_to_check url needs to be processed * @return an array $git_next_urls consists of list of Git - * internal urls wich are called during the git clone + * internal urls wich are called during the git clone */ static function fetchGitRepositoryUrl($url_to_check) { @@ -358,7 +362,7 @@ class FetchGitRepositoryUrls implements CrawlConstants } /** * Get the Git third url which contains the information about the - * organization of entire git repository + * organization of entire git repository * * @param string $git_second_url_content contents of Git second url * @param string $git_base_url common portion of git urls @@ -379,7 +383,7 @@ class FetchGitRepositoryUrls implements CrawlConstants } /** * Get the Git content from url which will be used to get the - * next git url + * next git url * * @param string $git_url git url to extract contents from it * @param string $compression_indicator indicator for compress and @@ -404,7 +408,7 @@ class FetchGitRepositoryUrls implements CrawlConstants * Get the Git blob and tree objects * * @param string $git_object_content compressed content of git master tree - * file + * file * @param string $git_base_url common content of git url * @return array $blob_url contains information and url for git blob objects */ @@ -464,7 +468,7 @@ class FetchGitRepositoryUrls implements CrawlConstants * @param string $git_tree_position first occuence of git tree access code * @param string $git_object_content compressed content of git master tree * @return array $git_object_positions length of the compressed content - * afterthe access code + * afterthe access code */ static function checkPosition($git_blob_position, $git_tree_position, $git_object_content) @@ -485,7 +489,7 @@ class FetchGitRepositoryUrls implements CrawlConstants * * @param string $git_object_content compressed content of git master tree * @param string $blob_position first occuence of git blob access code - * in $content + * in $content * @param string $length length of the compressed content of git master tree * @param string $git_base_url common portion of git url * @return array $git_blob_content contains details of git blob object @@ -528,7 +532,7 @@ class FetchGitRepositoryUrls implements CrawlConstants * * @param string $git_object_content compressed content of git master tree * @param string $tree_position first occuence of git tree access code in - * the $content + * the $content * @param string $length length of the compressed content of git master tree * @param string $git_base_url common portion of git url * @return array $git_tree_content contains details of git blob object diff --git a/lib/fetch_url.php b/lib/fetch_url.php index b57788497..a9b1db237 100755 --- a/lib/fetch_url.php +++ b/lib/fetch_url.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -52,21 +52,21 @@ class FetchUrl implements CrawlConstants * @param array $sites an array containing urls of pages to request * @param bool $timer flag, true means print timing statistics to log * @param int $page_range_request maximum number of bytes to download/page - * 0 means download all + * 0 means download all * @param string $temp_dir folder to store temporary ip header info * @param string $key the component of $sites[$i] that has the value of - * a url to get defaults to URL + * a url to get defaults to URL * @param string $value component of $sites[$i] in which to store the - * page that was gotten + * page that was gotten * @param bool $minimal if true do a faster request of pages by not - * doing things like extract HTTP headers sent, etcs + * doing things like extract HTTP headers sent, etcs * @param array $post_data data to be POST'd to each site * @param bool $follow whether to follow redirects or not * @param string $tor_proxy url of a proxy that knows how to download - * .onion urls + * .onion urls * @param array $proxy_servers if not array(), then an array of proxy - * server to use rather than to directly download web pages from - * the current machine + * server to use rather than to directly download web pages from + * the current machine * * @return array an updated array with the contents of those pages */ @@ -255,11 +255,11 @@ class FetchUrl implements CrawlConstants * work. The http Host: with the url is added a header after the * for the curl request. The job of this function is to do this replace * @param string $url site to download with ip address at end potentially - * afte ### + * afte ### * @param bool $minimal don't try to do replacement, but do add an Expect - * header + * header * @param array $proxy_servers if not empty an array of proxy servers - * used to crawl through + * used to crawl through * @return array 3-tuple (orig url, url with replacement, http header array) */ static function prepareUrlHeaders($url, $minimal = false, @@ -336,8 +336,8 @@ class FetchUrl implements CrawlConstants * Computes a hash of a string containing page data for use in * deduplication of pages with similar content * - * @param string &$page web page data - * @return string 8 byte hash to identify page contents + * @param string& $page reference to web page data + * @return string 8 byte hash to identify page contents */ static function computePageHash(&$page) { @@ -362,15 +362,15 @@ class FetchUrl implements CrawlConstants return crawlHash($dedup_string, true); } /** - * Splits an http response document into the http headers sent - * and the web page returned. Parses out useful information from - * the header and return an array of these two parts and the useful info. + * Splits an http response document into the http headers sent + * and the web page returned. Parses out useful information from + * the header and return an array of these two parts and the useful info. * - * @param string &$header_and_page reference to string of downloaded data - * @param string $value field to store the page portion of page - * @return array info array consisting of a header, page for an http - * response, as well as parsed from the header the server, server - * version, operating system, encoding, and date information. + * @param string& $header_and_page reference to string of downloaded data + * @param string $value field to store the page portion of page + * @return array info array consisting of a header, page for an http + * response, as well as parsed from the header the server, server + * version, operating system, encoding, and date information. */ static function parseHeaderPage(&$header_and_page, $value=CrawlConstants::PAGE) @@ -528,7 +528,7 @@ class FetchUrl implements CrawlConstants /** * Computes the IP address from http get-responser header * - * @param string contains complete transcript of HTTP get/response + * @param string $header contains complete transcript of HTTP get/response * @return string IPv4 address as a string of dot separated quads. */ static function getCurlIp($header) @@ -552,14 +552,14 @@ class FetchUrl implements CrawlConstants } } /** - * Make a curl request for the provide url + * Make a curl request for the provide url * - * @param string $site url of page to request - * @param string $post_data any data to be POST'd to the URL - * @param bool whether or not to check the response for the words, - * NOTICE, WARNING, FATAL which might indicate an error on the server - * - * @return string the contents of what the curl request fetched + * @param string $site url of page to request + * @param string $post_data any data to be POST'd to the URL + * @param bool $check_for_errors whether or not to check the response + * for the words, NOTICE, WARNING, FATAL which might indicate an + * error on the server + * @return string the contents of what the curl request fetched */ static function getPage($site, $post_data = NULL, $check_for_errors = false) { @@ -612,10 +612,10 @@ class FetchUrl implements CrawlConstants return $response; } /** - * Given the results of a getPage call, check whether or not the response - * had the words NOTICE, WARNING, FATAL which might indicate an error on - * the server. If it does, then the $response string is sent to the - * crawlLog + * Given the results of a getPage call, check whether or not the response + * had the words NOTICE, WARNING, FATAL which might indicate an error on + * the server. If it does, then the $response string is sent to the + * crawlLog * * @param string $response getPage response in which to check for errors */ diff --git a/lib/file_cache.php b/lib/file_cache.php index 178204ca1..089c7bdec 100644 --- a/lib/file_cache.php +++ b/lib/file_cache.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -80,7 +80,7 @@ class FileCache * * @param string $key the key to look up * @return mixed the data associated with the key if it exists, false - * otherwise + * otherwise */ function get($key) { @@ -136,7 +136,7 @@ class FileCache * Makes a 0 - self::NUMBER_OF_BINS value out of the provided key * * @param string $key to convert to a random value between - * 0 - self::NUMBER_OF_BINS + * 0 - self::NUMBER_OF_BINS * @return int value between 0 and self::NUMBER_OF_BINS */ function checksum($key) diff --git a/lib/hash_table.php b/lib/hash_table.php index 386087cbb..caf70f1dd 100755 --- a/lib/hash_table.php +++ b/lib/hash_table.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -105,8 +105,8 @@ class HashTable extends StringArray * @param int $num_values number of key value pairs the table can hold * @param int $key_size number of bytes to store a hash table key * @param int $value_size number of bytes to store a hash table value - * @param int $save_fequency how many non read operation before saving to - * disk + * @param int $save_frequency how many non read operation before saving to + * disk */ function __construct($fname, $num_values, $key_size, $value_size, $save_frequency = self::DEFAULT_SAVE_FREQUENCY) @@ -123,10 +123,10 @@ class HashTable extends StringArray * Inserts the provided $key - $value pair into the hash table * * @param string $key the key to use for the insert (will be needed for - * lookup) + * lookup) * @param string $value the value associated with $key * @param int $probe if the location in the hash table is already known - * to be $probe then this variable can be used to save a lookup + * to be $probe then this variable can be used to save a lookup * @return bool whether the insert was successful or not */ function insert($key, $value, $probe = false) @@ -171,14 +171,14 @@ class HashTable extends StringArray * * @param string $key key to look up in the hash table * @param int $return_probe_value one of self::ALWAYS_RETURN_PROBE, - * self::RETURN_PROBE_ON_KEY_FOUND, self::RETURN_VALUE, or self::BOTH. - * Here value means the value associated with the key and probe is - * either the location in the array where the key was found or - * the first location in the array where it was determined the - * key could not be found. + * self::RETURN_PROBE_ON_KEY_FOUND, self::RETURN_VALUE, or self::BOTH. + * Here value means the value associated with the key and probe is + * either the location in the array where the key was found or + * the first location in the array where it was determined the + * key could not be found. * @return mixed would be string if the value is being returned, - * an int if the probe is being returned, and false if the key - * is not found + * an int if the probe is being returned, and false if the key + * is not found */ function lookup($key, $return_probe_value = self::RETURN_VALUE) { @@ -196,16 +196,16 @@ class HashTable extends StringArray * * @param string $key key to look up in the hash table * @param array $null_array key values that would cut-off the search - * for key if the initial probe failed + * for key if the initial probe failed * @param int $return_probe_value one of self::ALWAYS_RETURN_PROBE, - * self::RETURN_PROBE_ON_KEY_FOUND, or self::RETURN_VALUE. Here - * value means the value associated with the key and probe is - * either the location in the array where the key was found or - * the first location in the array where it was determined the - * key could not be found. + * self::RETURN_PROBE_ON_KEY_FOUND, or self::RETURN_VALUE. Here + * value means the value associated with the key and probe is + * either the location in the array where the key was found or + * the first location in the array where it was determined the + * key could not be found. * @return mixed would be string if the value is being returned, - * an int if the probe is being returned, and false if the key - * is not found + * an int if the probe is being returned, and false if the key + * is not found */ function lookupArray($key, $null_array, $return_probe_value = self::RETURN_VALUE) @@ -244,7 +244,7 @@ class HashTable extends StringArray * * @param string $key the key to delete the entry for * @param int $probe if the location in the hash table is already known - * to be $probe then this variable can be used to save a lookup + * to be $probe then this variable can be used to save a lookup * @return bool whether or not something was deleted */ function delete($key, $probe = false) diff --git a/lib/index_archive_bundle.php b/lib/index_archive_bundle.php index 925fa0f83..5ff1eac70 100644 --- a/lib/index_archive_bundle.php +++ b/lib/index_archive_bundle.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -64,8 +64,8 @@ require_once 'crawl_constants.php'; * offsets for documents containing that word for some particular IndexShard * generation.</li> * <li>A set of index shard generations. These generations - * have names index0, index1,... A shard has word entries, word doc entries - * and document entries. For more information see the index shard + * have names index0, index1,... A shard has word entries, word doc entries + * and document entries. For more information see the index shard * documentation. * </li> * <li> @@ -133,18 +133,22 @@ class IndexArchiveBundle implements CrawlConstants */ var $version; /** - * Threshold hold beyond which we don't load old index shard when - * restarting and instead just advance to a new shard + * Threshold hold beyond which we don't load old index shard when + * restarting and instead just advance to a new shard */ const NO_LOAD_SIZE = 50000000; /** * Makes or initializes an IndexArchiveBundle with the provided parameters * * @param string $dir_name folder name to store this bundle + * @param bool $read_only_archive whether to open archive only for reading + * or reading and writing * @param int $num_partitions_summaries number of WebArchive partitions * to use in the summmaries WebArchiveBundle * @param string $description a text name/serialized info about this * IndexArchiveBundle + * @param int $num_docs_per_generation the number of pages to be stored + * in a single shard */ function __construct($dir_name, $read_only_archive = true, $description = NULL, $num_docs_per_generation = NUM_DOCS_PER_GENERATION) @@ -187,10 +191,10 @@ class IndexArchiveBundle implements CrawlConstants * * @param int $generation field used to select partition * @param string $offset_field field used to record offsets after storing - * @param array &$pages data to store + * @param array& $pages data to store * @param int $visited_urls_count number to add to the count of visited urls - * (visited urls is a smaller number than the total count of objects - * stored in the index). + * (visited urls is a smaller number than the total count of objects + * stored in the index). */ function addPages($generation, $offset_field, &$pages, $visited_urls_count) @@ -204,7 +208,7 @@ class IndexArchiveBundle implements CrawlConstants * Expects initGenerationToAdd to be called before, so generation is correct * * @param object $index_shard a mini inverted index of word_key=>doc data - * to add to this IndexArchiveBundle + * to add to this IndexArchiveBundle */ function addIndexData($index_shard) { @@ -221,11 +225,13 @@ class IndexArchiveBundle implements CrawlConstants * the dictionary of the old shard is copied to the bundles dictionary * and a log-merge performed if needed * - * @param int $num_docs number of docs in the shard about to be added + * @param int $add_num_docs number of docs in the shard about to be added * @param object $callback object with join function to be - * called if process is taking too long + * called if process is taking too long + * @param bool $blocking whether there is an ongoing merge tiers operation + * occurring, if so don't do anything and return -1 * @return int the active generation after the check and possible change has - * been performed + * been performed */ function initGenerationToAdd($add_num_docs, $callback = NULL, $blocking = false) @@ -258,7 +264,7 @@ class IndexArchiveBundle implements CrawlConstants * shard. * * @param object $callback object with join function to be - * called if process is taking too long + * called if process is taking too long */ function addAdvanceGeneration($callback = NULL) { @@ -278,7 +284,7 @@ class IndexArchiveBundle implements CrawlConstants /** * Adds the words from this shard to the dictionary * @param object $callback object with join function to be - * called if process is taking too long + * called if process is taking too long */ function addCurrentShardDictionary($callback = NULL) { @@ -359,7 +365,7 @@ class IndexArchiveBundle implements CrawlConstants * * @param $i which shard to set the current shard to be * @param $disk_based whether to read the whole shard in before using or - * leave it on disk except for pages need and use memcache + * leave it on disk except for pages need and use memcache */ function setCurrentShard($i, $disk_based = false) { @@ -380,7 +386,7 @@ class IndexArchiveBundle implements CrawlConstants * * @param int $offset byte offset in partition of desired page * @param int $generation which generation WebArchive to look up in - * defaults to the same number as the current shard + * defaults to the same number as the current shard * @return array desired page */ function getPage($offset, $generation = -1) @@ -430,7 +436,8 @@ class IndexArchiveBundle implements CrawlConstants * the sole purpose of allowing conversions of downloaded data such as arc * files into Yioop! format. * - * @param string path to a directory containing a summaries WebArchiveBundle + * @param string $dir_name path to a directory containing a summaries + * WebArchiveBundle * @return array summary of the given archive */ static function getArchiveInfo($dir_name) diff --git a/lib/index_bundle_iterators/disjoint_iterator.php b/lib/index_bundle_iterators/disjoint_iterator.php index e5d28e529..02b1eea96 100644 --- a/lib/index_bundle_iterators/disjoint_iterator.php +++ b/lib/index_bundle_iterators/disjoint_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -70,8 +70,8 @@ class DisjointIterator extends IndexBundleIterator /** * Creates an disjoint union iterator with the given parameters. * - * @param object $index_bundle_iterator to use as a source of documents - * to iterate over + * @param object $index_bundle_iterators to use as a source of documents + * to iterate over */ function __construct($index_bundle_iterators) { @@ -120,7 +120,7 @@ class DisjointIterator extends IndexBundleIterator * iterator and generation * @param int $generation the generation the posting offset is for * @param int $posting_offset an offset into word_docs to compute the - * relevance of + * relevance of * @return float a relevancy score based on BM25F. */ function computeRelevance($generation, $posting_offset) @@ -156,7 +156,7 @@ class DisjointIterator extends IndexBundleIterator * would be return by this iterator * * @return mixed an array with the desired document offset - * and generation; -1 on fail + * and generation; -1 on fail */ function currentGenDocOffsetWithWord() { if($this->num_iterators <= 0) { @@ -195,9 +195,9 @@ class DisjointIterator extends IndexBundleIterator /** * Forwards the iterator one group of docs * @param array $gen_doc_offset a generation, doc_offset pair. If set, - * the must be of greater than or equal generation, and if equal the - * next block must all have $doc_offsets larger than or equal to - * this value + * the must be of greater than or equal generation, and if equal the + * next block must all have $doc_offsets larger than or equal to + * this value */ function advance($gen_doc_offset = NULL) { @@ -254,7 +254,7 @@ class DisjointIterator extends IndexBundleIterator * method results in a user defined error * * @param int $num the maximum number of results that can be returned by - * a block + * a block */ function setResultsPerBlock($num) { if($num != 1) { diff --git a/lib/index_bundle_iterators/doc_iterator.php b/lib/index_bundle_iterators/doc_iterator.php index 2345ffefd..74c1e32e8 100755 --- a/lib/index_bundle_iterators/doc_iterator.php +++ b/lib/index_bundle_iterators/doc_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -99,9 +99,11 @@ class DocIterator extends IndexBundleIterator * Creates a word iterator with the given parameters. * @param string $index_name time_stamp of the to use * @param int $limit the first element to return from the list of docs - * iterated over - * @param array $filter an array of hashes of domains to filter from - * results + * iterated over + * @param array& $filter an array of hashes of domains to filter from + * results + * @param int $results_per_block the maximum number of results that can + * be returned by a findDocsWithWord call */ function __construct($index_name, &$filter = NULL, $results_per_block = IndexBundleIterator::RESULTS_PER_BLOCK) @@ -129,7 +131,7 @@ class DocIterator extends IndexBundleIterator * * @param int $generation the generation the posting offset is for * @param int $posting_offset an offset into word_docs to compute the - * relevance of + * relevance of * @return float always 1.0. */ function computeRelevance($generation, $posting_offset) @@ -150,13 +152,13 @@ class DocIterator extends IndexBundleIterator $this->getShardInfo($this->current_generation); } /** - * Mainly used to get the last_offset in shard $generation of the - * current index bundle. In the case where this wasn't previously - * cached it loads in the index bundle, sets the current generation to - * $generation, stores the docids_len (the last offset) of this shard - * in shard_lens and sets up last_offset as $generation's docids_len + * Mainly used to get the last_offset in shard $generation of the + * current index bundle. In the case where this wasn't previously + * cached it loads in the index bundle, sets the current generation to + * $generation, stores the docids_len (the last offset) of this shard + * in shard_lens and sets up last_offset as $generation's docids_len * - * @param $generation to get last offset for + * @param $generation to get last offset for */ function getShardInfo($generation) { @@ -253,9 +255,9 @@ class DocIterator extends IndexBundleIterator /** * Forwards the iterator one group of docs * @param array $gen_doc_offset a generation, doc_offset pair. If set, - * the must be of greater than or equal generation, and if equal the - * next block must all have $doc_offsets larger than or equal to - * this value + * the must be of greater than or equal generation, and if equal the + * next block must all have $doc_offsets larger than or equal to + * this value */ function advance($gen_doc_offset = NULL) { @@ -311,7 +313,7 @@ class DocIterator extends IndexBundleIterator * would be return by this iterator * * @return mixed an array with the desired document offset - * and generation; -1 on fail + * and generation; -1 on fail */ function currentGenDocOffsetWithWord() { if(($this->current_offset > $this->last_offset || diff --git a/lib/index_bundle_iterators/group_iterator.php b/lib/index_bundle_iterators/group_iterator.php index a8ffaef52..e6a59ec1f 100644 --- a/lib/index_bundle_iterators/group_iterator.php +++ b/lib/index_bundle_iterators/group_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -86,7 +86,7 @@ class GroupIterator extends IndexBundleIterator var $grouped_keys; /** * hashed of document web pages used to keep track of track of - * groups seen so far + * groups seen so far * @var array */ var $grouped_hashes; @@ -120,13 +120,13 @@ class GroupIterator extends IndexBundleIterator * Creates a group iterator with the given parameters. * * @param object $index_bundle_iterator to use as a source of documents - * to iterate over + * to iterate over * @param int $num_iterators number of word iterators appearing in - * in sub-iterators -- if larger than reduce the default grouping - * number + * in sub-iterators -- if larger than reduce the default grouping + * number * @param int $current_machine if this iterator is being used in a multi- - * queue_server setting, then this is the id of the current - * queue_server + * queue_server setting, then this is the id of the current + * queue_server * @param bool $network_flag the iterator is being used for a network query */ function __construct($index_bundle_iterator, $num_iterators = 1, @@ -161,7 +161,7 @@ class GroupIterator extends IndexBundleIterator * iterator and generation * @param int $generation the generation the posting offset is for * @param int $posting_offset an offset into word_docs to compute the - * relevance of + * relevance of * @return float a relevancy score based on BM25F. */ function computeRelevance($generation, $posting_offset) @@ -246,7 +246,7 @@ class GroupIterator extends IndexBundleIterator * have been remembered in grouped_keys and will be ignored in the return * result of this function. * - * @param array &$pages pages to group + * @param array& $pages pages to group * @return array $pre_out_pages pages after grouping */ function groupByHashUrl(&$pages) @@ -289,7 +289,7 @@ class GroupIterator extends IndexBundleIterator * that group as its representative. The function then modifies the * supplied argument array to make it an array of group representatives. * - * @param array &$pre_out_pages documents previously grouped by hash of url + * @param array& $pre_out_pages documents previously grouped by hash of url */ function groupByHashAndAggregate(&$pre_out_pages) { @@ -339,8 +339,8 @@ class GroupIterator extends IndexBundleIterator * of single summarized documents for each group. These single summarized * documents have aggregated scores. * - * @param array &$pre_out_pages array of groups of pages for which out pages - * are to be generated. + * @param array& $pre_out_pages array of groups of pages for which out pages + * are to be generated. * @return array $out_pages array of single summarized documents */ function computeOutPages(&$pre_out_pages) @@ -397,7 +397,10 @@ class GroupIterator extends IndexBundleIterator * This process is described in detail at: * http://www.seekquarry.com/?c=main&p=ranking#search * - * @param array &$pre_hash_page pages to compute scores for + * @param string $hash_url the crawlHash of the url of the page we are + * scoring which will be compared with that of the host to see if + * the current page has the url of a hostname. + * @param array& $pre_hash_page pages to compute scores for */ function aggregateScores($hash_url, &$pre_hash_page) { @@ -441,9 +444,9 @@ class GroupIterator extends IndexBundleIterator /** * Forwards the iterator one group of docs * @param array $gen_doc_offset a generation, doc_offset pair. If set, - * the must be of greater than or equal generation, and if equal the - * next block must all have $doc_offsets larger than or equal to - * this value + * the must be of greater than or equal generation, and if equal the + * next block must all have $doc_offsets larger than or equal to + * this value */ function advance($gen_doc_offset = NULL) { @@ -474,7 +477,7 @@ class GroupIterator extends IndexBundleIterator * would be return by this iterator * * @return mixed an array with the desired document offset - * and generation; -1 on fail + * and generation; -1 on fail */ function currentGenDocOffsetWithWord() { $this->index_bundle_iterator->currentGenDocOffsetWithWord(); diff --git a/lib/index_bundle_iterators/index_bundle_iterator.php b/lib/index_bundle_iterators/index_bundle_iterator.php index 08e0c2246..86ced0974 100644 --- a/lib/index_bundle_iterators/index_bundle_iterator.php +++ b/lib/index_bundle_iterators/index_bundle_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -74,7 +74,7 @@ abstract class IndexBundleIterator implements CrawlConstants */ var $results_per_block = self::RESULTS_PER_BLOCK; /** - * Default number of documents returned for each block (at most) + * Default number of documents returned for each block (at most) * @var int */ const RESULTS_PER_BLOCK = 200; @@ -83,7 +83,7 @@ abstract class IndexBundleIterator implements CrawlConstants * iterator and generation * @param int $generation the generation the posting offset is for * @param int $posting_offset an offset into word_docs to compute the - * relevance of + * relevance of * @return float a relevancy score based on BM25F. */ abstract function computeRelevance($generation, $posting_offset); @@ -95,9 +95,9 @@ abstract class IndexBundleIterator implements CrawlConstants /** * Forwards the iterator one group of docs * @param array $gen_doc_offset a generation, doc_offset pair. If set, - * the must be of greater than or equal generation, and if equal the - * next block must all have $doc_offsets larger than or equal to - * this value + * the must be of greater than or equal generation, and if equal the + * next block must all have $doc_offsets larger than or equal to + * this value */ abstract function advance($gen_doc_offset = NULL); /** @@ -105,7 +105,7 @@ abstract class IndexBundleIterator implements CrawlConstants * would be return by this iterator * * @return mixed an array with the desired document offset - * and generation; -1 on fail + * and generation; -1 on fail */ abstract function currentGenDocOffsetWithWord(); /** @@ -116,11 +116,11 @@ abstract class IndexBundleIterator implements CrawlConstants */ abstract function findDocsWithWord(); /** - * Compares two arrays each containing a (generation, offset) pair. + * Compares two arrays each containing a (generation, offset) pair. * - * @param array $gen_doc1 first ordered pair - * @param array $gen_doc1 second ordered pair - * @return int -1,0,1 depending on which is bigger + * @param array $gen_doc1 first ordered pair + * @param array $gen_doc2 second ordered pair + * @return int -1,0,1 depending on which is bigger */ function genDocOffsetCmp($gen_doc1, $gen_doc2) { @@ -156,7 +156,7 @@ abstract class IndexBundleIterator implements CrawlConstants * Gets the summaries associated with the keys provided the keys * can be found in the current block of docs returned by this iterator * @param array $keys keys to try to find in the current block of returned - * results + * results * @return array doc summaries that match provided keys */ function getCurrentDocsForKeys($keys = NULL) @@ -196,7 +196,7 @@ abstract class IndexBundleIterator implements CrawlConstants * the next block must be of docs after this doc_index * * @param $doc_offset if set the next block must all have $doc_offsets - * equal to or larger than this value + * equal to or larger than this value * @return array doc summaries matching the $this->restrict_phrases */ function nextDocsWithWord($doc_offset = NULL) @@ -228,7 +228,7 @@ abstract class IndexBundleIterator implements CrawlConstants * currentDocsWithWord() * * @param int $num the maximum number of results that can be returned by - * a block + * a block */ function setResultsPerBlock($num) { diff --git a/lib/index_bundle_iterators/intersect_iterator.php b/lib/index_bundle_iterators/intersect_iterator.php index 702b4b2ef..c1b612cd5 100644 --- a/lib/index_bundle_iterators/intersect_iterator.php +++ b/lib/index_bundle_iterators/intersect_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -68,10 +68,10 @@ class IntersectIterator extends IndexBundleIterator */ var $to_advance_index; /** - * An array holding iterator numbers corresponding to the word key - * For instance, if the word "the" appears twice in the query - * there would be only one iterator for "the" but two places in - * the word_iterator_map refering to it + * Associative array (term position in original query => iterator index + * of an iterator for that term). This is to handle queries where the + * same term occures multiple times. For example, the rock back "The The" + * * @var array */ var $word_iterator_map; @@ -81,8 +81,13 @@ class IntersectIterator extends IndexBundleIterator */ var $num_words; /** - * This iterator returns only documents containing quoted terms in - * the correct order and adjacency + * Each element in this array corresponds to one quoted phrase in the + * original query. Each element is in turn an array with elements + * corresponding to a position of term in the orginal query followed + * its length (a term might involve more than one word so the length + * could be greater than one). It is also allowed that entries might + * be of the form *num => * to indicates that an asterisk (a wild card that + * can match any number of terms) appeared at that place in the query * @var array */ var $quote_positions; @@ -93,20 +98,28 @@ class IntersectIterator extends IndexBundleIterator */ var $weight; /** - * Whether to run a timer that shuts down the intersect iterator if - * syncGenDocOffsetsAmongstIterators takes longer than the time out period + * Whether to run a timer that shuts down the intersect iterator if + * syncGenDocOffsetsAmongstIterators takes longer than the time out period */ var $sync_timer_on; /** - * Number of seconds before timeout and stop - * syncGenDocOffsetsAmongstIterators if slow + * Number of seconds before timeout and stop + * syncGenDocOffsetsAmongstIterators if slow */ const SYNC_TIMEOUT = 4; /** * Creates an intersect iterator with the given parameters. * - * @param object $index_bundle_iterator to use as a source of documents - * to iterate over + * @param object $index_bundle_iterators to use as a source of documents + * to iterate over + * @param array $word_iterator_map ssociative array ( + * term position in original query => iterator index + * of an iterator for that term) + * @param array $quote_positions Each element in this array corresponds + * to one quoted phrase in the original query. @see $quote_positions + * field variable in this class for more info + * @param float $weight multiplicative factor to apply to scores returned + * from this iterator */ function __construct($index_bundle_iterators, $word_iterator_map, $quote_positions = NULL, $weight = 1) @@ -159,7 +172,7 @@ class IntersectIterator extends IndexBundleIterator * iterator and generation * @param int $generation the generation the posting offset is for * @param int $posting_offset an offset into word_docs to compute the - * relevance of + * relevance of * @return float a relevancy score based on BM25F. */ function computeRelevance($generation, $posting_offset) @@ -267,8 +280,8 @@ class IntersectIterator extends IndexBundleIterator * @param array $position_lists of search terms in the current document * @param int $cur_pos to look after in any position list * @param mixed $next_pos * or int if * next_pos must be >= $cur_pos - * +len_search_term. $next_pos represents the position the next - * quoted term should be at + * +len_search_term. $next_pos represents the position the next + * quoted term should be at * @param $qp $position_list_index => $len_of_list_term pairs * @return -1 on failure, 0 on backtrack, 1 on success */ @@ -311,12 +324,13 @@ class IntersectIterator extends IndexBundleIterator * Given the position_lists of a collection of terms computes * a score for how close those words were in the given document * - * @param array $position_lists a 2D array item number => position_list - * (locations in doc where item occurred) for that item. - * @param array $len_lists length for each item of its position list - * @param bool $is_doc whether this is the position list of a document - * or a link - * @return sum of inverse of all covers computed by plane sweep algorithm + * @param array& $word_position_lists a 2D array item + * number => position_list (locations in doc where item occurred) for + * that item. + * @param array& $word_len_lists length for each item of its position list + * @param bool $is_doc whether this is the position list of a document + * or a link + * @return sum of inverse of all covers computed by plane sweep algorithm */ function computeProximity(&$word_position_lists, &$word_len_lists, $is_doc) { @@ -473,9 +487,9 @@ class IntersectIterator extends IndexBundleIterator /** * Forwards the iterator one group of docs * @param array $gen_doc_offset a generation, doc_offset pair. If set, - * the must be of greater than or equal generation, and if equal the - * next block must all have $doc_offsets larger than or equal to - * this value + * the must be of greater than or equal generation, and if equal the + * next block must all have $doc_offsets larger than or equal to + * this value */ function advance($gen_doc_offset = NULL) { @@ -503,7 +517,7 @@ class IntersectIterator extends IndexBundleIterator * would be return by this iterator * * @return mixed an array with the desired document offset - * and generation; -1 on fail + * and generation; -1 on fail */ function currentGenDocOffsetWithWord() { $this->syncGenDocOffsetsAmongstIterators(); @@ -520,7 +534,7 @@ class IntersectIterator extends IndexBundleIterator * in a user defined error * * @param int $num the maximum number of results that can be returned by - * a block + * a block */ function setResultsPerBlock($num) { if($num != 1) { diff --git a/lib/index_bundle_iterators/negation_iterator.php b/lib/index_bundle_iterators/negation_iterator.php index df860c09e..ad3a84a3a 100644 --- a/lib/index_bundle_iterators/negation_iterator.php +++ b/lib/index_bundle_iterators/negation_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -66,7 +66,7 @@ class NegationIterator extends IndexBundleIterator * Creates a negation iterator with the given parameters. * * @param object $index_bundle_iterator to use as a source of documents - * to iterate over + * to iterate over */ function __construct($index_bundle_iterator) { @@ -98,7 +98,7 @@ class NegationIterator extends IndexBundleIterator * iterator and generation * @param int $generation the generation the posting offset is for * @param int $posting_offset an offset into word_docs to compute the - * relevance of + * relevance of * @return float a relevancy score based on BM25F. */ function computeRelevance($generation, $posting_offset) @@ -176,9 +176,9 @@ class NegationIterator extends IndexBundleIterator /** * Forwards the iterator one group of docs (must be size 1) * @param array $gen_doc_offset a generation, doc_offset pair. If set, - * the must be of greater than or equal generation, and if equal the - * next block must all have $doc_offsets larger than or equal to - * this value + * the must be of greater than or equal generation, and if equal the + * next block must all have $doc_offsets larger than or equal to + * this value */ function advance($gen_doc_offset = NULL) { @@ -191,7 +191,7 @@ class NegationIterator extends IndexBundleIterator * would be return by this iterator * * @return mixed an array with the desired document offset - * and generation; -1 on fail + * and generation; -1 on fail */ function currentGenDocOffsetWithWord() { $this->syncGenDocOffsetsAmongstIterators(); @@ -208,7 +208,7 @@ class NegationIterator extends IndexBundleIterator * in a user defined error * * @param int $num the maximum number of results that can be returned by - * a block + * a block */ function setResultsPerBlock($num) { if($num != 1) { diff --git a/lib/index_bundle_iterators/network_iterator.php b/lib/index_bundle_iterators/network_iterator.php index cb714e7a8..4274db646 100644 --- a/lib/index_bundle_iterators/network_iterator.php +++ b/lib/index_bundle_iterators/network_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -92,6 +92,8 @@ class NetworkIterator extends IndexBundleIterator */ var $next_results_per_block; /** + * Used to keep track of the original desired number of results to be + * returned in one find docs call versus the number actually retrieved. * @var int */ var $hard_query; @@ -109,14 +111,14 @@ class NetworkIterator extends IndexBundleIterator * @param string $query the query that was supplied by the end user * that we are trying to get search results for * @param array $queue_servers urls of yioop instances on which documents - * indexes live + * indexes live * @param string $timestamp the timestamp of the particular current index * archive bundles that we look in for results - * @param array $filter an array of hashes of domains to filter from + * @param array& $filter an array of hashes of domains to filter from * results - * @param string $save_timestamp if this timestamp is nonzero, then when - * making queries to separate machines the save_timestamp is sent so - * the queries on those machine can make savepoints. Note the + * @param string $save_timestamp_name if this timestamp is nonzero, then + * when making queries to separate machines the save_timestamp is sent + * so the queries on those machine can make savepoints. Note the * format of save_timestamp is timestamp-query_part where query_part * is the number of the item in a query presentation (usually 0). * @param bool $limit_news if true the number of media:news items to @@ -157,7 +159,7 @@ class NetworkIterator extends IndexBundleIterator * * @param int $generation the generation the posting offset is for * @param int $posting_offset an offset into word_docs to compute the - * relevance of + * relevance of * @return float a relevancy score based on BM25F -- always 1.0. */ function computeRelevance($generation, $posting_offset) @@ -181,9 +183,9 @@ class NetworkIterator extends IndexBundleIterator /** * Forwards the iterator one group of docs * @param array $gen_doc_offset a generation, doc_offset pair. If set, - * the must be of greater than or equal generation, and if equal the - * next block must all have $doc_offsets larger than or equal to - * this value + * the must be of greater than or equal generation, and if equal the + * next block must all have $doc_offsets larger than or equal to + * this value */ function advance($gen_doc_offset = NULL) { @@ -198,7 +200,7 @@ class NetworkIterator extends IndexBundleIterator * iterator * * @return mixed an array with the desired document offset - * and generation; -1 on fail + * and generation; -1 on fail */ function currentGenDocOffsetWithWord() { @@ -339,7 +341,7 @@ class NetworkIterator extends IndexBundleIterator * Gets the summaries associated with the keys provided the keys * can be found in the current block of docs returned by this iterator * @param array $keys keys to try to find in the current block of returned - * results + * results * @return array doc summaries that match provided keys */ function getCurrentDocsForKeys($keys = NULL) diff --git a/lib/index_bundle_iterators/union_iterator.php b/lib/index_bundle_iterators/union_iterator.php index 9fd8ed01b..bc77499f5 100644 --- a/lib/index_bundle_iterators/union_iterator.php +++ b/lib/index_bundle_iterators/union_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -79,8 +79,8 @@ class UnionIterator extends IndexBundleIterator /** * Creates a union iterator with the given parameters. * - * @param object $index_bundle_iterator to use as a source of documents - * to iterate over + * @param object $index_bundle_iterators to use as a source of documents + * to iterate over */ function __construct($index_bundle_iterators) { @@ -132,7 +132,7 @@ class UnionIterator extends IndexBundleIterator * iterator and generation * @param int $generation the generation the posting offset is for * @param int $posting_offset an offset into word_docs to compute the - * relevance of + * relevance of * @return float a relevancy score based on BM25F. */ function computeRelevance($generation, $posting_offset) @@ -182,7 +182,7 @@ class UnionIterator extends IndexBundleIterator * Gets the summaries associated with the keys provided the keys * can be found in the current block of docs returned by this iterator * @param array $keys keys to try to find in the current block of returned - * results + * results * @return array doc summaries that match provided keys */ function getCurrentDocsForKeys($keys = NULL) @@ -216,9 +216,9 @@ class UnionIterator extends IndexBundleIterator /** * Forwards the iterator one group of docs * @param array $gen_doc_offset a generation, doc_offset pair. If set, - * the must be of greater than or equal generation, and if equal the - * next block must all have $doc_offsets larger than or equal to - * this value + * the must be of greater than or equal generation, and if equal the + * next block must all have $doc_offsets larger than or equal to + * this value */ function advance($gen_doc_offset = NULL) { @@ -248,7 +248,7 @@ class UnionIterator extends IndexBundleIterator * in a user defined error * * @param int $num the maximum number of results that can be returned by - * a block + * a block */ function setResultsPerBlock($num) { trigger_error("Cannot set the results per block of @@ -263,7 +263,7 @@ class UnionIterator extends IndexBundleIterator * a user defined error. * * @return mixed the desired document offset and generation (actually, - * triggers error). + * triggers error). */ function currentGenDocOffsetWithWord() { trigger_error("Cannot get the doc offset and generation with word of diff --git a/lib/index_bundle_iterators/word_iterator.php b/lib/index_bundle_iterators/word_iterator.php index 48c2341d0..200164f75 100644 --- a/lib/index_bundle_iterators/word_iterator.php +++ b/lib/index_bundle_iterators/word_iterator.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -134,7 +134,7 @@ class WordIterator extends IndexBundleIterator /** Length of a doc key*/ const KEY_LEN = 8; /** If the $limit_news constructor input is true then limit the number - * of items coming from the feed shard to this count. + * of items coming from the feed shard to this count. */ const LIMIT_NEWS_COUNT = 25; /** @@ -144,9 +144,15 @@ class WordIterator extends IndexBundleIterator * @param string $index_name time_stamp of the to use * @param bool $raw whether the $word_key is our variant of base64 encoded * @param array $filter an array of hashes of domains to filter from - * results + * results + * @param int $results_per_block the maximum number of results that can + * be returned by a findDocsWithWord call + * @param bool $limit_news news results appear before all others when + * gotten out of this iterator (may be reordered later). This flag + * controls whether an upper bound of self::LIMIT_NEWS_COUNT is imposed + * on the number of feed results returned * @param string $mask byte mask to apply against word id, default is for - * exact match + * exact match */ function __construct($word_key, $index_name, $raw = false, &$filter = NULL, $results_per_block = IndexBundleIterator::RESULTS_PER_BLOCK, @@ -238,7 +244,7 @@ class WordIterator extends IndexBundleIterator * iterator and generation * @param int $generation the generation the posting offset is for * @param int $posting_offset an offset into word_docs to compute the - * relevance of + * relevance of * @return float a relevancy score based on BM25F. */ function computeRelevance($generation, $posting_offset) @@ -408,9 +414,9 @@ class WordIterator extends IndexBundleIterator /** * Forwards the iterator one group of docs * @param array $gen_doc_offset a generation, doc_offset pair. If set, - * the must be of greater than or equal generation, and if equal the - * next block must all have $doc_offsets larger than or equal to - * this value + * the must be of greater than or equal generation, and if equal the + * next block must all have $doc_offsets larger than or equal to + * this value */ function advance($gen_doc_offset = NULL) { @@ -510,7 +516,7 @@ class WordIterator extends IndexBundleIterator * would be return by this iterator * * @return mixed an array with the desired document offset - * and generation; -1 on fail + * and generation; -1 on fail */ function currentGenDocOffsetWithWord() { if($this->current_doc_offset !== NULL) { diff --git a/lib/index_dictionary.php b/lib/index_dictionary.php index 5a32e9276..5c2b7f8f2 100644 --- a/lib/index_dictionary.php +++ b/lib/index_dictionary.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -144,7 +144,7 @@ class IndexDictionary implements CrawlConstants * Makes an index dictionary with the given name * * @param string $dir_name the directory name to store the index dictionary - * in + * in */ function __construct($dir_name) { @@ -171,7 +171,7 @@ class IndexDictionary implements CrawlConstants * Makes dictionary sub-directories for each of the 256 possible first * hash characters that crawHash in raw mode code output. * @param string $dir_name base directory in which these sub-directories - * should be made + * should be made */ static function makePrefixLetters($dir_name) { @@ -186,9 +186,9 @@ class IndexDictionary implements CrawlConstants * Merges tiers as needed. * * @param object $index_shard the shard to add the word to the dictionary - * with + * with * @param object $callback object with join function to be - * called if process is taking too long + * called if process is taking too long */ function addShardDictionary($index_shard, $callback = NULL) { @@ -273,8 +273,8 @@ class IndexDictionary implements CrawlConstants * of dictinary words. The output is stored in $out_slot. * * @param int $tier tier level to perform the merge of files at - * @param string either "A" or "B", the suffix but not extension of the - * file one tier up to create with the merged results. + * @param string $out_slot either "A" or "B", the suffix but not extension + * of the file one tier up to create with the merged results. */ function mergeTier($tier, $out_slot) { @@ -290,8 +290,8 @@ class IndexDictionary implements CrawlConstants * * @param int $prefix which prefix directory to perform the merge of files * @param int $tier tier level to perform the merge of files at - * @param string either "A" or "B", the suffix but not extension of the - * file one tier up to create with the merged results. + * @param string $out_slot either "A" or "B", the suffix but not extension + * of the file one tier up to create with the merged results. */ function mergeTierFiles($prefix, $tier, $out_slot) { @@ -434,12 +434,12 @@ class IndexDictionary implements CrawlConstants * stored in file ending with A or B one tier up. B is used if an A file is * already present. * @param object $callback object with join function to be - * called if process is taking too long + * called if process is taking too long * @param int $max_tier the maximum tier to merge to merge till -- - * if not set then $this->max_tier used. Otherwise, one would - * typically set to a value bigger than $this->max_tier + * if not set then $this->max_tier used. Otherwise, one would + * typically set to a value bigger than $this->max_tier * @param bool $fast_merge_all if true then merge away B slots but don't - * merge everything to a top tier + * merge everything to a top tier */ function mergeAllTiers($callback = NULL, $max_tier = -1, $fast_merge_all = false) @@ -491,15 +491,15 @@ class IndexDictionary implements CrawlConstants * @param string $word_id id of the word or phrase one wants to look up * @param bool $raw whether the id is our version of base64 encoded or not * @param int $shift how many low order bits to drop from $word_id's - * when checking for a match + * when checking for a match * @param string $mask bit mask to be applied to bytes after the 8th - * byte through 20th byte of word_id. In single word case these - * bytes contain safe:, media:, and class: meta word info + * byte through 20th byte of word_id. In single word case these + * bytes contain safe:, media:, and class: meta word info * @param int $threshold if greater than zero how many posting list - * results in dictionary info returned before stopping looking for - * more matches + * results in dictionary info returned before stopping looking for + * more matches * @return mixed an array of entries of the form - * generation, first offset, last offset, count + * generation, first offset, last offset, count */ function getWordInfo($word_id, $raw = false, $shift = 0, $mask = "", $threshold = -1) @@ -515,33 +515,33 @@ class IndexDictionary implements CrawlConstants return $info; } /** - * This method facilitates query processing of an ongoing crawl. - * During an ongoing crawl, the dictionary is arranged into tiers - * as per the logarithmic merge algortihm rather than just one tier - * as in a crawl that has been stopped. Word info for more - * recently crawled pages will tend to be in lower tiers than data - * that was crawled earlier. getWordInfoTier gets word info data for - * a specific tier in the index dictionary. Each tier will - * have word info for a specific, disjoint set of shards, so the format of - * how to look up posting lists in a shard can be the same - * regardless of the tier: an array entry is of the form - * generation, first offset, last offset, and number of documents the - * word occurred in for this shard. + * This method facilitates query processing of an ongoing crawl. + * During an ongoing crawl, the dictionary is arranged into tiers + * as per the logarithmic merge algortihm rather than just one tier + * as in a crawl that has been stopped. Word info for more + * recently crawled pages will tend to be in lower tiers than data + * that was crawled earlier. getWordInfoTier gets word info data for + * a specific tier in the index dictionary. Each tier will + * have word info for a specific, disjoint set of shards, so the format of + * how to look up posting lists in a shard can be the same + * regardless of the tier: an array entry is of the form + * generation, first offset, last offset, and number of documents the + * word occurred in for this shard. * - * @param string $word_id id of the word one wants to look up - * @param bool $raw whether the id is our version of base64 encoded or - * not - * @param int $tier which tier to get word info from - * @param int $shift how many low order bits to drop from $word_id's - * when checking for a match - * @param string $mask bit mask to be applied to bytes after the 8th - * byte through 20th byte of word_id. In single word case these - * bytes contain safe:, media:, and class: meta word info - * @param int $threshold if greater than zero how many posting list - * results in dictionary info returned before stopping looking for - * more matches - * @return mixed an array of entries of the form - * generation, first offset, last offset, count + * @param string $word_id id of the word one wants to look up + * @param bool $raw whether the id is our version of base64 encoded or + * not + * @param int $tier which tier to get word info from + * @param int $shift how many low order bits to drop from $word_id's + * when checking for a match + * @param string $mask bit mask to be applied to bytes after the 8th + * byte through 20th byte of word_id. In single word case these + * bytes contain safe:, media:, and class: meta word info + * @param int $threshold if greater than zero how many posting list + * results in dictionary info returned before stopping looking for + * more matches + * @return mixed an array of entries of the form + * generation, first offset, last offset, count */ function getWordInfoTier($word_id, $raw, $tier, $shift = 0, $mask = "", $threshold = -1) @@ -716,16 +716,16 @@ class IndexDictionary implements CrawlConstants * * @param string $id of a row to compare $word_id against * @param string $word_id the word id of a term or phrase we are computing - * the quadruple array for + * the quadruple array for * @param string $mask up to 9 byte wask used to say which materialized - * meta words should be checked for when doing a match + * meta words should be checked for when doing a match * @param int $mask_len this should be strlen($mask) * @param array $record current record from dictionary that we may or may - * not add to info - * @param array &$info quadruple array we are adding to - * @param int &$total_count count of items in $info - * @param int &$previous_generation last generation added to $info - * @param int &$previous_id last exact if added to $infos + * not add to info + * @param array& $info quadruple array we are adding to + * @param int& $total_count count of items in $info + * @param int& $previous_generation last generation added to $info + * @param int& $previous_id last exact if added to $infos */ function checkMaskAndAdd($id, $word_id, $mask, $mask_len, $record, &$info, &$total_count, &$previous_generation, &$previous_id) @@ -756,11 +756,11 @@ class IndexDictionary implements CrawlConstants } } /** - * Gets from disk $len many bytes beginning at $offset from the - * $file_num prefix file in the index dictionary + * Gets from disk $len many bytes beginning at $offset from the + * $file_num prefix file in the index dictionary * * @param int $file_num which prefix file to read from (always reads - * a file at the max_tier level) + * a file at the max_tier level) * @param int $offset byte offset to start reading from * @param int $len number of bytes to read * @return string data from that location in the shard @@ -794,7 +794,7 @@ class IndexDictionary implements CrawlConstants * at byte offset $bytes * * @param int $file_num which dictionary file (given by first letter prefix) - * to read from + * to read from * @param int $bytes byte offset to start reading from * @return &string data fromIndexShard file */ diff --git a/lib/index_manager.php b/lib/index_manager.php index f36fb3aa7..7d653334c 100644 --- a/lib/index_manager.php +++ b/lib/index_manager.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -56,23 +56,23 @@ require_once BASE_DIR."/lib/utility.php"; class IndexManager implements CrawlConstants { /** - * Open IndexArchiveBundle's managed by this manager - * @var array + * Open IndexArchiveBundle's managed by this manager + * @var array */ static $indexes = array(); /** - * Used to cache word lookup of posting list locations for a given - * index - * @var array + * Used to cache word lookup of posting list locations for a given + * index + * @var array */ static $dictionary = array(); /** - * Returns a reference to the managed copy of an IndexArchiveBundle object - * with a given timestamp or an IndexShard in the case where - * $index_name == "feed" (for handling news feeds) + * Returns a reference to the managed copy of an IndexArchiveBundle object + * with a given timestamp or an IndexShard in the case where + * $index_name == "feed" (for handling news feeds) * - * @param string $index_name timestamp of desired IndexArchiveBundle - * @return object the desired IndexArchiveBundle reference + * @param string $index_name timestamp of desired IndexArchiveBundle + * @return object the desired IndexArchiveBundle reference */ static function getIndex($index_name) { @@ -100,14 +100,14 @@ class IndexManager implements CrawlConstants return self::$indexes[$index_name]; } /** - * Returns the version of the index, so that Yioop can determine - * how to do word lookup.The only major change to the format was - * when word_id's went from 8 to 20 bytes which happened around Unix - * time 1369754208. + * Returns the version of the index, so that Yioop can determine + * how to do word lookup.The only major change to the format was + * when word_id's went from 8 to 20 bytes which happened around Unix + * time 1369754208. * - * @param string $index_name unix timestamp of index - * @return int 0 - if the orginal format for Yioop indexes; 1 -if 20 byte - * word_id format + * @param string $index_name unix timestamp of index + * @return int 0 - if the orginal format for Yioop indexes; 1 -if 20 byte + * word_id format */ static function getVersion($index_name) { @@ -121,21 +121,21 @@ class IndexManager implements CrawlConstants return 1; } /** - * Gets an array posting list positions for each shard in the - * bundle $index_name for the word id $hash + * Gets an array posting list positions for each shard in the + * bundle $index_name for the word id $hash * - * @param string $index_name bundle to look $hash in - * @param string $hash hash of phrasse or word to look up in bundle - * dictionary - * @param int $shift if $hash is for a phrase, how many low order - * bits of word id to discard - * @param string $mask if $hash is for a word, after the 9th byte what - * meta word mask should be applied to the 20 byte hash - * @param int $threshold after the number of results exceeds this amount - * stop looking for more dictionary entries. - * @return array sequence of four tuples: - * (index_shard generation, posting_list_offset, length, exact id - * that match $hash) + * @param string $index_name bundle to look $hash in + * @param string $hash hash of phrasse or word to look up in bundle + * dictionary + * @param int $shift if $hash is for a phrase, how many low order + * bits of word id to discard + * @param string $mask if $hash is for a word, after the 9th byte what + * meta word mask should be applied to the 20 byte hash + * @param int $threshold after the number of results exceeds this amount + * stop looking for more dictionary entries. + * @return array sequence of four tuples: + * (index_shard generation, posting_list_offset, length, exact id + * that match $hash) */ static function getWordInfo($index_name, $hash, $shift = 0, $mask = "", $threshold = -1) @@ -218,16 +218,16 @@ class IndexManager implements CrawlConstants $threshold]; } /** - * Returns the number of document that a given term or phrase appears in - * in the given index + * Returns the number of document that a given term or phrase appears in + * in the given index * - * @param string $term_or_phrase what to look up in the indexes dictionary - * no mask is used for this look up - * @param string $index_name index to look up term or phrase in - * @param int $threshold if set and positive then once threshold many - * documents are found the search for more documents to add to the - * total is stopped - * @return int number of documents + * @param string $term_or_phrase what to look up in the indexes dictionary + * no mask is used for this look up + * @param string $index_name index to look up term or phrase in + * @param int $threshold if set and positive then once threshold many + * documents are found the search for more documents to add to the + * total is stopped + * @return int number of documents */ static function numDocsTerm($term_or_phrase, $index_name, $threshold = -1) { diff --git a/lib/index_shard.php b/lib/index_shard.php index 168e7022f..ae5da8e41 100644 --- a/lib/index_shard.php +++ b/lib/index_shard.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -94,8 +94,8 @@ class IndexShard extends PersistentStructure implements */ var $doc_infos; /** - * Length of $doc_infos as a string - * @var int + * Length of $doc_infos as a string + * @var int */ var $docids_len; /** @@ -108,8 +108,8 @@ class IndexShard extends PersistentStructure implements */ var $word_docs; /** - * Length of $word_docs as a string - * @var int + * Length of $word_docs as a string + * @var int */ var $word_docs_len; /** @@ -267,7 +267,7 @@ class IndexShard extends PersistentStructure implements */ const POSTING_LEN = 4; /** - * Represents an empty prefix item + * Represents an empty prefix item */ const BLANK = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"; /** @@ -275,7 +275,7 @@ class IndexShard extends PersistentStructure implements */ const HALF_BLANK = "\xFF\xFF\xFF\xFF"; /** - * Represents an empty prefix item + * Represents an empty prefix item */ const STORE_FLAG = "\x80"; /** @@ -284,6 +284,8 @@ class IndexShard extends PersistentStructure implements * @param string $fname filename to store the index shard with * @param int $generation when returning documents from the shard * pretend there ar ethis many earlier documents + * @param int $num_docs_per_generation the number of documents that a + * given shard can hold. * @param bool $read_only_from_disk used to determined if this shard is * going to be largely kept on disk and to be in read only mode. * Otherwise, shard will assume to be completely held in memory and be @@ -321,18 +323,18 @@ class IndexShard extends PersistentStructure implements * Finally, associate the given meta words with this document. * * @param string $doc_keys a string of concatenated keys for a document - * to insert. Each key is assumed to be a string of DOC_KEY_LEN many - * bytes. This whole set of keys is viewed as fixing one document. + * to insert. Each key is assumed to be a string of DOC_KEY_LEN many + * bytes. This whole set of keys is viewed as fixing one document. * @param int $summary_offset its offset into the word archive the - * document's data is stored in + * document's data is stored in * @param array $word_lists (word => array of word positions in doc) * @param array $meta_ids meta words to be associated with the document - * an example meta word would be filetype:pdf for a PDF document. + * an example meta word would be filetype:pdf for a PDF document. * @param array $materialized_metas * @param bool $is_doc flag used to indicate if what is being sored is - * a document or a link to a document + * a document or a link to a document * @param mixed $rank either false if not used, or a 4 bit estimate of the - * rank of this document item + * rank of this document item * @return bool success or failure of performing the add */ function addDocumentWords($doc_keys, $summary_offset, $word_lists, @@ -416,9 +418,9 @@ class IndexShard extends PersistentStructure implements * @param string $word_id id of the word one wants to look up * @param bool $raw whether the id is our version of base64 encoded or not * @param int $shift how many low order bits to drop from $word_id's - * when checking for a match + * when checking for a match * @return array first offset, last offset, count, exact matching id ( - * recall match can ignore low order shift bits) + * recall match can ignore low order shift bits) */ function getWordInfo($word_id, $raw = false, $shift = 0) { @@ -494,8 +496,8 @@ class IndexShard extends PersistentStructure implements * the list (if it exists) after the function is called. * * @param int $start_offset of the current posting list for query term - * used in calculating BM25F. - * @param int &$next_offset where to start in word docs + * used in calculating BM25F. + * @param int& $next_offset where to start in word docs * @param int $last_offset offset at which to stop by * @param int $len number of documents desired * @return array desired list of doc's and their info @@ -540,14 +542,14 @@ class IndexShard extends PersistentStructure implements return $results; } /** - * An upper bound on the number of docs or links represented by - * the start and ending integer offsets into a posting list. + * An upper bound on the number of docs or links represented by + * the start and ending integer offsets into a posting list. * - * @param int $start_offset starting location in posting list - * @param int $last_offset ending location in posting list - * @param float $avg_posting_len number of bytes in an average posting + * @param int $start_offset starting location in posting list + * @param int $last_offset ending location in posting list + * @param float $avg_posting_len number of bytes in an average posting * - * @return int number of docs or links + * @return int number of docs or links */ static function numDocsOrLinks($start_offset, $last_offset, $avg_posting_len = 4) @@ -564,9 +566,9 @@ class IndexShard extends PersistentStructure implements * @param string $posting a posting entry from some words posting list * @param int $num_doc_or_links number of documents or links doc appears in * @param int $occurs number of occurrences of the current word in - * the document. If nonzero, this overrides the number of occurrences - * in various parts of a document that would be determined by its - * position list. Typically, would only override for meta words. + * the document. If nonzero, this overrides the number of occurrences + * in various parts of a document that would be determined by its + * position list. Typically, would only override for meta words. * * @return array ($doc_id, posting_stats_array) for posting */ @@ -701,7 +703,7 @@ class IndexShard extends PersistentStructure implements * @param array $position_list positions of term in item * @param bool $is_doc whether the item is a document or a link * @return array asscoiative array of document_part => weight count - * of occurrences of term in + * of occurrences of term in * */ function weightedCount($position_list, $is_doc) { @@ -736,19 +738,20 @@ class IndexShard extends PersistentStructure implements floatval(TITLE_WEIGHT) : floatval(DESCRIPTION_WEIGHT); } /** - * Computes BM25F relevance and a score for the supplied item based - * on the supplied parameters. + * Computes BM25F relevance and a score for the supplied item based + * on the supplied parameters. * - * @param array &$item doc summary to compute a relevance and score for. - * Pass-by-ref so self::RELEVANCE and self::SCORE fields can be changed - * @param int $occurrences - number of occurences of the term in the item - * @param int $doc_len number of words in doc item represents - * @param int $num_doc_or_link number of links or docs containing the term - * @param float $average_doc_len average length of items in corpus - * @param int $num_docs either number of links or number of docs depending - * if item represents a link or a doc. - * @param int $total_docs_or_links number of docs or links in corpus - * @param float BM25F weight for this component (doc or link) of score + * @param array& $item doc summary to compute a relevance and score for. + * Pass-by-ref so self::RELEVANCE and self::SCORE fields can be changed + * @param int $occurrences - number of occurences of the term in the item + * @param int $doc_len number of words in doc item represents + * @param int $num_doc_or_links number of links or docs containing the term + * @param float $average_doc_len average length of items in corpus + * @param int $num_docs either number of links or number of docs depending + * if item represents a link or a doc. + * @param int $total_docs_or_links number of docs or links in corpus + * @param float $type_weight BM25F weight for this component + * (doc or link) of score */ static function docStats(&$item, $occurrences, $doc_len, $num_doc_or_links, $average_doc_len, $num_docs, $total_docs_or_links, $type_weight) @@ -770,18 +773,18 @@ class IndexShard extends PersistentStructure implements $item[self::RELEVANCE] += $half * $IDF * $pre_relevance * $type_weight; } /** - * Gets the posting closest to index $current in the word_docs string - * modifies the passed-by-ref variables $posting_start and - * $posting_end so they are the index of the the start and end of the - * posting + * Gets the posting closest to index $current in the word_docs string + * modifies the passed-by-ref variables $posting_start and + * $posting_end so they are the index of the the start and end of the + * posting * - * @param int $current an index into the word_docs strings - * corresponds to a start search loc of $current * self::POSTING_LEN - * @param int &$posting_start after function call will be - * index of start of nearest posting to current - * @param int &$posting_end after function call will be - * index of end of nearest posting to current - * @return string the substring of word_docs corresponding to the posting + * @param int $current an index into the word_docs strings + * corresponds to a start search loc of $current * self::POSTING_LEN + * @param int& $posting_start after function call will be + * index of start of nearest posting to current + * @param int& $posting_end after function call will be + * index of end of nearest posting to current + * @return string the substring of word_docs corresponding to the posting */ function getPostingAtOffset($current, &$posting_start, &$posting_end) { @@ -807,10 +810,10 @@ class IndexShard extends PersistentStructure implements ($posting_end - $posting_start + 1) << 2); } /** - * Returns the document index of the posting at offset $current in - * word_docs - * @param int $current an offset into the posting lists (word_docs) - * @return int the doc index of the pointed to posting + * Returns the document index of the posting at offset $current in + * word_docs + * @param int $current an offset into the posting lists (word_docs) + * @return int the doc index of the pointed to posting */ function getDocIndexOfPostingAtOffset($current) { @@ -834,12 +837,12 @@ class IndexShard extends PersistentStructure implements * This is implemented using a galloping search (double offset till * get larger than binary search). * - * @param int $start_offset first posting to consider - * @param int $end_offset last posting before give up - * @param int $doc_offset document offset we want to be greater than or - * equal to + * @param int $start_offset first posting to consider + * @param int $end_offset last posting before give up + * @param int $doc_offset document offset we want to be greater than or + * equal to * - * @return array (int offset to next posting, doc_offset for this post) + * @return array (int offset to next posting, doc_offset for this post) */ function nextPostingOffsetDocOffset($start_offset, $end_offset, $doc_offset) @@ -891,12 +894,12 @@ class IndexShard extends PersistentStructure implements * position $current forward until either $end is reached or a * posting with document index bigger than $doc_index is found * - * @param int &$current current posting offset into posting list + * @param int& $current current posting offset into posting list * @param int $doc_index document index want bigger than or equal to * @param int $end last index of posting list * @return int document index bigger than or equal to $doc_index. Since - * $current points at the posting this occurs for if found, no success - * by whether $current > $end. + * $current points at the posting this occurs for if found, no success + * by whether $current > $end. */ function gallopPostingOffsetDocOffset(&$current, $doc_index, $end) { @@ -916,8 +919,8 @@ class IndexShard extends PersistentStructure implements * Given an offset of a posting into the word_docs string, looks up * the posting there and computes the doc_offset stored in it. * - * @param int $offset byte/char offset into the word_docs string - * @return int a document byte/char offset into the doc_infos string + * @param int $offset byte/char offset into the word_docs string + * @return int a document byte/char offset into the doc_infos string */ function docOffsetFromPostingOffset($offset) { $doc_index = $this->getDocIndexOfPostingAtOffset($offset >> 2); @@ -929,7 +932,8 @@ class IndexShard extends PersistentStructure implements * * @param string $word_id key to look up documents for * @param int number of documents desired back (from start of word linked - * list). + * list). + * @param int $len number of documents * @return array desired list of doc's and their info */ function getPostingsSliceById($word_id, $len) @@ -1016,11 +1020,11 @@ class IndexShard extends PersistentStructure implements * efficient word_postings string. * * $this->words is an associative array with associations - * wordid => postinglistforid + * wordid => postinglistforid * this format is relatively wasteful of memory * * $this->word_postings is a string in the format - * wordid1len1postings1wordid2len2postings2 ... + * wordid1len1postings1wordid2len2postings2 ... * wordids are lex ordered. This is more memory efficient ad the * former relies on the more wasteful php implementation fo associative * arrays. @@ -1032,7 +1036,7 @@ class IndexShard extends PersistentStructure implements * case the behavior is controlled by $replace. * * @param bool $replace whether to overwrite existing word_id postings - * (true) or to append (false) + * (true) or to append (false) */ function mergeWordPostingsToString($replace = false) { @@ -1154,7 +1158,7 @@ class IndexShard extends PersistentStructure implements * (we check and unpack to be on the safe side). * * @param array $docid_offsets a set of doc_id associated with a - * new_doc_offset. + * new_doc_offset. */ function changeDocumentOffsets($docid_offsets) { @@ -1196,14 +1200,14 @@ class IndexShard extends PersistentStructure implements } } /** - * Save the IndexShard to its filename + * Save the IndexShard to its filename * - * @param bool $to_string whether output should be written to a string - * rather than the default file location - * @param bool $with_logging whether log messages should be written - * as the shard save progresses - * @return string serialized shard if output was to string else empty - * string + * @param bool $to_string whether output should be written to a string + * rather than the default file location + * @param bool $with_logging whether log messages should be written + * as the shard save progresses + * @return string serialized shard if output was to string else empty + * string */ function save($to_string = false, $with_logging = false) { @@ -1267,7 +1271,7 @@ class IndexShard extends PersistentStructure implements * of a word_id in the words array. This method assumes that the word * data is already in >word_postings * @param bool $with_logging whether log messages should be written - * as progresses + * as progresses */ function prepareWordsAndPrefixes($with_logging = false) { @@ -1328,7 +1332,7 @@ class IndexShard extends PersistentStructure implements * * @param resource $fh a file handle to write the dictionary to, if desired * @param bool $with_logging whether to write progress log messages every - * 30 seconds + * 30 seconds */ function packWords($fh = NULL, $with_logging = false) { @@ -1475,7 +1479,7 @@ class IndexShard extends PersistentStructure implements * strings * * @param $offset byte offset to begin getting data out of disk-based - * word_docs + * word_docs * @param $len number of bytes to get * @return desired string */ @@ -1504,7 +1508,7 @@ class IndexShard extends PersistentStructure implements * strings * * @param $offset byte offset to begin getting data out of disk-based - * doc_infos + * doc_infos * @param $len number of bytes to get * @return desired string */ @@ -1517,8 +1521,8 @@ class IndexShard extends PersistentStructure implements return substr($this->doc_infos, $offset, $len); } /** - * Gets from Disk Data $len many bytes beginning at $offset from the - * current IndexShard + * Gets from Disk Data $len many bytes beginning at $offset from the + * current IndexShard * * @param int $offset byte offset to start reading from * @param int $len number of bytes to read @@ -1573,7 +1577,7 @@ class IndexShard extends PersistentStructure implements * * @param int $bytes byte offset to start reading from * @param bool $cache whether to cache disk blocks that have been read to - * RAM + * RAM * @return &string data fromIndexShard file */ function readBlockShardAtOffset($bytes, $cache = true) @@ -1636,7 +1640,7 @@ class IndexShard extends PersistentStructure implements * * @param int $doc_info integer to unpack * @return array pair (number of words in the document, - * number of keys that are used to make up its doc_id) + * number of keys that are used to make up its doc_id) */ static function unpackDoclenNum($doc_info) { @@ -1664,12 +1668,12 @@ class IndexShard extends PersistentStructure implements return array($first_offset, $last_offset, $count); } /** - * Load an IndexShard from a file or string + * Load an IndexShard from a file or string * - * @param string $fname the name of the file to the IndexShard from/to - * @param string &$data stringified shard data to load shard from. If NULL - * then the data is loaded from the $fname if possible - * @return object the IndexShard loaded + * @param string $fname the name of the file to the IndexShard from/to + * @param string& $data stringified shard data to load shard from. If NULL + * then the data is loaded from the $fname if possible + * @return object the IndexShard loaded */ static function load($fname, &$data = NULL) { @@ -1714,10 +1718,10 @@ class IndexShard extends PersistentStructure implements return $shard; } /** - * Split a header string into a shards field variable + * Split a header string into a shards field variable * - * @param string $header a string with packed shard header data - * @param object shard IndexShard to put data into + * @param string $header a string with packed shard header data + * @param object $shard IndexShard to put data into */ static function headerToShardFields($header, $shard) { @@ -1740,7 +1744,7 @@ class IndexShard extends PersistentStructure implements * Callback function for load method. splits a word_key . word_info string * into an entry in the passed shard $shard->words[word_key] = $word_info. * - * @param string &value the word_key . word_info string + * @param string& $value the word_key . word_info string * @param int $key index in array - we don't use * @param object $shard IndexShard to add the entry to word table for */ diff --git a/lib/indexing_plugins/addresses_plugin.php b/lib/indexing_plugins/addresses_plugin.php index 0484aa25e..4b050e089 100644 --- a/lib/indexing_plugins/addresses_plugin.php +++ b/lib/indexing_plugins/addresses_plugin.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2013 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2013 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -45,9 +45,9 @@ require_once BASE_DIR."/lib/crawl_constants.php"; /** Used for guessLocaleFromString */ require_once BASE_DIR."/lib/locale_functions.php"; /** - * Used to extract emails, phone numbers, and addresses from a web page. - * These are extracted into the EMAILS, PHONE_NUMBERS, and - * ADDRESSES fields of the page's summary. + * Used to extract emails, phone numbers, and addresses from a web page. + * These are extracted into the EMAILS, PHONE_NUMBERS, and + * ADDRESSES fields of the page's summary. * * @author Chris Pollett * @package seek_quarry @@ -56,9 +56,9 @@ require_once BASE_DIR."/lib/locale_functions.php"; class AddressesPlugin extends IndexingPlugin implements CrawlConstants { /** - * Associative array of world countries and country code. Some - * entries are duplicated into country's local script - * @var array + * Associative array of world countries and country code. Some + * entries are duplicated into country's local script + * @var array */ var $countries = array("ANDORRA" => "AD","UNITED ARAB EMIRATES" => "AE", "AFGHANISTAN" => "AF","ANTIGUA AND BARBUDA" => "AG", @@ -158,10 +158,10 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants "SAMOA" => "WS","YEMEN" => "YE", "MAYOTTE" => "YT", "SOUTH AFRICA" => "ZA","ZAMBIA" => "ZM", "ZIMBABWE" => "ZW"); /** - * List of common regions, abbreviations, and local spellings of - * regions of the US, Canada, Australia, UK, as well as major cities - * elsewhere - * @var array + * List of common regions, abbreviations, and local spellings of + * regions of the US, Canada, Australia, UK, as well as major cities + * elsewhere + * @var array */ var $regions = array("ALABAMA", "AL", "ALASKA", "AK", "ARIZONA", "AZ", "ARKANSAS", "AR", @@ -288,12 +288,12 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants * such as adding sub-documents, before the page summary is * handed back to the fetcher. * - * @param string $page web-page contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page web-page contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array consisting of a sequence of subdoc arrays found - * on the given page. + * @return array consisting of a sequence of subdoc arrays found + * on the given page. */ function pageProcessing($page, $url) { @@ -322,13 +322,13 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants return $subdocs; } /** - * Adjusts the document summary of a page after the page processor's - * process method has been called so that the subdoc's fields - * associated with the addresses plugin get copied as fields of - * the whole page summary. Then it deletes the subdoc fields. + * Adjusts the document summary of a page after the page processor's + * process method has been called so that the subdoc's fields + * associated with the addresses plugin get copied as fields of + * the whole page summary. Then it deletes the subdoc fields. * - * @param array $summary of current document. It will be adjusted - * by the code below + * @param array $summary of current document. It will be adjusted + * by the code below */ function pageSummaryProcessing(&$summary) { @@ -357,12 +357,12 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants } } /** - * Parses EMAILS, PHONE_NUMBERS and ADDRESSES from $text and returns - * an array with these three fields containing sub-arrays of the given - * items + * Parses EMAILS, PHONE_NUMBERS and ADDRESSES from $text and returns + * an array with these three fields containing sub-arrays of the given + * items * - * @param string $text to use for extraction - * @return array with found emails, phone numbers, and addresses + * @param string $text to use for extraction + * @return array with found emails, phone numbers, and addresses */ function parseSubdoc($text) { @@ -435,13 +435,13 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants return $subdocs; } /** - * Checks if the passed sequence of lines has enough features of a - * postal address to call it an address. If so, return the address as - * a single string + * Checks if the passed sequence of lines has enough features of a + * postal address to call it an address. If so, return the address as + * a single string * - * @param array $pre_address an array of potential address lines - * @return mixed false if not address, the lines imploded together using - * space if an address + * @param array $pre_address an array of potential address lines + * @return mixed false if not address, the lines imploded together using + * space if an address */ function checkCandidate($pre_address) { @@ -467,11 +467,11 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants return $address; } /** - * Used to check if a line countains a word associated with a province, - * state or major city. + * Used to check if a line countains a word associated with a province, + * state or major city. * - * @param string $line from address to check - * @return bool whether it contains acountry term + * @param string $line from address to check + * @return bool whether it contains acountry term */ function checkRegion($line) { @@ -494,11 +494,11 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants return false; } /** - * Used to check if a line countains either an email address or a phone - * number + * Used to check if a line countains either an email address or a phone + * number * - * @param string $line from address to check - * @return bool whether it contains acountry term + * @param string $line from address to check + * @return bool whether it contains acountry term */ function checkPhoneOrEmail($line) { @@ -513,11 +513,11 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants return false; } /** - * Extracts substrings from the provided $line that are in the format - * of an email address. Returns first email from line + * Extracts substrings from the provided $line that are in the format + * of an email address. Returns first email from line * - * @param string $line string to extract email from - * @return string first email found on line + * @param string $line string to extract email from + * @return string first email found on line */ function parseEmails($line) { @@ -528,11 +528,11 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants return $emails[0]; } /** - * Checks for a phone number related keyword in the line and if - * found extracts digits which are presumed to be a phone number + * Checks for a phone number related keyword in the line and if + * found extracts digits which are presumed to be a phone number * - * @param string $line to check for phone numbers - * @return array all phone numbers detected by this method from the $line + * @param string $line to check for phone numbers + * @return array all phone numbers detected by this method from the $line */ function parsePhones($line) { @@ -556,11 +556,11 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants return $phones; } /** - * Used to check if a line contains a word associated with a World - * country or country code. + * Used to check if a line contains a word associated with a World + * country or country code. * - * @param string $line from address to check - * @return bool whether it contains a country term + * @param string $line from address to check + * @return bool whether it contains a country term */ function checkCountry($line) { @@ -582,11 +582,11 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants return false; } /** - * Used to check if a line contains a word associated with a ZIP - * or Postal code + * Used to check if a line contains a word associated with a ZIP + * or Postal code * - * @param string $line from address to check - * @return bool whether it contains such a code + * @param string $line from address to check + * @return bool whether it contains such a code */ function checkZipPostalCodeWords($line) { @@ -597,12 +597,12 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants return false; } /** - * Used to check if a given line in an address candidate has features - * associated with being a street address. + * Used to check if a given line in an address candidate has features + * associated with being a street address. * - * @param string $line address line to check - * @return bool whether or not it contains a word identified with - * being a street address such as WAY, AVENUE, STREET, etc. + * @param string $line address line to check + * @return bool whether or not it contains a word identified with + * being a street address such as WAY, AVENUE, STREET, etc. */ function checkStreet($line) { @@ -620,7 +620,7 @@ class AddressesPlugin extends IndexingPlugin implements CrawlConstants * this plugin * * @return array meta words and maximum description length of results - * allowed for that meta word + * allowed for that meta word */ static function getAdditionalMetaWords() { diff --git a/lib/indexing_plugins/indexing_plugin.php b/lib/indexing_plugins/indexing_plugin.php index 1e34cf85f..105cd9f45 100644 --- a/lib/indexing_plugins/indexing_plugin.php +++ b/lib/indexing_plugins/indexing_plugin.php @@ -1,27 +1,27 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2011 - 2014 Priya Gangaraju priya.gangaraju@gmail.com, - * Chris Pollett + * Copyright (C) 2011 - 2014 Priya Gangaraju priya.gangaraju@gmail.com, + * Chris Pollett * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Priya Gangaraju priya.gangaraju@gmail.com, Chris Pollett * @package seek_quarry @@ -56,53 +56,53 @@ require_once BASE_DIR."/models/datasources/".DBMS."_manager.php"; * methods: * * static getProcessors() -- returns an array of strings of page processor names - * which a plugin should be used with. For example, a plugin might want to - * alter the summary whenever an HtmlProcessor is used on a page, so - * this array should contain HtmlProcessor, but on the other hand, the - * plugin might not need to alter anything when the JpgProcessor is in use, - * so the returned array shouldn't contain JpgProcessor + * which a plugin should be used with. For example, a plugin might want to + * alter the summary whenever an HtmlProcessor is used on a page, so + * this array should contain HtmlProcessor, but on the other hand, the + * plugin might not need to alter anything when the JpgProcessor is in use, + * so the returned array shouldn't contain JpgProcessor * * pageProcessing($page, $url) -- which is called by a page processor - * when a page is being processed. It returns additional subdoc page summary - * info which is then handed back to the fetcher (@see pageProcessing method - * below for more info.) + * when a page is being processed. It returns additional subdoc page summary + * info which is then handed back to the fetcher (@see pageProcessing method + * below for more info.) * * pageSummaryProcessing(&$summary) -- which is called by a page processor in a - * fetcher after the initial summary has been generated (by processor itself - * and all plugins which are associated with the processor). This method can - * be used to further modify the summary + * fetcher after the initial summary has been generated (by processor itself + * and all plugins which are associated with the processor). This method can + * be used to further modify the summary * * getAdditionalMetaWords() -- which is called when meta words are extracted - * from a query at search time. This allows the plugin to specify its own - * meta words to be extracted from the query. @see getAdditionalMetaWords - * for more details on the return type of this method. + * from a query at search time. This allows the plugin to specify its own + * meta words to be extracted from the query. @see getAdditionalMetaWords + * for more details on the return type of this method. * * If you would like to write a plugin which can be configured on the * Admin > Page Options page, then you need to write four other methods: * * loadConfiguration() -- which can read plugin configuration data from - * persistent storage on the name server into an array or object when a - * crawl is started. This data is then automatically serialized and sent to - * queue servers as part of starting a crawl + * persistent storage on the name server into an array or object when a + * crawl is started. This data is then automatically serialized and sent to + * queue servers as part of starting a crawl * * setConfiguration() -- which takes a configuration array or object and uses - * it to initialize an instance of the plugin on a queue_server or on a - * fetcher. + * it to initialize an instance of the plugin on a queue_server or on a + * fetcher. * * configureHandler(&$data) -- which is called by the AdminController - * pageOptions activity method to let the plugin handle any configuration - * $_REQUEST data sent by this activity with regard to the plugin and to - * also let plugin modify the $data which might be sent to the plugin's - * view. This method would typically be called on the name server and - * so can be used to save (or to call a method which saves) any - * configuration data extracted from the request. + * pageOptions activity method to let the plugin handle any configuration + * $_REQUEST data sent by this activity with regard to the plugin and to + * also let plugin modify the $data which might be sent to the plugin's + * view. This method would typically be called on the name server and + * so can be used to save (or to call a method which saves) any + * configuration data extracted from the request. * * configureView(&$data) -- which is called to draw the HTML configure screen - * used by the plugin given the information in &$data. This might display - * a form a user would use to alter the behavior of the plugin + * used by the plugin given the information in &$data. This might display + * a form a user would use to alter the behavior of the plugin * * Subclasses of IndexingPlugin stored in - * WORK_DIRECTORY/app/lib/indexing_plugins + * WORK_DIRECTORY/app/lib/indexing_plugins * will be detected by Yioop. So one can add code there to make it easier * to upgrade Yioop. I.e., your site specific code can stay in the work * directory and you merely need to replace the Yioop folder when upgrading. @@ -147,13 +147,13 @@ abstract class IndexingPlugin * such as adding sub-documents, before the page summary is * handed back to the fetcher. * - * @param string $page web-page contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page web-page contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array consisting of a sequence of subdoc arrays found - * on the given page. Each subdoc array has a self::TITLE and - * a self::DESCRIPTION + * @return array consisting of a sequence of subdoc arrays found + * on the given page. Each subdoc array has a self::TITLE and + * a self::DESCRIPTION */ function pageProcessing($page, $url) {return NULL;} /** @@ -166,8 +166,8 @@ abstract class IndexingPlugin * them in the getAdditionalMetaWords function for this plugin, or they * will not be recognized in queries. * - * @param array &$summary the summary data produced by the relevant page - * processor's handle method; modified in-place. + * @param array& $summary the summary data produced by the relevant page + * processor's handle method; modified in-place. */ function pageSummaryProcessing(&$summary) {return NULL;} /** @@ -178,21 +178,23 @@ abstract class IndexingPlugin * for end use. * * @param string $index_name the name/timestamp of an IndexArchiveBundle - * to do post processing for + * to do post processing for */ function postProcessing($index_name) {return NULL;} /** + * Returns a list of page processors that can use this plugin + * * @return array string names of page processors that this plugin - * associates with + * associates with */ static function getProcessors() {return NULL;} /** - * Returns an associative array of meta words => description length - * for each meta word injected by this plugin into an index. The - * description length is used to say how the maximum length of - * the web snippet show in search results for this meta owrd should be + * Returns an associative array of meta words => description length + * for each meta word injected by this plugin into an index. The + * description length is used to say how the maximum length of + * the web snippet show in search results for this meta owrd should be * - * @return array meta words => description length pairs + * @return array meta words => description length pairs */ static function getAdditionalMetaWords() {return array();} diff --git a/lib/indexing_plugins/recipe_plugin.php b/lib/indexing_plugins/recipe_plugin.php index f942d789d..aa2c64e27 100644 --- a/lib/indexing_plugins/recipe_plugin.php +++ b/lib/indexing_plugins/recipe_plugin.php @@ -1,30 +1,30 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2011 - 2014 Priya Gangaraju priya.gangaraju@gmail.com, - * Chris Pollett, chris@pollett.org + * Copyright (C) 2011 - 2014 Priya Gangaraju priya.gangaraju@gmail.com, + * Chris Pollett, chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Priya Gangaraju priya.gangaraju@gmail.com, Chris Pollett - * chris@pollett.org + * chris@pollett.org * @package seek_quarry * @subpackage indexing_plugin * @license http://www.gnu.org/licenses/ GPL3 @@ -55,7 +55,7 @@ require_once BASE_DIR."/lib/processors/html_processor.php"; /** Base indexing plugin class*/ require_once BASE_DIR."/lib/indexing_plugins/indexing_plugin.php"; /** Used to create index shards to add ingredient: entries - * to index + * to index */ require_once BASE_DIR."/lib/index_shard.php"; /** Used to extract text from documents*/ @@ -84,7 +84,7 @@ require_once BASE_DIR."/controllers/search_controller.php"; * * * @author Priya Gangaraju, Chris Pollett (re-organized, added documentation, - * updated) + * updated) * @package seek_quarry * @subpackage indexing_plugin */ @@ -100,13 +100,13 @@ class RecipePlugin extends IndexingPlugin implements CrawlConstants * of the ingredients of the recipe. Ingredients will be separated by * || * - * @param string $page web-page contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page web-page contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array consisting of a sequence of subdoc arrays found - * on the given page. Each subdoc array has a self::TITLE and - * a self::DESCRIPTION + * @return array consisting of a sequence of subdoc arrays found + * on the given page. Each subdoc array has a self::TITLE and + * a self::DESCRIPTION */ function pageProcessing($page, $url) { @@ -405,10 +405,10 @@ class RecipePlugin extends IndexingPlugin implements CrawlConstants } } /** - * Extracts the main ingredient from the ingredient. + * Extracts the main ingredient from the ingredient. * - * @param string $text ingredient. - * @return string $name main ingredient + * @param string $text ingredient. + * @return string $name main ingredient */ function getIngredientName($text) { @@ -490,8 +490,8 @@ class RecipePlugin extends IndexingPlugin implements CrawlConstants * this plugin * * @return array meta words and maximum description length of results - * allowed for that meta word (in this case 2000 as want - * to allow sufficient descriptions of whole recipes) + * allowed for that meta word (in this case 2000 as want + * to allow sufficient descriptions of whole recipes) */ static function getAdditionalMetaWords() { @@ -499,72 +499,134 @@ class RecipePlugin extends IndexingPlugin implements CrawlConstants "ingredient:" => MAX_DESCRIPTION_LEN); } } -/** - * Gets the language tag (for instance, en_US for American English) of the - * locale that is currently being used. - * - * @return string "en-US" since for now the recipe plugin only works - * with English recipes - */ if(!function_exists("getLocaleTag")) { + /** + * Gets the language tag (for instance, en_US for American English) of the + * locale that is currently being used. + * + * @return string "en-US" since for now the recipe plugin only works + * with English recipes + */ function getLocaleTag() { return "en_US"; } } /** - * class to define vertex + * Vertex class for Recipe Clustering Minimal Spanning Tree * @package seek_quarry * @subpackage indexing_plugin */ class Vertex { - private $label; - private $visited; - function __construct($label){ + /** + * Name of this Vertex (recipe title) + * @var string + */ + var $label; + /** + * Whether this node has been seen as part of MST construction + * @var bool + */ + var $visited; + /** + * Construct a vertex suitable for the Recipe Clustering Minimal Spanning + * Tree + * + * @param string $label name of this Vertex (recipe title) + */ + function __construct($label) + { $this->label = $label; $this->visited = false; } - function getLabel(){ + /** + * Accessor for label of this Vertex + * @return string label of Vertex + */ + function getLabel() + { return $this->label; } - function visited(){ + /** + * Sets the vertex to visited + */ + function visited() + { $this->visited = true; } - function isVisited(){ + /** + * Accessor for $visited state of this Vertex + * @return bool $visited state + */ + function isVisited() + { return $this->visited; } } /** - * class to define edge + * Directed Edge class for Recipe Clustering Minimal Spanning Tree + * * @package seek_quarry * @subpackage indexing_plugin */ class Edge { - private $start_vertex; - private $end_vertex; - private $cost; - function __construct($vertex1,$vertex2,$cost){ + /** + * Starting vertex of the directed edge this object represents + * @var Vertex + */ + var $start_vertex; + /** + * End vertex of the directed edge this object represents + * @var Vertex + */ + var $end_vertex; + /** + * Weight of this edge + * @var float + */ + var $cost; + /** + * Construct a directed Edge using a starting and ending vertex and a weight + * + * @param Vertex $vertex1 starting Vertex + * @param Vertex $vertex2 ending Vertex + * @param float $cost weight of this edge + */ + function __construct($vertex1, $vertex2, $cost) + { $this->start_vertex = new Vertex($vertex1); $this->end_vertex = new Vertex($vertex2); $this->cost = $cost; } + /** + * Accessor for starting vertex of this edge + * @return Vertex starting vertex + */ function getStartVertex() { return $this->start_vertex; } + /** + * Accessor for ending vertex of this edge + * @return Vertex ending vertex + */ function getEndVertex() { return $this->end_vertex; } + /** + * Accessor for weight of this edge + * @return float weight of this edge + */ function getCost() { return $this->cost; } } /** - * Class to define Minimum Spanning tree. constructMST constructs + * Class to define Minimum Spanning tree for recipes. constructMST constructs * the minimum spanning tree using heap. formCluster forms clusters by * deleting the most expensive edge. BreadthFirstSearch is used to * traverse the MST. @@ -573,17 +635,34 @@ class Edge */ class Tree { - private $cluster_heap; - private $vertices; - private $adjMatrix; - function __construct(){ + /** + * Maintains a priority queue of edges ordered by max weight + * @var Cluster + */ + var $cluster_heap; + /** + * Array of Vertices (Recipes) + * @var array + */ + var $vertices; + /** + * Adjacency matrix of whether recipes are adjacent to each other + * @var array + */ + var $adjMatrix; + /** + * Constructs a tree suitable for building containing a Minimal Spanning + * Tree for Kruskal clustering + */ + function __construct() + { $this->cluster_heap = new Cluster(); $this->vertices = array(); } /** * Constructs the adjacency matrix for the MST. * - * @param object array $edges vertices and edge weights of MST + * @param array $edges vertices and edge weights of MST */ function constructMST($edges) { @@ -615,6 +694,11 @@ class Tree $nodeQueue = new Queue($k); $cluster_count = $size * CLUSTER_RATIO; $cluster = array(); + /* + Idea remove $cluster_count many weightiest edges from tree + to get a forest. As do this add to queue end points of + removed edges. + */ for($j = 0; $j < $cluster_count - 1; $j++) { $max_edge = $this->cluster_heap->extract(); $cluster1_start = $max_edge->getStartVertex()->getLabel(); @@ -625,7 +709,8 @@ class Tree $nodeQueue->enqueue($cluster2_start); } $queue = new Queue($k); - $i=0; + $i = 0; + // Now use Queue above to make clusters (trees in resulting forest) while(!$nodeQueue->isEmpty()) { $node = $nodeQueue->dequeue(); if($this->vertices[$node]->isVisited() == false){ @@ -658,7 +743,6 @@ class Tree && ($this->vertices[$value]->isVisited() == false)) { return $this->adjMatrix[$vertex][$vert]; } - } return -1; } @@ -713,6 +797,9 @@ class Tree } if(!class_exists("SplHeap")) { + /** + * Dummy version of PHP SplHeap so code doesn't crash if doesn exist + */ class SplHeap { } } @@ -724,7 +811,14 @@ if(!class_exists("SplHeap")) { */ class Cluster extends SplHeap { - + /** + * Compares the weights of two edges and returns -1, 0, 1 depending + * on which is the largest first, equal, or second + * + * @param Edge $edge1 first Edge to compare + * @param Edge $edge2 second Edge to compare + * @return int -1,-0,1 as described above + */ function compare($edge1, $edge2) { $values1 = $edge1->getCost(); @@ -740,7 +834,14 @@ class Cluster extends SplHeap */ class TreeCluster extends SplHeap { - + /** + * Compares the weights of two edges and returns -1, 0, 1 depending + * on which is the largest first, equal, or second + * + * @param Edge $edge1 first Edge to compare + * @param Edge $edge2 second Edge to compare + * @return int -1,-0,1 as described above + */ function compare($edge1, $edge2) { $values1 = $edge1->getCost(); @@ -757,32 +858,64 @@ class TreeCluster extends SplHeap */ class Queue { - private $size; - private $queArray; - private $front; - private $rear; - - function __construct($size){ + /** + * Number of elements queue can hold + * @var int + */ + var $size; + /** + * Circular array used to store queue elements + * @var array + */ + var $queArray; + /** + * Index in $queArray of the front of the queue + * @var int + */ + var $front; + /** + * Index in $queArray of the end of the queue + * @var int + */ + var $rear; + /** + * Builds a queue suitable for doing breadth first search traversal + * @param int $size number of elements queue can hold + */ + function __construct($size) + { $this->queArray = array(); $this->front = 0; $this->rear = -1; $this->size = $size; } - - function enqueue($i){ - if($this->rear == $this->size-1) + /** + * Add an element, typically a Vertex label to the queue + * @param string $i typically a Vertex label + */ + function enqueue($i) + { + if($this->rear == $this->size - 1) $this->rear = -1; $this->queArray[++$this->rear] = $i; } - - function dequeue(){ + /** + * Removes the front of the queue and returns it + * @return string front of queue + */ + function dequeue() + { $temp = $this->queArray[$this->front++]; if($this->front == $this->size) $this->front = 0; return $temp; } - - function isEmpty(){ + /** + * Whether or not the queue is empty + * @return bool + */ + function isEmpty() + { if(($this->rear + 1)== $this->front || ($this->front + $this->size - 1) == $this->rear) return true; @@ -793,7 +926,7 @@ class Queue /** * Creates tree from the input and apply Kruskal's algorithm to find MST. * - * @param object array $edges recipes with distances between them. + * @param array $edges recipes with distances between them. * @return object arrat $min_edges MST */ function construct_tree($edges) @@ -843,10 +976,10 @@ function construct_tree($edges) } /** * Clusters the recipes by applying Kruskal's algorithm - * @param array $edges recipes and distances between them. * + * @param array $edges array of triples (recipe_1_title, recipe_2_title, weight) * @param int $count number of recipes. - * @param array $distinct_ingredients recipe names with ingredients. + * @param array $distinct_ingredients list of possible ingredients * @return clusters of recipes. */ function kruskalClustering($edges, $count, $distinct_ingredients) diff --git a/lib/indexing_plugins/wordfilter_plugin.php b/lib/indexing_plugins/wordfilter_plugin.php index 815a7c5b6..82308b58e 100644 --- a/lib/indexing_plugins/wordfilter_plugin.php +++ b/lib/indexing_plugins/wordfilter_plugin.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2013 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2013 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -76,7 +76,7 @@ require_once BASE_DIR."/lib/crawl_constants.php"; * * This plugin has been created with a dummy list of filter rules. By doing a * crawl on the test site contain in the archive - * tests/word-filter-test-crawl.zip + * tests/word-filter-test-crawl.zip * one can test how it behaves on those terms. To make use of * this plugin on real web data one probably wants to alter the choice of words. * This can be done from Admin > Page Options > Crawl Time tab by clicking on @@ -185,8 +185,8 @@ EOD; * whether the summary title and description satisfy various rules * in $this->filter_rules * - * @param array &$summary the summary data produced by the relevant page - * processor's handle method; modified in-place. + * @param array& $summary the summary data produced by the relevant page + * processor's handle method; modified in-place. */ function pageSummaryProcessing(&$summary) { @@ -216,7 +216,7 @@ EOD; * * @see $filter_terms to see what constitutes a valid precondition. * - * @param string $precondition the terms and their frequencies to search for + * @param string $preconditions the terms and their frequencies to search for * @param string $title of a web page summary * @param string $description of a web page summary * @return bool whether the summary should be filtered or not @@ -241,8 +241,8 @@ EOD; return true; } /** - * Saves to a file $this->rules_string, a field which contains the string - * rules that are being used with this plugin + * Saves to a file $this->rules_string, a field which contains the string + * rules that are being used with this plugin */ function saveConfiguration() { @@ -250,12 +250,12 @@ EOD; file_put_contents($config_file, $this->rules_string); } /** - * Reads plugin configuration data from data/word_filter_plugin.txt - * on the name server into $this->rule_string. Then parse this string - * to $this->filter_rules, the format used by - * $this->pageSummaryProcessing(&$summary) + * Reads plugin configuration data from data/word_filter_plugin.txt + * on the name server into $this->rule_string. Then parse this string + * to $this->filter_rules, the format used by + * $this->pageSummaryProcessing(&$summary) * - * @return array configuration associative array + * @return array configuration associative array */ function loadConfiguration() { @@ -268,13 +268,13 @@ EOD; } /** * Ttakes a configuration array of rules and sets them as the rules for - * this instance of the plugin. Typically used on a - * queue_server or on a fetcher. It first sets the value of - * $this->filter_rules, then in case we later call saveConfiguration(), - * it also call serializeRules to store the serial format in - * $this->rules_string + * this instance of the plugin. Typically used on a + * queue_server or on a fetcher. It first sets the value of + * $this->filter_rules, then in case we later call saveConfiguration(), + * it also call serializeRules to store the serial format in + * $this->rules_string * - * @param array $configuration + * @param array $configuration */ function setConfiguration($configuration) { @@ -282,15 +282,15 @@ EOD; $this->serializeRules(); } /** - * Behaves as a "controller" for the configuration page of the plugin. - * It is called by the AdminController pageOptions activity method to - * let the plugin handle any configuration $_REQUEST data sent by this - * activity with regard to the plugin. This method sees if the $_REQUEST - * has word filter plugin configuration data, and if so cleans and saves - * it. It then modifies $data so that if the plugin's configuration view - * is drawn it makes use of the current plugin configuration info. + * Behaves as a "controller" for the configuration page of the plugin. + * It is called by the AdminController pageOptions activity method to + * let the plugin handle any configuration $_REQUEST data sent by this + * activity with regard to the plugin. This method sees if the $_REQUEST + * has word filter plugin configuration data, and if so cleans and saves + * it. It then modifies $data so that if the plugin's configuration view + * is drawn it makes use of the current plugin configuration info. * - * @param array &$data info to be used by the admin view to draw itself. + * @param array& $data info to be used by the admin view to draw itself. */ function configureHandler(&$data) { @@ -379,10 +379,10 @@ EOD; $this->rules_string = $rules_string; } /** - * Used to draw the HTML configure screen for the word filter plugin. + * Used to draw the HTML configure screen for the word filter plugin. * - * @param array &$data contains configuration data to be used in drawing - * the view + * @param array& $data contains configuration data to be used in drawing + * the view */ function configureView(&$data) { diff --git a/lib/javascript_unit_test.php b/lib/javascript_unit_test.php index 5dc5621dd..a9990a7ba 100644 --- a/lib/javascript_unit_test.php +++ b/lib/javascript_unit_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -35,17 +35,23 @@ */ require_once BASE_DIR.'/lib/unit_test.php'; /** - * Super class of all the test classes testing Javascript functions. + * Super class of all the test classes testing Javascript functions. * - * @author Akash Patel - * @package seek_quarry - * @subpackage test + * @author Akash Patel + * @package seek_quarry + * @subpackage test */ class JavascriptUnitTest extends UnitTest { + /** + * {@inheritDocs} + */ function setUp() { } + /** + * {@inheritDocs} + */ function tearDown() { } diff --git a/lib/join.php b/lib/join.php index 90f1d2340..7ce99b5c5 100644 --- a/lib/join.php +++ b/lib/join.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/lib/locale_functions.php b/lib/locale_functions.php index 7caee8a1a..1a5b3ed43 100755 --- a/lib/locale_functions.php +++ b/lib/locale_functions.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * This file contains global functions connected to localization that * are used throughout the web site part of Yioop! @@ -37,8 +37,8 @@ */ require_once BASE_DIR."/models/locale_model.php"; /** - * Attempts to guess the user's locale based on the request, session, - * and user-agent data + * Attempts to guess the user's locale based on the request, session, + * and user-agent data * * @return string IANA language tag of the guessed locale */ @@ -91,7 +91,7 @@ function guessLocale() * * @param string $phrase_string used to make guess * @param string $locale_tag language tag to use if can't guess -- if not - * provided uses current locale's value + * provided uses current locale's value * @param int threshold number of chars to guess a particular encoding * @return string IANA language tag of the guessed locale @@ -152,9 +152,9 @@ function guessLocaleFromString($phrase_string, $locale_tag = NULL) /** * Tries to find wether query belongs to a programming language * - * @param string $query query entered by user + * @param string $query query entered by user * - * @return string $lang programming language for the the query provided + * @return string $lang programming language for the the query provided */ function checkQuery($query) { @@ -178,9 +178,9 @@ function checkQuery($query) * Tries to guess at a language tag based on the name of a character * encoding * - * @param string $encoding a character encoding name + * @param string $encoding a character encoding name * - * @return string guessed language tag + * @return string guessed language tag */ function guessLangEncoding($encoding) { @@ -204,18 +204,18 @@ function guessLangEncoding($encoding) return 'en'; } /** - * Tries to guess the encoding used for an Html document + * Tries to guess the encoding used for an Html document * - * @param string $html a character encoding name - * @param string $return_loc_info if meta http-equiv info was used to - * find the encoding, then if $return_loc_info is true, we - * return the location of charset substring. This allows converting to - * UTF-8 later so cached pages will display correctly and - * redirects without char encoding won't be given a different hash. + * @param string $html a character encoding name + * @param string $return_loc_info if meta http-equiv info was used to + * find the encoding, then if $return_loc_info is true, we + * return the location of charset substring. This allows converting to + * UTF-8 later so cached pages will display correctly and + * redirects without char encoding won't be given a different hash. * - * @return mixed either string or array if string then guessed encoding, - * if array guessed encoding, start_pos of where charset info came from, - * length + * @return mixed either string or array if string then guessed encoding, + * if array guessed encoding, start_pos of where charset info came from, + * length */ function guessEncodingHtml($html, $return_loc_info = false) { @@ -287,7 +287,7 @@ function tl() * Sets the language to be used for locale settings * * @param string $locale_tag the tag of the language to use to determine - * locale settings + * locale settings */ function setLocaleObject($locale_tag) { @@ -302,7 +302,7 @@ if(!function_exists("getLocaleTag")) { * locale that is currently being used. * * @return string the tag of the language currently being used for locale - * settings + * settings */ function getLocaleTag() { @@ -344,7 +344,7 @@ function getLocaleQueryStatistics() * top of the page to the bottom. Other languages like classical Chinese list * them from right to left. * - * @return string tb lr rl depending on the current locales block progression + * @return string tb lr rl depending on the current locales block progression */ function getBlockProgression() { @@ -357,7 +357,7 @@ function getBlockProgression() * locale direction and the block progression. For instance, for English the * writing mode is lr-tb (left-to-right top-to-bottom). * - * @return string the locales writing mode + * @return string the locales writing mode */ function getWritingMode() { diff --git a/lib/mail_server.php b/lib/mail_server.php index 17ea7a7d9..53edce715 100644 --- a/lib/mail_server.php +++ b/lib/mail_server.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -43,12 +43,12 @@ require_once BASE_DIR."/lib/utility.php"; * configuration issues that might be needed with PHP's built-in mail() * function. Here is an example of how one might use this class: * - * $server = new MailServer('somewhere.com', 587, 'someone', 'pword', 'tls'); - * $to = "cool@place.com"; - * $from = "someone@somewhere.com"; - * $subject = "Test Mail"; - * $message = "This is a test"; - * $server->send($subject, $from, $to, $message); + * $server = new MailServer('somewhere.com', 587, 'someone', 'pword', 'tls'); + * $to = "cool@place.com"; + * $from = "someone@somewhere.com"; + * $subject = "Test Mail"; + * $message = "This is a test"; + * $server->send($subject, $from, $to, $message); * * @author Chris Pollett * @package seek_quarry @@ -104,7 +104,7 @@ class MailServer */ const SMTP_CODE_LEN = 3; /** - * Service ready for requests + * Service ready for requests */ const SERVER_READY = 220; /** @@ -124,18 +124,18 @@ class MailServer */ const START_INPUT = 354; /** - * Encapuslates the domain and credentials of a SMTP server - * in a MailServer object + * Encapuslates the domain and credentials of a SMTP server + * in a MailServer object * - * @param string $sender_email who mail will be sent from (can be - * overwritten) - * @param string $server domain name of machine will connect to - * @param int $port port on that machine - * @param string $login username to use for authentication ("" if no - * auth) - * @param string $password password to use for authentication ("" if no - * auth) - * @param mixed $secure false is SSL and TLS not used, otherwise SSL or TLS + * @param string $sender_email who mail will be sent from (can be + * overwritten) + * @param string $server domain name of machine will connect to + * @param int $port port on that machine + * @param string $login username to use for authentication ("" if no + * auth) + * @param string $password password to use for authentication ("" if no + * auth) + * @param mixed $secure false is SSL and TLS not used, otherwise SSL or TLS */ function __construct($sender_email, $server, $port, $login, $password, $secure = false) @@ -155,9 +155,9 @@ class MailServer $this->messages = ""; } /** - * Connects to and if needs be authenticates with a SMTP server + * Connects to and if needs be authenticates with a SMTP server * - * @return bool whether the session was successfully established + * @return bool whether the session was successfully established */ function startSession() { @@ -204,7 +204,7 @@ class MailServer return true; } /** - * Closes the currently active SMTP session + * Closes the currently active SMTP session */ function endSession() { @@ -212,9 +212,9 @@ class MailServer fclose($this->connection); } /** - * Reads data from an SMTP server until a command response code detected + * Reads data from an SMTP server until a command response code detected * - * @return string three byte response code + * @return string three byte response code */ function readResponseGetCode() { @@ -227,11 +227,11 @@ class MailServer return substr($data, 0, self::SMTP_CODE_LEN); } /** - * Sends a single SMTP command to the current SMTP server and - * then returns the SMTP response code + * Sends a single SMTP command to the current SMTP server and + * then returns the SMTP response code * - * @param string $command the command to execute - * @return string three character integer response code + * @param string $command the command to execute + * @return string three character integer response code */ function smtpCommand($command) { @@ -240,13 +240,13 @@ class MailServer return $this->readResponseGetCode(); } /** - * Sends an email (much like PHP's mail command, but not requiring - * a configured smtp server on the current machine) + * Sends an email (much like PHP's mail command, but not requiring + * a configured smtp server on the current machine) * - * @param string $subject subject line of the email - * @param string $from sender email address - * @param string $to recipient email address - * @param string $message message body for the email + * @param string $subject subject line of the email + * @param string $from sender email address + * @param string $to recipient email address + * @param string $message message body for the email */ function send($subject, $from, $to, $message) { diff --git a/lib/notifier.php b/lib/notifier.php index 67aeddc59..72bd0db5a 100755 --- a/lib/notifier.php +++ b/lib/notifier.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -59,8 +59,8 @@ interface Notifier * Handles the update of the index of a data item in a queue with respect * to the Notifier object. * - * @param int $index the index of a row in a heap-based priority queue - * @param mixed $data the data that is stored at that index + * @param int $index the index of a row in a heap-based priority queue + * @param mixed $data the data that is stored at that index */ function notify($index, $data); } diff --git a/lib/nword_grams.php b/lib/nword_grams.php index e60732873..161cc3f93 100644 --- a/lib/nword_grams.php +++ b/lib/nword_grams.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Ravi Dhillon ravi.dhillon@yahoo.com, Chris Pollett * @package seek_quarry @@ -43,7 +43,7 @@ require_once BASE_DIR."/lib/phrase_parser.php"; * Library of functions used to create and extract n word grams * * @author Ravi Dhillon (Bigram Version), Chris Pollett (ngrams + rewrite + - * support for page count dumps) + * support for page count dumps) * * @package seek_quarry * @subpackage library @@ -56,7 +56,7 @@ class NWordGrams */ static $ngrams = NULL; /** - * + * How many bytes to read in one go from wiki file when creating filter */ const BLOCK_SIZE = 8192; /** @@ -79,7 +79,7 @@ class NWordGrams * @param $phrase what to check if is a bigram * @param string $lang language of bigrams file * @param string $filter_prefix either the word "segment", "all", or - * number n of the number of words in an ngram in filter. + * number n of the number of words in an ngram in filter. * @return true or false */ static function ngramsContains($phrase, $lang, $filter_prefix = 2) @@ -107,6 +107,8 @@ class NWordGrams * is available for $lang and then stored in filter file. * * @param string $lang locale to be used to stem n grams. + * @param string $num_gram value of n in n-gram (how many words in sequence + * should constitute a gram) * @param int $num_ngrams_found count of n word grams in text file. * @param int $max_gram_len value n of longest n gram to be added. * @return none @@ -181,13 +183,15 @@ class NWordGrams * the text file. * * @param string $wiki_file compressed or uncompressed wikipedia - * XML file path to be used to extract bigrams. This can also - * be a folder containing such files + * XML file path to be used to extract bigrams. This can also + * be a folder containing such files * @param string $lang Language to be used to create n grams. * @param string $locale Locale to be used to store results. * @param int $num_gram number of words in grams we are looking for * @param int $ngram_type where in Wiki Dump to extract grams from - * @return number $num_ngrams_found count of bigrams in text file. + * @param int $max_terms maximum number of n-grams to compute and put in + * file + * @return int $num_ngrams_found count of bigrams in text file. */ static function makeNWordGramsTextFile($wiki_file, $lang, $locale, $num_gram = 2, $ngram_type = self::PAGE_COUNT_WIKIPEDIA, diff --git a/lib/page_rule_parser.php b/lib/page_rule_parser.php index 8820b33fb..232afceb0 100644 --- a/lib/page_rule_parser.php +++ b/lib/page_rule_parser.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -44,31 +44,31 @@ require_once BASE_DIR."/lib/crawl_constants.php"; * and does a function call to manipulate that page. * These have the syntax: * addMetaWords(field) ;add the field and field value to the META_WORD - * ;array for the page + * ;array for the page * addKeywordLink(field) ;split the field on a comma, view this as a search - * ;keywords => link text association, and add this - * ;the KEYWORD_LINKS array. + * ;keywords => link text association, and add this + * ;the KEYWORD_LINKS array. * setStack(field) ;set which field value should be used as a stack * pushStack(field) ;add the field value for field to the top of stack * popStack(field) ;pop the top of the stack into the field value for - * ;field + * ;field * setOutputFolder(dir) ;if auxiliary output, rather than just to the - * ; a yioop index, is being done, then set the folder - * ; the folder for this output to be dir + * ; a yioop index, is being done, then set the folder + * ; the folder for this output to be dir * setOutputFormat(format) ;format of auxiliary output either CSV or SQL - * ;SQL mean that writeOutput will write an insert - * ;statement + * ;SQL mean that writeOutput will write an insert + * ;statement * setOutputTable(table) ;if output is SQL then what table to use for the - * ;insert statements + * ;insert statements * toArray(field) ;splits field value for field on a comma and - * ;assign field value to be the resulting array + * ;assign field value to be the resulting array * toString(field) ;if field value is an array then implode that - * ;array using comma and store the result in field - * ;value + * ;array using comma and store the result in field + * ;value * unset(field) ;unset that field value * writeOutput(field) ;use the contents of field value viewed as an array - * ;to fill in the columns of a SQL insert statement - * ;or CSV row + * ;to fill in the columns of a SQL insert statement + * ;or CSV row * * Assignments can either be straight assignments with '=' or concatenation * assignments with '.='. There are the following kinds of values that one @@ -77,10 +77,10 @@ require_once BASE_DIR."/lib/crawl_constants.php"; * field = some_other_field ; sets $page['field'] = $page['some_other_field'] * field = "some_string" ; sets $page['field'] to "some string" * field = /some_regex/replacement_where_dollar_vars_allowed/ - * ; computes the results of replacing matches to some_regex in - * ; $page['field'] with replacement_where_dollar_vars_allowed + * ; computes the results of replacing matches to some_regex in + * ; $page['field'] with replacement_where_dollar_vars_allowed * field = /some_regex/g ;sets $page['field'] to the array of all matches - * ; of some regex in $page['field'] + * ; of some regex in $page['field'] * * For each of the above assignments we could have used ".=" instead of "=" * @@ -129,7 +129,7 @@ class PageRuleParser implements CrawlConstants * Constructs a PageRuleParser using the supplied page_rules * * @param string $page_rules a sequence of lines with page rules - * as described in the class comments + * as described in the class comments */ function __construct($page_rules = "") { @@ -140,7 +140,7 @@ class PageRuleParser implements CrawlConstants * later * * @param string $page_rules a sequence of lines with page rules - * as described in the class comments + * as described in the class comments * @return array of parse trees which can be executed in sequence */ function parseRules($page_rules) @@ -203,10 +203,10 @@ class PageRuleParser implements CrawlConstants * Executes either the internal $rule_trees or the passed $rule_trees * on the provided $page_data associative array * - * @param array &$page_data an associative array of containing summary - * info of a web page/record (will be changed by this operation) - * @param array $rule_trees an array of annotated syntax trees to - * for rules used to update $page_data + * @param array& $page_data an associative array of containing summary + * info of a web page/record (will be changed by this operation) + * @param array $rule_trees an array of annotated syntax trees to + * for rules used to update $page_data */ function executeRuleTrees(&$page_data, $rule_trees = NULL) { @@ -222,11 +222,11 @@ class PageRuleParser implements CrawlConstants } } /** - * Used to execute a single command rule on $page_data + * Used to execute a single command rule on $page_data * - * @param array $tree annotated syntax tree of a function call rule - * @param array &$page_data an associative array of containing summary - * info of a web page/record (will be changed by this operation) + * @param array $tree annotated syntax tree of a function call rule + * @param array& $page_data an associative array of containing summary + * info of a web page/record (will be changed by this operation) */ function executeFunctionRule($tree, &$page_data) { @@ -249,11 +249,11 @@ class PageRuleParser implements CrawlConstants } } /** - * Used to execute a single assignment rule on $page_data + * Used to execute a single assignment rule on $page_data * - * @param array $tree annotated syntax tree of an assignment rule - * @param array &$page_data an associative array of containing summary - * info of a web page/record (will be changed by this operation) + * @param array $tree annotated syntax tree of an assignment rule + * @param array& $page_data an associative array of containing summary + * info of a web page/record (will be changed by this operation) */ function executeAssignmentRule($tree, &$page_data) { @@ -303,12 +303,12 @@ class PageRuleParser implements CrawlConstants return $var_name; } /** - * Adds a meta word u:$field:$page_data[$field_name] to the array - * of meta words for this page + * Adds a meta word u:$field:$page_data[$field_name] to the array + * of meta words for this page * - * @param $field the key in $page_data to use - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $field the key in $page_data to use + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function addMetaWord($field, &$page_data) { @@ -321,19 +321,19 @@ class PageRuleParser implements CrawlConstants $page_data[CrawlConstants::META_WORDS][] = $meta_word; } /** - * Adds a $keywords => $link_text pair to the KEYWORD_LINKS array fro - * this page based on the value $field on the page. The pair is extracted - * by splitting on comma. The KEYWORD_LINKS array can be used when - * a cached version of a page is displayed to show a list of links - * from the cached page in the header. These links correspond to search - * in Yioop. for example the value: - * madonna, rock star - * would add a link to the top of the cache page with text "rock star" - * which when clicked would perform a Yioop search on madonna. + * Adds a $keywords => $link_text pair to the KEYWORD_LINKS array fro + * this page based on the value $field on the page. The pair is extracted + * by splitting on comma. The KEYWORD_LINKS array can be used when + * a cached version of a page is displayed to show a list of links + * from the cached page in the header. These links correspond to search + * in Yioop. for example the value: + * madonna, rock star + * would add a link to the top of the cache page with text "rock star" + * which when clicked would perform a Yioop search on madonna. * - * @param $field the key in $page_data to use - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $field the key in $page_data to use + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function addKeywordLink($field, &$page_data) { @@ -348,11 +348,11 @@ class PageRuleParser implements CrawlConstants $page_data[CrawlConstants::KEYWORD_LINKS][$key_words] = $link_text; } /** - * Set field variable to be used as a stack + * Set field variable to be used as a stack * - * @param $field what field variable to use for current stack - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $field what field variable to use for current stack + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function setStack($field, &$page_data) { @@ -366,12 +366,12 @@ class PageRuleParser implements CrawlConstants } } /** - * Pushes an element or items in an array stored in field onto the current - * stack + * Pushes an element or items in an array stored in field onto the current + * stack * - * @param $field what field to get data to push onto fcurrent stack - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $field what field to get data to push onto fcurrent stack + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function pushStack($field, &$page_data) { @@ -389,12 +389,12 @@ class PageRuleParser implements CrawlConstants } } /** - * Pop an element or items in an array stored in field onto the current - * stack + * Pop an element or items in an array stored in field onto the current + * stack * - * @param $field what field to get data to push onto fcurrent stack - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $field what field to get data to push onto fcurrent stack + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function popStack($field, &$page_data) { @@ -405,23 +405,23 @@ class PageRuleParser implements CrawlConstants $page_data[$var_field] = array_pop($page_data[$this->stack]); } /** - * Set output folder + * Set output folder * - * @param $dir output directory in which to write data.txt files containing - * the contents of some fields after writeOutput commands - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $dir output directory in which to write data.txt files containing + * the contents of some fields after writeOutput commands + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function setOutputFolder($dir, &$page_data) { $this->output_folder = realpath(trim($dir)); } /** - * Set output format + * Set output format * - * @param $format can be either csv or sql - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $format can be either csv or sql + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function setOutputFormat($format, &$page_data) { @@ -430,25 +430,25 @@ class PageRuleParser implements CrawlConstants } } /** - * Set output table + * Set output table * - * @param $table table to use if output format is sql - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $table table to use if output format is sql + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function setOutputTable($table, &$page_data) { $this->output_table = $table; } /** - * If $page_data[$field] is a string, splits it into an array on comma, - * trims leading and trailing spaces from each item and stores the result - * back into $page_data[$field] + * If $page_data[$field] is a string, splits it into an array on comma, + * trims leading and trailing spaces from each item and stores the result + * back into $page_data[$field] * * - * @param $field the key in $page_data to use - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $field the key in $page_data to use + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function toArray($field, &$page_data) { @@ -462,12 +462,12 @@ class PageRuleParser implements CrawlConstants } } /** - * If $page_data[$field] is an array, implode it into a string on comma, - * and stores the result back into $page_data[$field] + * If $page_data[$field] is an array, implode it into a string on comma, + * and stores the result back into $page_data[$field] * - * @param $field the key in $page_data to use - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $field the key in $page_data to use + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function toString($field, &$page_data) { @@ -477,13 +477,13 @@ class PageRuleParser implements CrawlConstants } } /** - * Unsets the key $field (or the crawl constant it corresponds to) - * in $page_data. If it is a crawlconstant it doesn't unset it -- - * it just sets it to the empty string + * Unsets the key $field (or the crawl constant it corresponds to) + * in $page_data. If it is a crawlconstant it doesn't unset it -- + * it just sets it to the empty string * - * @param $field the key in $page_data to use - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $field the key in $page_data to use + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function unsetVariable($field, &$page_data) { @@ -495,12 +495,12 @@ class PageRuleParser implements CrawlConstants } } /** - * Write the value of a field to the output folder in the current - * format. If the field is not set nothing is written + * Write the value of a field to the output folder in the current + * format. If the field is not set nothing is written * - * @param $field the key in $page_data to use - * @param array &$page_data an associative array of containing summary - * info of a web page/record + * @param $field the key in $page_data to use + * @param array& $page_data an associative array of containing summary + * info of a web page/record */ function writeOutput($field, &$page_data) { diff --git a/lib/persistent_structure.php b/lib/persistent_structure.php index 9a7ffcbb8..4b58e6759 100755 --- a/lib/persistent_structure.php +++ b/lib/persistent_structure.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -46,20 +46,20 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class PersistentStructure { /** If not specified in the constructor, this will be the number of - * operations between saves - * @var int + * operations between saves + * @var int */ const DEFAULT_SAVE_FREQUENCY = 50000; /** Name of the file in which to store the PersistentStructure - * @var string + * @var string */ var $filename; /** Number of operations since the last save - * @var int + * @var int */ var $unsaved_operations; /** Number of operation between saves. If == -1 never save using checkSave - * @var int + * @var int */ var $save_frequency; @@ -68,9 +68,9 @@ class PersistentStructure * initializes the oepration count * * @param string $fname the name of the file to store the - * PersistentStructure in + * PersistentStructure in * @param int $save_frequency the number of operation before a save If - * <= 0 never check save + * <= 0 never check save */ function __construct($fname, $save_frequency = self::DEFAULT_SAVE_FREQUENCY) @@ -80,19 +80,20 @@ class PersistentStructure $this->unsaved_operations = 0; } /** - * Load a PersistentStructure from a file + * Load a PersistentStructure from a file * - * @param string the name of the file to load the PersistentStructure from - * @return object the PersistentStructure loaded + * @param string $fname the name of the file to load the + * PersistentStructure from + * @return object the PersistentStructure loaded */ static function load($fname) { return unserialize(file_get_contents($fname)); } /** - * Save the PersistentStructure to its filename - * This method is generic but super memory inefficient, so reimplement - * for subclasses is needed + * Save the PersistentStructure to its filename + * This method is generic but super memory inefficient, so reimplement + * for subclasses is needed */ function save() { diff --git a/lib/phrase_parser.php b/lib/phrase_parser.php index e3fabb0d6..3e7909a4b 100755 --- a/lib/phrase_parser.php +++ b/lib/phrase_parser.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -116,7 +116,7 @@ class PhraseParser * Converts a summary of a web page into a string of space separated words * * @param array $page associative array of page summary data. Contains - * title, description, and links fields + * title, description, and links fields * @return string the concatenated words extracted from the page summary */ static function extractWordStringPageSummary($page) @@ -145,9 +145,12 @@ class PhraseParser * * @param string $string subject to extract phrases from * @param string $lang locale tag for stemming - * @param string $index_name name of index to be used a s a reference - * when extracting phrases + * @param string $index_name name of index to be used as a reference + * when extracting phrases * @param bool $exact_match whether the match has to be exact or not + * @param int $threshold roughly causes a stop to extracting more phrases + * if exceed $threshold (still might get more than $threshold back, only + * when detect have more stop) * @return array of phrases */ static function extractPhrases($string, $lang = NULL, $index_name = NULL, @@ -244,7 +247,7 @@ class PhraseParser * @param string $string subject to extract phrases from * @param string $lang locale tag for stemming * @return array word => list of positions at which the word occurred in - * the document + * the document */ static function extractPhrasesInLists($string, $lang = NULL) { @@ -258,9 +261,10 @@ class PhraseParser * a format that does not involved punctuation that will be stripped * as we extract phrases. * - * @param &$string a string of words, etc which might involve such terms + * @param string& $string a string of words, etc which might involve such + * terms * @param $lang a language tag to use as part of the canonicalization - * process not used right now + * process not used right now */ static function canonicalizePunctuatedTerms(&$string, $lang = NULL) { @@ -319,7 +323,7 @@ class PhraseParser * @param string $string to extract terms from * @param string $lang IANA tag to look up stemmer under * @return array of terms and n word grams in the order they appeared in - * string + * string */ static function extractMaximalTermsAndFilterPhrases($string, $lang = NULL) @@ -349,7 +353,7 @@ class PhraseParser * * @param string $string what to extract terms from * @param string $lang locale tag to determine which stemmers, chargramming - * and segmentation needs to be done. + * and segmentation needs to be done. * * @return array the terms computed from the string */ @@ -689,7 +693,7 @@ class PhraseParser * * @param string $segment string to split into terms * @param string $lang IANA tag to look up segmenter under - * from some other language + * from some other language * @param array of terms found in the segments */ static function segmentSegment($segment, &$lang) @@ -778,8 +782,10 @@ class PhraseParser * index for (server:apache) even if the document itself did not contain * them. * - * @param array &$site associated array containing info about a downloaded - * (or read from archive) document. + * @param array& $site associated array containing info about a downloaded + * (or read from archive) document. + * @param array $video_sources used to check if a page should be marked as + * having meta media:video * @return array of meta words to be associate with this document */ static function calculateMetas(&$site, $video_sources = array()) @@ -971,11 +977,11 @@ class PhraseParser return $link_meta_ids; } /** - * Computes the Cosine-similarity of two phrases + * Computes the Cosine-similarity of two phrases * - * @param array $phrase1 first input phrase as array of terms - * @param array $phrase2 second input phrase as array of terms - * @return float Cosine-similarity of the phrases + * @param array $phrase1 first input phrase as array of terms + * @param array $phrase2 second input phrase as array of terms + * @return float Cosine-similarity of the phrases */ static function getCosineRank($phrase1, $phrase2) { @@ -1016,12 +1022,12 @@ class PhraseParser return $score; } /** - * Computes the ratio of the number of terms shared by two phrases - * divided by the average number of terms in a pair of phrases. + * Computes the ratio of the number of terms shared by two phrases + * divided by the average number of terms in a pair of phrases. * - * @param array $terms1 first input phrase as array of terms - * @param array $terms2 second input phrase as array of terms - * @return float the above described ratio + * @param array $terms1 first input phrase as array of terms + * @param array $terms2 second input phrase as array of terms + * @return float the above described ratio */ static function getIntersection($terms1, $terms2) { @@ -1041,9 +1047,9 @@ class PhraseParser * word. * * @param string $segment string to make into a string of space separated - * words + * words * @param string $locale IANA tag used to look up dictionary filter to - * use to do this segmenting + * use to do this segmenting * @return string space separated words */ static function reverseMaximalMatch($segment, $locale) @@ -1132,12 +1138,12 @@ class PhraseParser return $out_segment; } /** - * Scores documents according to the lack or nonlack of sexually explicit - * terms. Tries to work for several languages. Very crude classifier. + * Scores documents according to the lack or nonlack of sexually explicit + * terms. Tries to work for several languages. Very crude classifier. * - * @param array $word_lists word => pos_list tuples - * @param int $len length of text being examined in characters - * @return int $score of how explicit document is + * @param array $word_lists word => pos_list tuples + * @param int $len length of text being examined in characters + * @return int $score of how explicit document is */ static function computeSafeSearchScore(&$word_lists, $len) { diff --git a/lib/priority_queue.php b/lib/priority_queue.php index 82330453c..152ff5574 100755 --- a/lib/priority_queue.php +++ b/lib/priority_queue.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load in base class + * Load in base class */ require_once "string_array.php"; /** @@ -99,10 +99,10 @@ class PriorityQueue extends StringArray implements CrawlConstants * @param int $num_values number of values the queue can hold * @param int $value_size the size in a bytes of a value * @param string $min_or_max whether this priority queue return least or - * most weight values when polled + * most weight values when polled * @param object $notifier object to call when a value changes in the queue * @param int $save_frequency how often the data in the queue should be - * save to disk. (It's default location is RAM) + * save to disk. (It's default location is RAM) */ function __construct($fname, $num_values, $value_size, $min_or_max, $notifier = NULL, @@ -121,7 +121,7 @@ class PriorityQueue extends StringArray implements CrawlConstants * * @param int $i location to return data from * @return mixed array data if the value of $i is between 1 and count, false - * otherwise + * otherwise */ function peek($i = 1) { @@ -141,7 +141,7 @@ class PriorityQueue extends StringArray implements CrawlConstants * * @param int $i element to get out of the queue * @return mixed array data if the value of $i is between 1 and count, false - * otherwise + * otherwise */ function poll($i = 1) { @@ -163,7 +163,7 @@ class PriorityQueue extends StringArray implements CrawlConstants * @param string $data what to insert into the queue * @param float $weight how much the new data should be weighted * @return mixed index location in queue where item was stored if - * successful, otherwise false. + * successful, otherwise false. */ function insert($data, $weight) { @@ -239,7 +239,7 @@ class PriorityQueue extends StringArray implements CrawlConstants * gummed up because all of the weights stored in it are too small. * * @param int $new_total what the new sum of weights of elements in the - * queue will be after normalization + * queue will be after normalization */ function normalize($new_total = NUM_URLS_QUEUE_RAM) { @@ -345,7 +345,7 @@ class PriorityQueue extends StringArray implements CrawlConstants * * @param int $i element to get * @return array value stored in queue together with its weight as a two - * element array + * element array */ function getRow($i) { @@ -365,7 +365,7 @@ class PriorityQueue extends StringArray implements CrawlConstants * * @param int $i location to add data * @param array $row data to add (a two element array in the form - * key, float value). + * key, float value). */ function putRow($i, $row) { diff --git a/lib/processors/bmp_processor.php b/lib/processors/bmp_processor.php index 9f0b9a17d..68d224193 100644 --- a/lib/processors/bmp_processor.php +++ b/lib/processors/bmp_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -67,6 +67,11 @@ class BmpProcessor extends ImageProcessor const MAX_DIM = 1000; /** * {@inheritDoc} + * + * @param string $page the image represented as a character string + * @param string $url the url where the image was downloaded from + * @return array summary information including a thumbnail and a + * description (where the description is just the url) */ function process($page, $url) { diff --git a/lib/processors/doc_processor.php b/lib/processors/doc_processor.php index 40bb9a1a0..1800547b6 100755 --- a/lib/processors/doc_processor.php +++ b/lib/processors/doc_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -49,14 +49,14 @@ require_once BASE_DIR."/lib/processors/text_processor.php"; class DocProcessor extends TextProcessor { /** - * Used to extract the title, description and links from - * a string consisting of Word Doc data (2004 or earlier). + * Used to extract the title, description and links from + * a string consisting of Word Doc data (2004 or earlier). * - * @param string $page the web-page contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page the web-page contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array a summary of the contents of the page + * @return array a summary of the contents of the page * */ function process($page, $url) diff --git a/lib/processors/epub_processor.php b/lib/processors/epub_processor.php index 712daa928..1d7743008 100644 --- a/lib/processors/epub_processor.php +++ b/lib/processors/epub_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Vijeth Patil vijeth.patil@gmail.com * @package seek_quarry @@ -63,39 +63,39 @@ define('MAX_DOM_LEVEL', 15); class EpubProcessor extends TextProcessor { /** - * The name of the tag element in an xml document + * The name of the tag element in an xml document * - * @var string name + * @var string name */ var $name; /** - * The attribute of the tag element in an xml document + * The attribute of the tag element in an xml document * - * @var string attributes + * @var string attributes */ var $attributes; /** - * The content of the tag element or attribute, used to extract - * the fields like title, creator, language of the document + * The content of the tag element or attribute, used to extract + * the fields like title, creator, language of the document * - * @var string content + * @var string content */ var $content; /** - * The child tag element of a tag element. + * The child tag element of a tag element. * - * @var string children + * @var string children */ var $children; /** - * Used to extract the title, description and links from - * a string consisting of ebook publication data. + * Used to extract the title, description and links from + * a string consisting of ebook publication data. * - * @param string $page epub contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page epub contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array a summary of the contents of the page + * @return array a summary of the contents of the page * */ function process($page, $url) @@ -211,14 +211,14 @@ class EpubProcessor extends TextProcessor return $summary; } /** - * Used to extract the DOM tree containing the information - * about the epub file such as title, author, language, unique - * identifier of the book from a string consisting of ebook publication - * content OPF file. + * Used to extract the DOM tree containing the information + * about the epub file such as title, author, language, unique + * identifier of the book from a string consisting of ebook publication + * content OPF file. * - * @param string $page xml contents + * @param string $xml page contents * - * @return array an information about the contents of the page + * @return array an information about the contents of the page * */ function xmlToObject($xml) diff --git a/lib/processors/gif_processor.php b/lib/processors/gif_processor.php index 794120941..b26147e85 100755 --- a/lib/processors/gif_processor.php +++ b/lib/processors/gif_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -51,6 +51,11 @@ class GifProcessor extends ImageProcessor { /** * {@inheritDoc} + * + * @param string $page the image represented as a character string + * @param string $url the url where the image was downloaded from + * @return array summary information including a thumbnail and a + * description (where the description is just the url) */ function process($page, $url) { diff --git a/lib/processors/git_xml_processor.php b/lib/processors/git_xml_processor.php index c15542c92..aa335acbb 100755 --- a/lib/processors/git_xml_processor.php +++ b/lib/processors/git_xml_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Snigdha Rao Parvatneni * @package seek_quarry diff --git a/lib/processors/html_processor.php b/lib/processors/html_processor.php index 71528c162..a709bdf61 100755 --- a/lib/processors/html_processor.php +++ b/lib/processors/html_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -68,18 +68,18 @@ require_once BASE_DIR."/lib/locale_functions.php"; class HtmlProcessor extends TextProcessor { /** - * Maximum number of characters in a title + * Maximum number of characters in a title */ const MAX_TITLE_LEN = 100; /** - * Used to extract the title, description and links from - * a string consisting of webpage data. + * Used to extract the title, description and links from + * a string consisting of webpage data. * - * @param string $page web-page contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page web-page contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array a summary of the contents of the page + * @return array a summary of the contents of the page * */ function process($page, $url) @@ -151,9 +151,9 @@ class HtmlProcessor extends TextProcessor * Return a document object based on a string containing the contents of * a web page * - * @param string $page a web page + * @param string $page a web page * - * @return object document object + * @return object document object */ static function dom($page) { @@ -183,9 +183,9 @@ class HtmlProcessor extends TextProcessor * Get any NOINDEX, NOFOLLOW, NOARCHIVE, NONE, info out of any robot * meta tags. * - * @param object $dom - a document object to check the meta tags for + * @param object $dom - a document object to check the meta tags for * - * @return array of robot meta instructions + * @return array of robot meta instructions */ static function getMetaRobots($dom) { @@ -206,16 +206,16 @@ class HtmlProcessor extends TextProcessor return $found_metas; } /** - * Determines the language of the html document by looking at the root - * language attribute. If that fails $sample_text is used to try to guess - * the language + * Determines the language of the html document by looking at the root + * language attribute. If that fails $sample_text is used to try to guess + * the language * - * @param object $dom a document object to check the language of - * @param string $sample_text sample text to try guess the language from - * @param string $url url of web-page as a fallback look at the country - * to figure out language + * @param object $dom a document object to check the language of + * @param string $sample_text sample text to try guess the language from + * @param string $url url of web-page as a fallback look at the country + * to figure out language * - * @return string language tag for guessed language + * @return string language tag for guessed language */ static function lang($dom, $sample_text = NULL, $url = NULL) { @@ -249,10 +249,10 @@ class HtmlProcessor extends TextProcessor return $lang; } /** - * Returns title of a webpage based on its document object + * Returns title of a webpage based on its document object * - * @param object $dom a document object to extract a title from. - * @return string a title of the page + * @param object $dom a document object to extract a title from. + * @return string a title of the page * */ static function title($dom) @@ -279,11 +279,11 @@ class HtmlProcessor extends TextProcessor return $title; } /** - * Returns title of a webpage based on crude regex match, - * used as a fall back if dom parsing did not work. + * Returns title of a webpage based on crude regex match, + * used as a fall back if dom parsing did not work. * - * @param string $page to extract title from - * @return string a title of the page + * @param string $page to extract title from + * @return string a title of the page */ static function crudeTitle($page) { @@ -291,11 +291,11 @@ class HtmlProcessor extends TextProcessor return strip_tags("<title".$title[1]."</title>"); } /** - * Returns summary of body of a web page based on crude regex matching - * used as a fall back if dom parsing did not work. + * Returns summary of body of a web page based on crude regex matching + * used as a fall back if dom parsing did not work. * - * @param string $page to extract description from - * @return string a title of the page + * @param string $page to extract description from + * @return string a title of the page */ static function crudeDescription($page) { @@ -501,11 +501,11 @@ class HtmlProcessor extends TextProcessor return $sites; } /** - * This returns the text content of a node but with spaces - * where tags were (unlike just using textContent) + * This returns the text content of a node but with spaces + * where tags were (unlike just using textContent) * - * @param object $node a DOMNode - * @return string its text content with spaces + * @param object $node a DOMNode + * @return string its text content with spaces */ static function domNodeToString($node) { diff --git a/lib/processors/image_processor.php b/lib/processors/image_processor.php index a17ab6d78..4beee998c 100755 --- a/lib/processors/image_processor.php +++ b/lib/processors/image_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -47,15 +47,15 @@ class ImageProcessor extends PageProcessor { /** * Extract summary data from the image provided in $page together the url - * in $url where it was downloaded from + * in $url where it was downloaded from * * ImageProcessor class defers a proper implementation of this method to - * subclasses + * subclasses + * * @param string $page the image represented as a character string * @param string $url the url where the image was downloaded from - * * @return array summary information including a thumbnail and a - * description (where the description is just the url) + * description (where the description is just the url) */ function process($page, $url) { return NULL;} /** diff --git a/lib/processors/java_processor.php b/lib/processors/java_processor.php index 213122f13..68a6292a7 100755 --- a/lib/processors/java_processor.php +++ b/lib/processors/java_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Snigdha Rao Parvatneni * @package seek_quarry @@ -67,12 +67,12 @@ class JavaProcessor extends TextProcessor * * @param string $page text string of a document * @param string $url location the document came from, not used by - * JavaProcessor at this point. Some of its subclasses override - * this method and use url to produce complete links for - * relative links within a document + * JavaProcessor at this point. Some of its subclasses override + * this method and use url to produce complete links for + * relative links within a document * * @return array a summary of (title, description,links, and content) of - * the information in $page + * the information in $page */ function process($page, $url) { @@ -89,14 +89,14 @@ class JavaProcessor extends TextProcessor return $summary; } /** - * Tries to determine the language of the document by looking at the - * $sample_text and $url provided - * the language - * @param string $sample_text sample text to try guess the language from - * @param string $url url of web-page as a fallback look at the country - * to figure out language + * Tries to determine the language of the document by looking at the + * $sample_text and $url provided + * the language + * @param string $sample_text sample text to try guess the language from + * @param string $url url of web-page as a fallback look at the country + * to figure out language * - * @return string language tag for guessed language + * @return string language tag for guessed language */ static function calculateLang($sample_text = NULL, $url = NULL) { diff --git a/lib/processors/jpg_processor.php b/lib/processors/jpg_processor.php index 44506c8ff..0b0144109 100755 --- a/lib/processors/jpg_processor.php +++ b/lib/processors/jpg_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -54,6 +54,11 @@ class JpgProcessor extends ImageProcessor { /** * {@inheritDoc} + * + * @param string $page the image represented as a character string + * @param string $url the url where the image was downloaded from + * @return array summary information including a thumbnail and a + * description (where the description is just the url) */ function process($page, $url) { diff --git a/lib/processors/page_processor.php b/lib/processors/page_processor.php index aea86d398..bcc642de0 100644 --- a/lib/processors/page_processor.php +++ b/lib/processors/page_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -41,7 +41,7 @@ require_once BASE_DIR."/lib/crawl_constants.php"; * Base class common to all processors of web page data * * Subclasses PageProcessor stored in - * WORK_DIRECTORY/app/lib/processors + * WORK_DIRECTORY/app/lib/processors * will be detected by Yioop. So one can add code there to make it easier * to upgrade Yioop. I.e., your site specific code can stay in the work * directory and you merely need to replace the Yioop folder when upgrading. @@ -71,12 +71,16 @@ abstract class PageProcessor implements CrawlConstants */ static $max_description_len; /** - * Set-ups the any indexing plugins associated with this page - * processor + * Set-ups the any indexing plugins associated with this page + * processor * - * @param array $plugins an array of indexing plugins which might - * do further processing on the data handles by this page - * processor + * @param array $plugins an array of indexing plugins which might + * do further processing on the data handles by this page + * processor + * @param int $max_description_len maximal length of a page summary + * @param int $summarizer_option CRAWL_CONSTANT specifying what kind + * of summarizer to use self::BASIC_SUMMARIZER or + * self::CENTROID_SUMMARIZER */ function __construct($plugins = array(), $max_description_len = NULL, $summarizer_option = self::BASIC_SUMMARIZER) { @@ -89,18 +93,18 @@ abstract class PageProcessor implements CrawlConstants } } /** - * Method used to handle processing data for a web page. It makes - * a summary for the page (via the process() function which should - * be subclassed) as well as runs any plugins that are associated with - * the processors to create sub-documents + * Method used to handle processing data for a web page. It makes + * a summary for the page (via the process() function which should + * be subclassed) as well as runs any plugins that are associated with + * the processors to create sub-documents * * @param string $page string of a web document * @param string $url location the document came from * * @return array a summary of (title, description,links, and content) of - * the information in $page also has a subdocs array containing any - * subdocuments returned from a plugin. A subdocumenst might be - * things like recipes that appeared in a page or tweets, etc. + * the information in $page also has a subdocs array containing any + * subdocuments returned from a plugin. A subdocumenst might be + * things like recipes that appeared in a page or tweets, etc. */ function handle($page, $url) { @@ -139,7 +143,7 @@ abstract class PageProcessor implements CrawlConstants * @param string $url location the document came from * * @return array a summary of (title, description,links, and content) of - * the information in $page + * the information in $page */ abstract function process($page, $url); } diff --git a/lib/processors/pdf_processor.php b/lib/processors/pdf_processor.php index 213d94994..128f12c22 100755 --- a/lib/processors/pdf_processor.php +++ b/lib/processors/pdf_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -49,14 +49,14 @@ require_once BASE_DIR."/lib/processors/text_processor.php"; class PdfProcessor extends TextProcessor { /** - * Used to extract the title, description and links from - * a string consisting of PDF data. + * Used to extract the title, description and links from + * a string consisting of PDF data. * - * @param $page - a string consisting of web-page contents - * @param $url - the url where the page contents came from, - * used to canonicalize relative links + * @param $page a string consisting of web-page contents + * @param $url the url where the page contents came from, + * used to canonicalize relative links * - * @return a summary of the contents of the page + * @return a summary of the contents of the page * */ function process($page, $url) @@ -161,7 +161,7 @@ class PdfProcessor extends TextProcessor /** * Gets the object stream portion of the current PDF object * - * @param string $object_stream represents the contents of a PDF object + * @param string $object_string represents the contents of a PDF object * @return string the object stream for the object */ static function getObjectStream($object_string) @@ -214,7 +214,7 @@ class PdfProcessor extends TextProcessor * @param string $data source to extract character data from * @param int $cur_pos position to start in $data * @return array pair consisting of the final position in $data as well - * as extracted text + * as extracted text */ static function parseBrackets($data, $cur_pos) { @@ -250,7 +250,7 @@ class PdfProcessor extends TextProcessor * @param string $data source to extract character data from * @param int $cur_pos position to start in $data * @return array pair consisting of the final position in $data as well - * as extracted text + * as extracted text */ static function parseParentheses($data, $cur_pos) { diff --git a/lib/processors/png_processor.php b/lib/processors/png_processor.php index ef65e5122..e42cbc4e3 100755 --- a/lib/processors/png_processor.php +++ b/lib/processors/png_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -51,6 +51,11 @@ class PngProcessor extends ImageProcessor { /** * {@inheritDoc} + * + * @param string $page the image represented as a character string + * @param string $url the url where the image was downloaded from + * @return array summary information including a thumbnail and a + * description (where the description is just the url) */ function process($page, $url) { diff --git a/lib/processors/ppt_processor.php b/lib/processors/ppt_processor.php index 82e8e337d..9c0121da1 100755 --- a/lib/processors/ppt_processor.php +++ b/lib/processors/ppt_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -66,12 +66,12 @@ class PptProcessor extends TextProcessor * * @param string $page string of a Powerpoint document * @param string $url location the document came from, not used by - * TextProcessor at this point. Some of its subclasses override - * this method and use url to produce complete links for - * relative links within a document + * TextProcessor at this point. Some of its subclasses override + * this method and use url to produce complete links for + * relative links within a document * * @return array a summary of (title, description,links, and content) of - * the information in $page + * the information in $page */ function process($page, $url) { diff --git a/lib/processors/pptx_processor.php b/lib/processors/pptx_processor.php index d1b6d683d..b4f3b6e75 100644 --- a/lib/processors/pptx_processor.php +++ b/lib/processors/pptx_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Nakul Natu nakul.natu@gmail.com * @package seek_quarry @@ -59,14 +59,14 @@ require_once BASE_DIR."/lib/utility.php"; class PptxProcessor extends TextProcessor { /** - * Used to extract the title, description and links from - * a pptx file consisting of xml data. + * Used to extract the title, description and links from + * a pptx file consisting of xml data. * - * @param string $page pptx(zip) contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page pptx(zip) contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array a summary of the contents of the page + * @return array a summary of the contents of the page * */ function process($page, $url) @@ -167,9 +167,9 @@ class PptxProcessor extends TextProcessor * Return a document object based on a string containing the contents of * a web page * - * @param string $page xml document + * @param string $page xml document * - * @return object document object + * @return object document object */ static function dom($page) { @@ -178,10 +178,10 @@ class PptxProcessor extends TextProcessor return $dom; } /** - * Returns powerpoint head title of a pptx based on its document object + * Returns powerpoint head title of a pptx based on its document object * - * @param object $dom a document object to extract a title from. - * @return string a title of the page + * @param object $dom a document object to extract a title from. + * @return string a title of the page * */ static function title($dom) @@ -193,10 +193,10 @@ class PptxProcessor extends TextProcessor return $title; } /** - * Returns number of slides of pptx based on its document object + * Returns number of slides of pptx based on its document object * - * @param object $dom a document object to extract a title from. - * @return number number of slides + * @param object $dom a document object to extract a title from. + * @return number number of slides * */ static function slides($dom) @@ -208,12 +208,12 @@ class PptxProcessor extends TextProcessor return $number; } /** - * Determines the language of the xml document by looking at the - * language attribute of a tag. + * Determines the language of the xml document by looking at the + * language attribute of a tag. * - * @param object $dom a document object to check the language of + * @param object $dom a document object to check the language of * - * @return string language tag for guessed language + * @return string language tag for guessed language */ static function lang($dom) { diff --git a/lib/processors/python_processor.php b/lib/processors/python_processor.php index 29e941860..2d686dbe2 100755 --- a/lib/processors/python_processor.php +++ b/lib/processors/python_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Snigdha Rao Parvatneni * @package seek_quarry @@ -67,12 +67,12 @@ class PythonProcessor extends TextProcessor * * @param string $page text string of a document * @param string $url location the document came from, not used by - * PythonProcessor at this point. Some of its subclasses override - * this method and use url to produce complete links for - * relative links within a document + * PythonProcessor at this point. Some of its subclasses override + * this method and use url to produce complete links for + * relative links within a document * * @return array a summary of (title, description,links, and content) of - * the information in $page + * the information in $page */ function process($page, $url) { @@ -90,14 +90,14 @@ class PythonProcessor extends TextProcessor return $summary; } /** - * Tries to determine the language of the document by looking at the - * $sample_text and $url provided - * the language - * @param string $sample_text sample text to try guess the language from - * @param string $url url of web-page as a fallback look at the country - * to figure out language + * Tries to determine the language of the document by looking at the + * $sample_text and $url provided + * the language + * @param string $sample_text sample text to try guess the language from + * @param string $url url of web-page as a fallback look at the country + * to figure out language * - * @return string language tag for guessed language + * @return string language tag for guessed language */ static function calculateLang($sample_text = NULL, $url = NULL) { diff --git a/lib/processors/robot_processor.php b/lib/processors/robot_processor.php index aedc9a5c7..8d494a2d1 100644 --- a/lib/processors/robot_processor.php +++ b/lib/processors/robot_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -57,12 +57,12 @@ class RobotProcessor extends PageProcessor * * @param string $page text string of a document * @param string $url location the document came from, not used by - * TextProcessor at this point. Some of its subclasses override - * this method and use url to produce complete links for - * relative links within a document + * TextProcessor at this point. Some of its subclasses override + * this method and use url to produce complete links for + * relative links within a document * * @return array a summary of (title, description, links, and content) of - * the information in $page + * the information in $page */ function process($page, $url) { @@ -160,13 +160,18 @@ class RobotProcessor extends PageProcessor return $summary; } /** - * For robot paths - * foo - * is treated the same as - * /foo - * Path might contain urlencoded characters. These are all decoded - * except for %2F which corresponds to a / (this is as per - * http://www.robotstxt.org/norobots-rfc.txt) + * Converts a path in a robots.txt file into a standard form usable by + * Yioop + * For robot paths + * foo + * is treated the same as + * /foo + * Path might contain urlencoded characters. These are all decoded + * except for %2F which corresponds to a / (this is as per + * http://www.robotstxt.org/norobots-rfc.txt) + * + * @param string $path to convert + * @return string Yioop canonical path */ function makeCanonicalRobotPath($path) { diff --git a/lib/processors/rss_processor.php b/lib/processors/rss_processor.php index e5ea3acc4..173b8635a 100644 --- a/lib/processors/rss_processor.php +++ b/lib/processors/rss_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -54,14 +54,14 @@ require_once BASE_DIR."/lib/url_parser.php"; class RssProcessor extends TextProcessor { /** - * Used to extract the title, description and links from - * a string consisting of rss or atom news feed data. + * Used to extract the title, description and links from + * a string consisting of rss or atom news feed data. * - * @param string $page web-page contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page web-page contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array a summary of the contents of the page + * @return array a summary of the contents of the page * */ function process($page, $url) @@ -90,14 +90,14 @@ class RssProcessor extends TextProcessor return $summary; } /** - * Determines the language of the rss document by looking at the channel - * language tag + * Determines the language of the rss document by looking at the channel + * language tag * - * @param object $dom - a document object to check the language of - * @param string $sample_text sample text to try guess the language from - * @param string $url guess lang from url as fallback + * @param object $dom - a document object to check the language of + * @param string $sample_text sample text to try guess the language from + * @param string $url guess lang from url as fallback * - * @return string language tag for guessed language + * @return string language tag for guessed language */ static function lang($dom, $sample_text = NULL, $url = NULL) { @@ -115,9 +115,9 @@ class RssProcessor extends TextProcessor * Return a document object based on a string containing the contents of * an RSS page * - * @param string $page a web page + * @param string $page a web page * - * @return object document object + * @return object document object */ static function dom($page) { @@ -126,11 +126,11 @@ class RssProcessor extends TextProcessor return $dom; } /** - * Returns html head title of a webpage based on its document object + * Returns html head title of a webpage based on its document object * - * @param object $dom a document object to extract a title from. - * @param bool $atom if the feed is atom or rss - * @return string a title of the page + * @param object $dom a document object to extract a title from. + * @param bool $atom if the feed is atom or rss + * @return string a title of the page * */ static function title($dom, $atom = false) diff --git a/lib/processors/rtf_processor.php b/lib/processors/rtf_processor.php index 6934381c6..d129fc350 100755 --- a/lib/processors/rtf_processor.php +++ b/lib/processors/rtf_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -53,10 +53,10 @@ class RtfProcessor extends TextProcessor * * @param string $page rtf string of a document * @param string $url location the document came from, not used by - * RTFProcessor at this point. + * RTFProcessor at this point. * * @return array a summary of (title, description,links, and content) of - * the information in $page + * the information in $page */ function process($page, $url) { diff --git a/lib/processors/sitemap_processor.php b/lib/processors/sitemap_processor.php index b076da216..060c3e092 100644 --- a/lib/processors/sitemap_processor.php +++ b/lib/processors/sitemap_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -50,14 +50,14 @@ require_once BASE_DIR."/lib/url_parser.php"; class SitemapProcessor extends TextProcessor { /** - * Used to extract the title, description and links from - * a string consisting of rss news feed data. + * Used to extract the title, description and links from + * a string consisting of rss news feed data. * - * @param string $page web-page contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page web-page contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array a summary of the contents of the page + * @return array a summary of the contents of the page * */ function process($page, $url) @@ -87,9 +87,9 @@ class SitemapProcessor extends TextProcessor * Return a document object based on a string containing the contents of * an RSS page * - * @param string $page a web page + * @param string $page a web page * - * @return object document object + * @return object document object */ static function dom($page) { diff --git a/lib/processors/svg_processor.php b/lib/processors/svg_processor.php index e719ad4ea..23d713a66 100644 --- a/lib/processors/svg_processor.php +++ b/lib/processors/svg_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -65,15 +65,15 @@ class SvgProcessor extends TextProcessor { const MAX_THUMB_LEN = 5000; /** - * Used to extract the title, description and links from - * a string consisting of svg image. If the image is small - * enough, an attempt is made to generate a thumbnail + * Used to extract the title, description and links from + * a string consisting of svg image. If the image is small + * enough, an attempt is made to generate a thumbnail * - * @param string $page web-page contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page web-page contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array a summary of the contents of the page + * @return array a summary of the contents of the page * */ function process($page, $url) @@ -132,9 +132,9 @@ class SvgProcessor extends TextProcessor * Return a document object based on a string containing the contents of * an SVG page * - * @param string $page a web page + * @param string $page a web page * - * @return object document object + * @return object document object */ static function dom($page) { @@ -143,10 +143,10 @@ class SvgProcessor extends TextProcessor return $dom; } /** - * Returns html head title of a webpage based on its document object + * Returns html head title of a webpage based on its document object * - * @param object $dom a document object to extract a title from. - * @return string a title of the page + * @param object $dom a document object to extract a title from. + * @return string a title of the page * */ static function title($dom) diff --git a/lib/processors/text_processor.php b/lib/processors/text_processor.php index 690dd53da..be719b283 100755 --- a/lib/processors/text_processor.php +++ b/lib/processors/text_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -72,12 +72,12 @@ class TextProcessor extends PageProcessor * * @param string $page text string of a document * @param string $url location the document came from, not used by - * TextProcessor at this point. Some of its subclasses override - * this method and use url to produce complete links for - * relative links within a document + * TextProcessor at this point. Some of its subclasses override + * this method and use url to produce complete links for + * relative links within a document * * @return array a summary of (title, description,links, and content) of - * the information in $page + * the information in $page */ function process($page, $url) { @@ -104,14 +104,14 @@ class TextProcessor extends PageProcessor return $summary; } /** - * Tries to determine the language of the document by looking at the - * $sample_text and $url provided - * the language - * @param string $sample_text sample text to try guess the language from - * @param string $url url of web-page as a fallback look at the country - * to figure out language + * Tries to determine the language of the document by looking at the + * $sample_text and $url provided + * the language + * @param string $sample_text sample text to try guess the language from + * @param string $url url of web-page as a fallback look at the country + * to figure out language * - * @return string language tag for guessed language + * @return string language tag for guessed language */ static function calculateLang($sample_text = NULL, $url = NULL) { @@ -148,7 +148,7 @@ class TextProcessor extends PageProcessor * @param string $start_tag starting tag that we want to extract after * @param string $end_tag ending tag that we want to extract until * @return array pair consisting of when in the document we are after - * the end tag, together with the data between the two tags + * the end tag, together with the data between the two tags */ static function getBetweenTags($string, $cur_pos, $start_tag, $end_tag) { @@ -173,7 +173,7 @@ class TextProcessor extends PageProcessor * * @param string $page text string of a document * @return array a set of http or https links that were extracted from - * the document + * the document */ static function extractHttpHttpsUrls($page) { @@ -196,7 +196,7 @@ class TextProcessor extends PageProcessor * If an end of file is reached before closed tags are seen, this methods * closes these tags in the correct order. * - * @param string &$page a reference to an xml or html document + * @param string& $page a reference to an xml or html document */ static function closeDanglingTags(&$page) { diff --git a/lib/processors/xlsx_processor.php b/lib/processors/xlsx_processor.php index 5aae0d1b1..a2e4dd069 100644 --- a/lib/processors/xlsx_processor.php +++ b/lib/processors/xlsx_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Tarun Ramaswamy tarun.pepira@gmail.com * @package seek_quarry @@ -56,14 +56,14 @@ require_once BASE_DIR."/lib/url_parser.php"; class XlsxProcessor extends TextProcessor { /** - * Used to extract the title, description and links from - * a xlsx file. + * Used to extract the title, description and links from + * a xlsx file. * - * @param string $page contents of xlsx file in zip format - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page contents of xlsx file in zip format + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array a summary of the contents of the page + * @return array a summary of the contents of the page * */ function process($page, $url) @@ -127,9 +127,9 @@ class XlsxProcessor extends TextProcessor * Return a document object based on a string containing the contents of * a xml file * - * @param string $page xml document + * @param string $page xml document * - * @return object document object + * @return object document object */ static function dom($page) { @@ -140,10 +140,10 @@ class XlsxProcessor extends TextProcessor return $dom; } /** - * Returns title of a xlsx file from each worksheet + * Returns title of a xlsx file from each worksheet * - * @param object $dom a document object to extract a title from. - * @return string a title of the xlsx file + * @param object $dom a document object to extract a title from. + * @return string a title of the xlsx file * */ static function title($dom) @@ -157,10 +157,10 @@ class XlsxProcessor extends TextProcessor return $title; } /** - * Returns the count of worksheets in the xlsx file + * Returns the count of worksheets in the xlsx file * - * @param object $dom a document object to extract a title from. - * @return integer number of worksheets in the xlsx file + * @param object $dom a document object to extract a title from. + * @return integer number of worksheets in the xlsx file * */ static function sheetCount($dom) diff --git a/lib/processors/xml_processor.php b/lib/processors/xml_processor.php index a7e43abf1..3be9d6861 100644 --- a/lib/processors/xml_processor.php +++ b/lib/processors/xml_processor.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -62,14 +62,14 @@ require_once BASE_DIR."/lib/url_parser.php"; class XmlProcessor extends TextProcessor { /** - * Used to extract the title, description and links from - * a string consisting of rss news feed data. + * Used to extract the title, description and links from + * a string consisting of rss news feed data. * - * @param string $page web-page contents - * @param string $url the url where the page contents came from, - * used to canonicalize relative links + * @param string $page web-page contents + * @param string $url the url where the page contents came from, + * used to canonicalize relative links * - * @return array a summary of the contents of the page + * @return array a summary of the contents of the page * */ function process($page, $url) @@ -100,9 +100,9 @@ class XmlProcessor extends TextProcessor * Return a document object based on a string containing the contents of * an XML page * - * @param string $page a web page + * @param string $page a web page * - * @return object document object + * @return object document object */ static function dom($page) { diff --git a/lib/string_array.php b/lib/string_array.php index f1a1ef3de..8603b21e5 100755 --- a/lib/string_array.php +++ b/lib/string_array.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -82,7 +82,7 @@ class StringArray extends PersistentStructure * @param int $num_values the number of items the StringArray will store * @param int $data_size the size in bytes of a single item * @param int $save_frequency how often the StringArray should be stored to - * disk + * disk */ function __construct($fname, $num_values, $data_size, $save_frequency = self::DEFAULT_SAVE_FREQUENCY) @@ -94,10 +94,10 @@ class StringArray extends PersistentStructure parent::__construct($fname, $save_frequency); } /** - * Load a StringArray from a file + * Load a StringArray from a file * - * @param string the name of the file to load the StringArray from - * @return object the PersistentStructure loaded + * @param string $fname the name of the file to load the StringArray from + * @return object the PersistentStructure loaded */ static function load($fname) { @@ -111,7 +111,7 @@ class StringArray extends PersistentStructure return $object; } /** - * Save the StringArray to its filename + * Save the StringArray to its filename */ function save() { @@ -125,10 +125,10 @@ class StringArray extends PersistentStructure fclose($fh); } /** - * Looks up the ith item in the StringArray + * Looks up the ith item in the StringArray * - * @param int $i array index of item to look up - * @return string the looked-up item of length $this->data_size + * @param int $i array index of item to look up + * @return string the looked-up item of length $this->data_size */ function get($i) { @@ -140,7 +140,7 @@ class StringArray extends PersistentStructure * * @param int $i array index of where to store data * @param string $data at least $this->data_size many bytes of data to - * store + * store */ function put($i, $data) { diff --git a/lib/suffix_tree.php b/lib/suffix_tree.php index b1c1fd20c..a261052c3 100644 --- a/lib/suffix_tree.php +++ b/lib/suffix_tree.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -114,7 +114,7 @@ class SuffixTree */ var $tree; /** - * Upper bound on the length of any path in the tree + * Upper bound on the length of any path in the tree */ const INFTY = 2000000000; /** @@ -129,9 +129,9 @@ class SuffixTree $this->buildTree(); } /** - * Builds the complete suffix tree for the text currently stored in - * $this->text. If you change this text and call this method again, - * it build a new tree based on the new text. Uses Ukkonen + * Builds the complete suffix tree for the text currently stored in + * $this->text. If you change this text and call this method again, + * it build a new tree based on the new text. Uses Ukkonen */ function buildTree() { @@ -159,6 +159,8 @@ class SuffixTree * purposes of building the suffix tree, and "next" is an array of * next children in the tree. * + * @param int $start what to use as the start value mentioned above + * @param int $end what to use as the start value mentioned above */ function makeNode($start, $end = self::INFTY) { @@ -174,7 +176,7 @@ class SuffixTree * The number of elements out of $this->text that this node is currently * responsible for * - * @param array &$node the node to compute the length of + * @param array& $node the node to compute the length of */ function edgeLength(&$node) { @@ -189,9 +191,9 @@ class SuffixTree * $this->need_sym_link node's "sym_link" field to $index which is supposed * be the index of the second created node. * - * @param int $index the index of the a created node in a given step. - * ($this->need_sym_link will be greater than 0 if it is the second - * created node of the step) + * @param int $index the index of the a created node in a given step. + * ($this->need_sym_link will be greater than 0 if it is the second + * created node of the step) */ function addSuffixLink($index) { @@ -203,9 +205,9 @@ class SuffixTree /** * Used to set the active point to the node given by $index * - * @param int $index which node to use for setting - * @return if the current active edge is longer than $index's edge length - * then don't update and return false; otherwise, return true + * @param int $index which node to use for setting + * @return if the current active edge is longer than $index's edge length + * then don't update and return false; otherwise, return true */ function walkDown($index) { @@ -285,9 +287,9 @@ class SuffixTree * @param int $index a node in the suffix tree * @param string $path from root to current node * @param int $len number of nodes from root to current node in suffix tree - * @param array &$maximal assoc array of phrase => (cond_max => pos of - * conditional maximal subphrase, [0] => pos_1st_occurrence of phrase, - * [1]=>pos_2nd_occurrence of phrase, etc) + * @param array& $maximal assoc array of phrase => (cond_max => pos of + * conditional maximal subphrase, [0] => pos_1st_occurrence of phrase, + * [1]=>pos_2nd_occurrence of phrase, etc) */ function outputMaximal($index, $path, $len, &$maximal) { diff --git a/lib/thesaurus.php b/lib/thesaurus.php index 121733c11..4ea2b6084 100644 --- a/lib/thesaurus.php +++ b/lib/thesaurus.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Shailesh Padave shaileshpadave49@gmail.com * @package seek_quarry @@ -49,34 +49,34 @@ require_once BASE_DIR."/lib/phrase_parser.php"; * PhraseModel and used to reorder the results. * To add thesaurus reordering for a different locale, two methods need to be * written in that locale tokenizer.php file - * tagPartsOfSpeechPhrase($phrase) which on an input phrase return a string - * where each term_i in the phrase has been replace with term_i~pos - * where pos is a two character part of speech NN, VB, AJ, AV, or NA (if - * none of the previous apply) - * scoredThesaurusMatches($term, $word_type, $whole_query) which takes - * a term from an original whole_query which has been tagged to be - * one of the types VB (for verb), NN (for noun), AJ (for adjective), - * AV (for adverb), or NA (for anything else), it outputs - * a sequence of (score => array of thesaurus terms) associations. - * The score representing one word sense of term + * tagPartsOfSpeechPhrase($phrase) which on an input phrase return a string + * where each term_i in the phrase has been replace with term_i~pos + * where pos is a two character part of speech NN, VB, AJ, AV, or NA (if + * none of the previous apply) + * scoredThesaurusMatches($term, $word_type, $whole_query) which takes + * a term from an original whole_query which has been tagged to be + * one of the types VB (for verb), NN (for noun), AJ (for adjective), + * AV (for adverb), or NA (for anything else), it outputs + * a sequence of (score => array of thesaurus terms) associations. + * The score representing one word sense of term * Given that these methods have been implemented if the use_thesaurus field * of that language tokenizer is set to true, the thesaurus will be used. */ class Thesaurus { /** - * Extracts similar phrases to the input query using thesaurus results. - * Part of speech tagging is processed on input and the output is - * looked up in the thesaurus. USing this a ranked list of alternate - * query phrases is created. - * For those phrases, counts in the Yioop index are calculated - * and the top two phrases are selected. - * @param string $orig_query input query from user - * @param string $index_name selected index for search engine - * @param string $lang locale tag for the query - * @param integer $threshold once count in posting list for any word - * reaches to threshold then return the number - * @return array of top two words + * Extracts similar phrases to the input query using thesaurus results. + * Part of speech tagging is processed on input and the output is + * looked up in the thesaurus. USing this a ranked list of alternate + * query phrases is created. + * For those phrases, counts in the Yioop index are calculated + * and the top two phrases are selected. + * @param string $orig_query input query from user + * @param string $index_name selected index for search engine + * @param string $lang locale tag for the query + * @param integer $threshold once count in posting list for any word + * reaches to threshold then return the number + * @return array of top two words */ static function getSimilarPhrases($orig_query, $index_name, $lang, $threshold = 10) @@ -105,9 +105,9 @@ class Thesaurus * and thesaurus generated queries * @param array $similar_phrases an array of thesaurus generated queries * @param array $summaries an array of summaries which is generated - * during crawl time. + * during crawl time. * @return array of BM25 score for each document based on the thesaurus - * simimar phrases + * simimar phrases */ static function scorePhrasesSummaries($similar_phrases, $summaries) { @@ -146,13 +146,13 @@ class Thesaurus } } /** - * Computes suggested related phrases from thesaurus based on part of - * speech done on each query term. + * Computes suggested related phrases from thesaurus based on part of + * speech done on each query term. * - * @param string $query query entered by user - * @param string $lang locale tag for the query - * @return string array $suggestion consisting of phrases suggested to - * be similar in meaning to some sens of the query + * @param string $query query entered by user + * @param string $lang locale tag for the query + * @return string array $suggestion consisting of phrases suggested to + * be similar in meaning to some sens of the query */ static function getInitialSuggestions($query, $lang) { @@ -204,15 +204,15 @@ class Thesaurus return $suggestions; } /** - * Returns the number of documents in an index that a phrase occurs in. - * If it occurs in more than threshold documents then cut off search. + * Returns the number of documents in an index that a phrase occurs in. + * If it occurs in more than threshold documents then cut off search. * - * @param string $phrase to look up in index - * @param int $threshold once count in posting list for any word - * reaches to threshold then return the number - * @param string $index_name selected index for search engine - * @param string $lang locale tag for the query - * @return int number of documents phrase occurs in + * @param string $phrase to look up in index + * @param int $threshold once count in posting list for any word + * reaches to threshold then return the number + * @param string $index_name selected index for search engine + * @param string $lang locale tag for the query + * @return int number of documents phrase occurs in */ static function numDocsIndex($phrase, $threshold, $index_name, $lang) { @@ -232,7 +232,7 @@ class Thesaurus /** * Lower cases an array of strings * - * @param array $summary strings to put into lower case + * @param array $summaries strings to put into lower case * @return array with strings converted to lower case */ static function changeCaseOfStringArray($summaries) @@ -273,8 +273,8 @@ class Thesaurus * @param array $summaries list of summary strings to compute BM25TF w.r.t * @param array $terms we want the term frequency computation for * @return array $tfbm25 a 2d array with rows being indexed by terms and - * columns indexed by summaries and the values of an entry being - * the tfbm25 score for that term in that document + * columns indexed by summaries and the values of an entry being + * the tfbm25 score for that term in that document */ static function calculateTFBM25($summaries, $terms) { @@ -303,11 +303,11 @@ class Thesaurus return $tfbm25; } /** - * Computes a 2D array of the number of occurences of term i in document j + * Computes a 2D array of the number of occurences of term i in document j * - * @param array $summaries documents to compute frequencies in - * @param array $terms terms to compute frequencies for - * @return array 2D array as described above + * @param array $summaries documents to compute frequencies in + * @param array $terms terms to compute frequencies for + * @return array 2D array as described above */ static function calculateTermFreq($summaries, $terms) { @@ -323,14 +323,14 @@ class Thesaurus return $tf_values; } /** - * To get the inverse document frequencies for a collection of terms in - * a set of documents. - * IDF(term_i) = log_10(# of document / # docs term i in) + * To get the inverse document frequencies for a collection of terms in + * a set of documents. + * IDF(term_i) = log_10(# of document / # docs term i in) * * @param array $summaries documents to use in calculating IDF score * @param array $terms terms to compute IDF score for * @return array $idf 1D-array saying the inverse document frequency for - * each term + * each term */ static function calculateIDF($summaries, $terms) { diff --git a/lib/trie.php b/lib/trie.php index c902c6ea8..fe7c492ef 100644 --- a/lib/trie.php +++ b/lib/trie.php @@ -1,29 +1,29 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sandhya Vissapragada, Chris Pollett (separated out this - * code into a separate file and cleaned up) + * code into a separate file and cleaned up) * @package seek_quarry * @license http://www.gnu.org/licenses/ GPL3 * @link http://www.seekquarry.com/ @@ -35,7 +35,7 @@ * from a dictionary in a succinct way * * @author Sandhya Vissapragada, Chris Pollett (rewrite + - * documentation, multi-byte support) + * documentation, multi-byte support) * * @package seek_quarry * @subpackage library @@ -131,6 +131,7 @@ class Trie * Returns all the terms in the trie beneath the provided term prefix * * @param string $prefix of term to look up + * @param int $max_results maximum number of strings to return * @return array $terms under $prefix */ function getValues($prefix, $max_results) @@ -145,7 +146,7 @@ class Trie * and returns the array of the result. * * @param array $trie_array a nested array representing a trie to look - * up suffixes in + * up suffixes in * @param string $prefix to prepend to each found suffix * @param int $max_results maximum number of strings to return * @param int $count which suffix in trie_array to start with diff --git a/lib/unit_test.php b/lib/unit_test.php index c4899b399..9147cee9e 100644 --- a/lib/unit_test.php +++ b/lib/unit_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/lib/upgrade_functions.php b/lib/upgrade_functions.php index fe2ac3a95..85951003b 100644 --- a/lib/upgrade_functions.php +++ b/lib/upgrade_functions.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * This file contains global functions connected to upgrading the database * and locales between different versions of Yioop! @@ -780,12 +780,13 @@ function upgradeDatabaseVersion20(&$db) * Inserting at an ID rather than at the end is useful since activities are * displayed in admin panel in order of increasing id. * - * @param resource &db database handle where Yioop database stored + * @param resource& $db database handle where Yioop database stored * @param string $string_id message identifier to give translations for - * for activity - * @param string admin_controller method to be called to perform this activity + * for activity + * @param string $method_name admin_controller method to be called to perform + * this activity * @param int $activity_id the id location at which to create this activity - * activity at and below this location will be shifted down by 1. + * activity at and below this location will be shifted down by 1. */ function addActivityAtId(&$db, $string_id, $method_name, $activity_id) { @@ -823,11 +824,11 @@ function addActivityAtId(&$db, $string_id, $method_name, $activity_id) * Adds or replaces a translation for a database message string for a given * IANA locale tag. * - * @param resource &db database handle where Yioop database stored + * @param resource& $db database handle where Yioop database stored * @param string $string_id message identifier to give translation for * @param string $locale_tag the IANA language tag to update the strings of * @param string $translation the translation for $string_id in the language - * $locale_tag + * $locale_tag */ function updateTranslationForStringId(&$db, $string_id, $locale_tag, $translation) diff --git a/lib/url_parser.php b/lib/url_parser.php index a0236ac7c..3445f6a5d 100755 --- a/lib/url_parser.php +++ b/lib/url_parser.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -47,7 +47,7 @@ class UrlParser * * @param string $url the url to check * @return bool returns true if it is either http or https and false - * otherwise + * otherwise */ static function isSchemeHttpOrHttps($url) { @@ -102,6 +102,8 @@ class UrlParser } /** * Get the port number of a url if present; if not return 80 + * + * @param string $url the url to extract port number from * @return int a port number */ static function getPort($url) @@ -114,6 +116,8 @@ class UrlParser } /** * Get the scheme of a url if present; if not return http + * + * @param string $url the url to extract scheme from * @return int a port number */ static function getScheme($url) @@ -125,10 +129,10 @@ class UrlParser return "http"; } /** - * Attempts to guess the language tag based on url + * Attempts to guess the language tag based on url * - * @param string $url the url to parse - * @return the top level domain if present; false otherwise + * @param string $url the url to parse + * @return the top level domain if present; false otherwise */ static function getLang($url) { @@ -229,7 +233,8 @@ class UrlParser * Get the host name portion of a url if present; if not return false * * @param string $url the url to parse - * @param bool $with_login whether to include user,password,port if present + * @param bool $with_login_and_port whether to include user,password,port + * if present * @return the host portion of the url if present; false otherwise */ static function getHost($url, $with_login_and_port = true) @@ -263,12 +268,12 @@ class UrlParser return $host_url; } /** - * Get the path portion of a url if present; if not return NULL + * Get the path portion of a url if present; if not return NULL * - * @param string $url the url to parse - * @param bool $with_query_string (whether to also include the query - * string at the end of the path) - * @return the host portion of the url if present; NULL otherwise + * @param string $url the url to parse + * @param bool $with_query_string (whether to also include the query + * string at the end of the path) + * @return the host portion of the url if present; NULL otherwise */ static function getPath($url, $with_query_string = false) { @@ -295,9 +300,9 @@ class UrlParser * * @param string $url initial url to get host and path of * @param bool $with_login_and_port controls whether the host should - * should contain login and port info + * should contain login and port info * @param bool $with_query_string says whether the path should contain - * the query string as well + * the query string as well * @return array host and the path as a pair */ static function getHostAndPath($url, $with_login_and_port = true, @@ -613,7 +618,7 @@ class UrlParser * @param string $link a relative or complete url * @param string $site a base url * @param string $no_fragment if false then if the url had a fragment - * (#link_within_page) then the fragement will be included + * (#link_within_page) then the fragement will be included * * @return string a complete url based on these two pieces of information * @@ -699,7 +704,7 @@ class UrlParser * Checks if a url has a repeated set of subdirectories, and if the number * of repeats occurs more than some threshold number of times * - * A pattern like bob/.../bob counts as own reptition. + * A pattern like bob/.../bob counts as own reptition. * bob/.../alice/.../bob/.../alice would count as two (... should be read * as ellipsis, not a directory name).If the threshold is three and there * are at least three repeated mathes this function return true; it returns @@ -707,9 +712,9 @@ class UrlParser * * @param string $url the url to check * @param int $repeat_threshold the number of repeats of a subdir name to - * trigger a true response + * trigger a true response * @return bool whether a repeated subdirectory name with more matches than - * the threshold was found + * the threshold was found * */ static function checkRecursiveUrl($url, $repeat_threshold = 3) @@ -762,9 +767,9 @@ class UrlParser * @param string $url url to check * @param array $site_array sites to check against * @param string $name identifier to store $site_array with in this - * function's cache - * @param bool whether when a match is found to return true or to - * return the matching site rule + * function's cache + * @param bool $return_rule whether when a match is found to return true or + * to return the matching site rule * @return mixed whether the url belongs to one of the sites */ static function urlMemberSiteArray($url, $site_array, @@ -831,7 +836,7 @@ class UrlParser * @param string $url the url to check * @param array $video_prefixes an array of prefixes of video sites * @return bool whether or not corresponds to video playback page of a known - * video site + * video site */ static function isVideoUrl(&$url, $video_prefixes) { @@ -850,13 +855,13 @@ class UrlParser return false; } /** - * Used to delete links from array of links $links based on whether - * they are the same as the site they came from (or otherwise judged - * irrelevant) + * Used to delete links from array of links $links based on whether + * they are the same as the site they came from (or otherwise judged + * irrelevant) * - * @param array $links pairs of the form $link =>$text - * @param string $parent_url a site that the links were found on - * @return array just those links which pass the relevancy test + * @param array $links pairs of the form $link =>$text + * @param string $parent_url a site that the links were found on + * @return array just those links which pass the relevancy test */ static function cleanRedundantLinks($links, $parent_url) { @@ -870,14 +875,14 @@ class UrlParser return $out_links; } /** - * Prunes a list of url => text pairs down to max_link many pairs - * by choosing those whose text has the most information. Information - * crudely measured by the length of the gzipped version of the text. - * - * @param array $links list of pairs $url=>$text - * @param int $max_links maximum number of links from $links to return - * @return array $out_links extracted from $links accodring to the - * description above. + * Prunes a list of url => text pairs down to max_link many pairs + * by choosing those whose text has the most information. Information + * crudely measured by the length of the gzipped version of the text. + * + * @param array $links list of pairs $url=>$text + * @param int $max_links maximum number of links from $links to return + * @return array $out_links extracted from $links accodring to the + * description above. */ static function pruneLinks($links, $max_links = MAX_LINKS_PER_PAGE) { @@ -902,10 +907,10 @@ class UrlParser return $out_links; } /** - * Guess mime type based on extension of the file in Git object + * Guess mime type based on extension of the file in Git object * - * @param string $file_name name of the file - * @return string $mime_type for the given file name + * @param string $file_name name of the file + * @return string $mime_type for the given file name */ static function guessMimeTypeFromFileName($file_name) { diff --git a/lib/utility.php b/lib/utility.php index c43cc7990..d3ab5b7b2 100755 --- a/lib/utility.php +++ b/lib/utility.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * A library of string, error reporting, log, hash, time, and conversion * functions @@ -43,7 +43,7 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} * @param string $errfile the filename the error occurred in * @param int $errline the line number of the error * @param array $errcontext the context (variables and their values) - * at the point the error occurred + * at the point the error occurred */ function yioop_error_handler($errno, $errstr, $errfile, $errline, $errcontext) @@ -155,7 +155,7 @@ function parse_ini_with_fallback($file) * what kind of assignment occurred in the ini file being parsed. * * @param string $matches produced by a preg_match in - * parse_ini_with_fallback + * parse_ini_with_fallback * @return mixed value of ini file assignment */ function getIniAssignMatch($matches) @@ -180,11 +180,11 @@ function getIniAssignMatch($matches) * bytes to destination string * * @param string $source string to copy from - * @param string &$destination string to copy to + * @param string& $destination string to copy to * @param int $start starting offset * @param int $length number of bytes to copy * @param string $timeout_msg for long copys message to print if taking more - * than 30 seconds + * than 30 seconds */ function charCopy($source, &$destination, $start, $length, $timeout_msg = "") { @@ -207,10 +207,10 @@ function charCopy($source, &$destination, $start, $length, $timeout_msg = "") } } /** - * Encodes an integer using variable byte coding. + * Encodes an integer using variable byte coding. * - * @param int $pos_int integer to encode - * @return string a string of 1-5 chars depending on how bit $pos_int was + * @param int $pos_int integer to encode + * @return string a string of 1-5 chars depending on how bit $pos_int was */ function vByteEncode($pos_int) { @@ -223,11 +223,11 @@ function vByteEncode($pos_int) return $result; } /** - * Decodes from a string using variable byte coding an integer. + * Decodes from a string using variable byte coding an integer. * - * @param string &$str string to use for decoding - * @param int $offset byte offset into string when var int stored - * @return int the decoded integer + * @param string& $str string to use for decoding + * @param int $offset byte offset into string when var int stored + * @return int the decoded integer */ function vByteDecode(&$str, &$offset) { @@ -245,12 +245,12 @@ function vByteDecode(&$str, &$offset) * occurrences of a word in the document with that docindex. * * @param int $doc_index index (i.e., a count of which document it - * is rather than a byte offset) of a document in the document string - * @param array integer positions word occurred in that doc + * is rather than a byte offset) of a document in the document string + * @param array $position_list integer positions word occurred in that doc * @param bool $delta if true then stores the position_list as a sequence of - * differences (a delta list) + * differences (a delta list) * @return string a modified9 (our compression scheme) packed - * string containing this info. + * string containing this info. */ function packPosting($doc_index, $position_list, $delta = true) { @@ -278,14 +278,14 @@ function packPosting($doc_index, $position_list, $delta = true) * to computer a number of occurences of a word in that document. * * @param string $posting a string containing - * a doc index position list pair coded encoded using modified9 - * @param int &offset a offset into the string where the modified9 posting - * is encoded + * a doc index position list pair coded encoded using modified9 + * @param int& $offset a offset into the string where the modified9 posting + * is encoded * @param bool $dedelta if true then assumes the list is a sequence of - * differences (a delta list) and undoes the difference to get - * the original sequence + * differences (a delta list) and undoes the difference to get + * the original sequence * @return array consisting of integer doc_index and a subarray consisting - * of integer positions of word in doc. + * of integer positions of word in doc. */ function unpackPosting($posting, &$offset, $dedelta = true) { @@ -313,11 +313,11 @@ function unpackPosting($posting, &$offset, $dedelta = true) * Given a string of postings adds $add_offset add to each offset to the * document map in each posting. * - * @param string &$postings a string of index shard postings + * @param string& $postings a string of index shard postings * @param int $add_offset an fixed amount to add to each postings doc map offset * * @return string $new_postings where each doc offset has had $add_offset added - * to it + * to it */ function addDocIndexPostings(&$postings, $add_offset) { @@ -358,7 +358,7 @@ function addDocIndexPostings(&$postings, $add_offset) * * @param array $list a nondecreasing list of integers * @return array the corresponding list of differences of adjacent - * integers + * integers */ function deltaList($list) { @@ -451,7 +451,7 @@ function encodeModified9($list) * * @param int $continue_bits the high order 2 bits of the word * @param int $cnt the number of element that will be packed in this word - * @param array $list a list of positive integers to pack into word + * @param array $pack_list a list of positive integers to pack into word * @return string encoded 4 byte string * @see encodeModified9 */ @@ -475,8 +475,8 @@ function packListModified9($continue_bits, $cnt, $pack_list) * Returns the next complete posting string from $input_string being at offset. * Does not do any decoding. * - * @param string &$input_string a string of postings - * @param int &offset an offset to this string which will be updated after call + * @param string& $input_string a string of postings + * @param int& $offset an offset to this string which will be updated after call * @return string undecoded posting */ function nextPostString(&$input_string, &$offset) @@ -510,9 +510,9 @@ function nextPostString(&$input_string, &$offset) * Decoded a sequence of positive integers from a string that has been * encoded using Modified 9 * - * @param string $int_string string to decode from - * @param int &$offset where to string in the string, after decode - * points to where one was after decoding. + * @param string $input_string string to decode from + * @param int& $offset where to string in the string, after decode + * points to where one was after decoding. * @return array sequence of positive integers that were decoded * @see encodeModified9 */ @@ -527,7 +527,7 @@ if(!extension_loaded("yioop") ) { /** * Decoded a single word with high two bits off according to modified 9 * - * @param string $int_string 4 byte string to decode + * @param string $encoded_list four byte string to decode * @return array sequence of integers that results from the decoding. */ function unpackListModified9($encoded_list) @@ -573,11 +573,11 @@ function unpackListModified9($encoded_list) return $decoded_list; } /** - * Given an int encoding encoding a doc_index followed by a position - * list using Modified 9, extracts just the doc_index. + * Given an int encoding encoding a doc_index followed by a position + * list using Modified 9, extracts just the doc_index. * - * @param int $encoded_list in the just described format - * @return int a doc index into an index shard document map. + * @param int $encoded_list in the just described format + * @return int a doc index into an index shard document map. */ function docIndexModified9($encoded_list) { @@ -663,9 +663,9 @@ function unpackFloat($str) return $tmp[1]; } /** - * Packs an float into a 4 char string + * Packs an float into a four char string * - * @param float $my_floatt the float to pack + * @param float $my_float the float to pack * @return string the packed string */ function packFloat($my_float) @@ -731,15 +731,18 @@ function metricToInt($metric_num) return $num; } /** - * Logs a message to a logfile or the screen + * Logs a message to a logfile or the screen * - * @param string $msg message to log - * @param string $lname name of log file in the LOG_DIR directory, rotated logs - * will also use this as their basename followed by a number followed by - * gzipped (since they are gzipped (older versions of Yioop used bzip - * Some distros don't have bzip but do have gzip. Also gzip was - * being used elsewhere in Yioop, so to remove the dependency bzip was - * replaced )). + * @param string $msg message to log + * @param string $lname name of log file in the LOG_DIR directory, rotated logs + * will also use this as their basename followed by a number followed by + * gzipped (since they are gzipped (older versions of Yioop used bzip + * Some distros don't have bzip but do have gzip. Also gzip was + * being used elsewhere in Yioop, so to remove the dependency bzip was + * replaced )). + * @param bool $check_process_handler whether or not to call the processHandler + * to check how long the code has run since the last time processHandler + * called. */ function crawlLog($msg, $lname = NULL, $check_process_handler = false) { @@ -798,7 +801,7 @@ function crawlLog($msg, $lname = NULL, $check_process_handler = false) * say every 30 seconds). * * @param mixed $msg usually a string with what to be printed out after the - * timeout period. If $msg === true then clears the timout cache + * timeout period. If $msg === true then clears the timout cache */ function crawlTimeoutLog($msg) { @@ -815,18 +818,18 @@ function crawlTimeoutLog($msg) $cache_time = microtime(); } /** - * Computes an 8 byte hash of a string for use in storing documents. + * Computes an 8 byte hash of a string for use in storing documents. * - * An eight byte hash was chosen so that the odds of collision even for - * a few billion documents via the birthday problem are still reasonable. - * If the raw flag is set to false then an 11 byte base64 encoding of the - * 8 byte hash is returned. The hash is calculated as the xor of the - * two halves of the 16 byte md5 of the string. (8 bytes takes less storage - * which is useful for keeping more doc info in memory) + * An eight byte hash was chosen so that the odds of collision even for + * a few billion documents via the birthday problem are still reasonable. + * If the raw flag is set to false then an 11 byte base64 encoding of the + * 8 byte hash is returned. The hash is calculated as the xor of the + * two halves of the 16 byte md5 of the string. (8 bytes takes less storage + * which is useful for keeping more doc info in memory) * - * @param string $string the string to hash - * @param bool $raw whether to leave raw or base 64 encode - * @return string the hash of $string + * @param string $string the string to hash + * @param bool $raw whether to leave raw or base 64 encode + * @return string the hash of $string */ function crawlHash($string, $raw = false) { @@ -847,16 +850,16 @@ function crawlHash($string, $raw = false) return $hash; } /** - * Used to create a 20 byte hash of a string (typically a word) - * together with a string of meta data about the page that the word - * appeared on (media:, safe:, class:) information + * Used to create a 20 byte hash of a string (typically a word) + * together with a string of meta data about the page that the word + * appeared on (media:, safe:, class:) information * - * @param string $string word to hash - * @param bool $raw whether to base64Hash the result - * @param $meta_string the up to 11 byte string of meta information - * @return string first 8 bytes of md5 of $string concatenated with \x00 - * to indicate the hash is of a word not a phrase concatenated with the - * padded to 11 byte $meta_string. + * @param string $string word to hash + * @param bool $raw whether to base64Hash the result + * @param $meta_string the up to 11 byte string of meta information + * @return string first 8 bytes of md5 of $string concatenated with \x00 + * to indicate the hash is of a word not a phrase concatenated with the + * padded to 11 byte $meta_string. */ function crawlHashWord($string, $raw = false, $meta_string = "") { @@ -875,13 +878,15 @@ function crawlHashWord($string, $raw = false, $meta_string = "") return $hash; } /** - * Used to compute all hashes for a phrase based on each possible cond_max - * point. Here cond_max is the location of a substring of a phase which is - * maximal. + * Used to compute all hashes for a phrase based on each possible cond_max + * point. Here cond_max is the location of a substring of a phase which is + * maximal. * - * @param string $string what to find hashes for - * @param $raw whether to modified base64 the result - * @return array of hashes with appropriates shifts if needed + * @param string $string what to find hashes for + * @param array $metas array of meta word values + * @param array $encode_metas a list of meta word names to encode in word_ids + * @param bool $raw whether to base64 the result + * @return array of hashes with appropriates shifts if needed */ function allCrawlHashPaths($string, $metas = array(), $encode_metas = array(), $raw = false) @@ -1005,10 +1010,10 @@ function allCrawlHashPaths($string, $metas = array(), * (meta word name => array(value of that name)) which should be encoded * into word id's * - * @param array $meta array of meta word values - * @param array $encode_meta a list of meta word names to encode in word_ids + * @param array $metas array of meta word values + * @param array $encode_metas a list of meta word names to encode in word_ids * @return array $found_materialized_metas associative array of name => - * values for that name + * values for that name */ function findMaterialMetas($metas, $encode_metas) { @@ -1038,12 +1043,12 @@ function findMaterialMetas($metas, $encode_metas) * in the case of a single word is described in the documentation for * @see crawlHashPath * - * @param array $meta a list of meta word values extracted from a query - * string or document. - * @param array $encode_meta a list of meta word names that should be encoded - * in word id's For example, (media:, safe:, class:) + * @param array $metas a list of meta word values extracted from a query + * string or document. + * @param array $encode_metas a list of meta word names that should be encoded + * in word id's For example, (media:, safe:, class:) * @return string a 9 byte string where encoded meta word values have been - * stored + * stored */ function encodeMaterialMetas($metas, $encode_metas) { @@ -1064,43 +1069,43 @@ function encodeMaterialMetas($metas, $encode_metas) return $meta_string; } /** - * Given a string makes an 20 byte hash path - where first 8 bytes is - * a hash of the string before path start, last 12 bytes is the path - * given by splitting on space and separately hashing each element - * according to the number of elements and the 3bit selector below: - * - * general format: (64 bit lead word hash, 3bit selector, hashes of rest of - * words) according to: - * Selector Bits for each remaining word - * 001 29 32 32 - * 010 29 16 16 16 16 - * 011 29 16 16 8 8 8 8 - * 100 29 16 16 8 8 4 4 4 4 - * 101 29 16 16 8 8 4 4 2 2 2 2 - * 110 29 16 16 8 8 4 4 2 2 1 1 1 1 - * - * If $path_start is 0 behaves like crawlHashWord(). The above encoding is - * typically used to make word_ids for whole phrases, to make word id's - * for single words, the format is - * (64 bits for word, 1 byte null, remaining 11 bytes encode an materialized - * meta words present in document or query string). Of this 11 bytes, - * the first is used for the meta word media:, so if the document is of type - * media:image, then a single byte hash of media:image gives the value of this - * byte. The second byte encodes the meta word safe: in a similar fashion. - * The remaining 9 bytes encode different values of the class: meta word. - * To encode class:some_value., first class:some_value[0] is hashed to a value - * j betwen 0 and 8. Then class:some_value is hash to a single byte b. Then - * the jth value of the remaining bytes is set to b. Non affected bytes are - * null. - * - * @param string $string what to hash - * @param int $path_start what to use as the split between 5 byte front - * hash and the rest - * @param array $metas meta word values from a document or query string - * @param array $encode_metas a list of names of meta word values which should - * encoded into word ids. i.e., (media:, safe:, class:) or none. - * @param bool $raw whether to modified base64 the result - * @return string 8 bytes that results from this hash process + * Given a string makes an 20 byte hash path - where first 8 bytes is + * a hash of the string before path start, last 12 bytes is the path + * given by splitting on space and separately hashing each element + * according to the number of elements and the 3bit selector below: + * + * general format: (64 bit lead word hash, 3bit selector, hashes of rest of + * words) according to: + * Selector Bits for each remaining word + * 001 29 32 32 + * 010 29 16 16 16 16 + * 011 29 16 16 8 8 8 8 + * 100 29 16 16 8 8 4 4 4 4 + * 101 29 16 16 8 8 4 4 2 2 2 2 + * 110 29 16 16 8 8 4 4 2 2 1 1 1 1 + * + * If $path_start is 0 behaves like crawlHashWord(). The above encoding is + * typically used to make word_ids for whole phrases, to make word id's + * for single words, the format is + * (64 bits for word, 1 byte null, remaining 11 bytes encode an materialized + * meta words present in document or query string). Of this 11 bytes, + * the first is used for the meta word media:, so if the document is of type + * media:image, then a single byte hash of media:image gives the value of this + * byte. The second byte encodes the meta word safe: in a similar fashion. + * The remaining 9 bytes encode different values of the class: meta word. + * To encode class:some_value., first class:some_value[0] is hashed to a value + * j betwen 0 and 8. Then class:some_value is hash to a single byte b. Then + * the jth value of the remaining bytes is set to b. Non affected bytes are + * null. + * + * @param string $string what to hash + * @param int $path_start what to use as the split between 5 byte front + * hash and the rest + * @param array $metas meta word values from a document or query string + * @param array $encode_metas a list of names of meta word values which should + * encoded into word ids. i.e., (media:, safe:, class:) or none. + * @param bool $raw whether to modified base64 the result + * @return string 8 bytes that results from this hash process */ function crawlHashPath($string, $path_start = 0, $metas = array(), $encode_metas = array(), $raw = false) @@ -1251,16 +1256,16 @@ function crawlHashPath($string, $path_start = 0, $metas = array(), return $hash; } /** - * Used to compare to ids for index dictionary lookup. ids - * might be either a crawlHash or a 8 byte crawlHash together - * with 12 byte hash path for suffix tree lookup. In the latter - * case the shift variable can be used to match up to a subtree + * Used to compare to ids for index dictionary lookup. ids + * might be either a crawlHash or a 8 byte crawlHash together + * with 12 byte hash path for suffix tree lookup. In the latter + * case the shift variable can be used to match up to a subtree * - * @param string $id1 20 byte word id to compare - * @param string $id2 20 byte word id to compare - * @param int $shift bit shift to apply before saying paths equal - * @return int negative if $id1 smaller, positive if bigger, and 0 if - * same + * @param string $id1 20 byte word id to compare + * @param string $id2 20 byte word id to compare + * @param int $shift bit shift to apply before saying paths equal + * @return int negative if $id1 smaller, positive if bigger, and 0 if + * same */ function compareWordHashes($id1, $id2, $shift = 0) { @@ -1295,8 +1300,8 @@ function compareWordHashes($id1, $id2, $shift = 0) * Converts a crawl hash number to something closer to base64 coded but * so doesn't get confused in urls or DBs * - * @param string $string a hash to base64 encode - * @return string the encoded hash + * @param string $string a hash to base64 encode + * @return string the encoded hash */ function base64Hash($string) { @@ -1309,8 +1314,8 @@ function base64Hash($string) /** * Decodes a crawl hash number from base64 to raw ASCII * - * @param string $base64 a hash to decode - * @return string the decoded hash + * @param string $base64 a hash to decode + * @return string the decoded hash */ function unbase64Hash($base64) { @@ -1357,7 +1362,7 @@ function webdecode($str) * * @param string $string the string to encrypt * @param int $salt salt value to be used (needed to verify if a password is - * valid) + * valid) * @return string the crypted string where crypting is done using crawlHash */ function crawlCrypt($string, $salt = NULL) @@ -1389,18 +1394,18 @@ function crawlCrypt($string, $salt = NULL) * table that a given queue_server would be responsible for handling * * @param array $table an array of rows of associative arrays which - * a queue_server might need to process + * a queue_server might need to process * @param string $field column of $table whose values should be used - * for partitioning + * for partitioning * @param int $num_partition number of queue_servers to choose between * @param int $instance the id of the particular server we are interested - * in + * in * @param object $callback function or static method that might be - * applied to input before deciding the responsible queue_server. - * For example, if input was a url we might want to get the host - * before deciding on the queue_server + * applied to input before deciding the responsible queue_server. + * For example, if input was a url we might want to get the host + * before deciding on the queue_server * @return array the reduced table that the $instance queue_server is - * responsible for + * responsible for */ function partitionByHash($table, $field, $num_partition, $instance, $callback = NULL) @@ -1420,14 +1425,14 @@ function partitionByHash($table, $field, $num_partition, $instance, * Used by a controller to say which queue_server should receive * a given input * @param string $input can view as a key that might be processes by a - * queue_server. For example, in some cases input might be - * a url and we want to determine which queue_server should be - * responsible for queuing that url + * queue_server. For example, in some cases input might be + * a url and we want to determine which queue_server should be + * responsible for queuing that url * @param int $num_partition number of queue_servers to choose between * @param object $callback function or static method that might be - * applied to input before deciding the responsible queue_server. - * For example, if input was a url we might want to get the host - * before deciding on the queue_server + * applied to input before deciding the responsible queue_server. + * For example, if input was a url we might want to get the host + * before deciding on the queue_server * @return int id of server responsible for input */ function calculatePartition($input, $num_partition, $callback = NULL) @@ -1466,20 +1471,20 @@ function changeInMicrotime($start, $end = NULL) } /** * Timestamp of current epoch with microsecond precision useful for situations - * where time() might cause too many collisions (account creation, etc) + * where time() might cause too many collisions (account creation, etc) * @return string timestamp to microsecond of time in second since start of - * current epoch + * current epoch */ function microTimestamp() { return vsprintf('%d.%06d', gettimeofday()); } /** - * Converts a CSS unit string into its equivalent in pixels. This is - * used by @see SvgProcessor. + * Converts a CSS unit string into its equivalent in pixels. This is + * used by @see SvgProcessor. * - * @param string $value a number followed by a legal CSS unit - * @return int a number in pixels + * @param string $value a number followed by a legal CSS unit + * @return int a number in pixels */ function convertPixels($value) { @@ -1557,9 +1562,9 @@ function setWorldPermissions($file) * This is a callback function used in the process of recursively calculating * an array of file modification times and files sizes for a directorys * - * @param string a name of a file in the file system - * @return an array whose single element contain an associative array - * with the size and modification time of the file + * @param string $file a name of a file in the file system + * @return an array whose single element contain an associative array + * with the size and modification time of the file */ function fileInfo($file) { @@ -1571,15 +1576,15 @@ function fileInfo($file) } //ordering functions used in sorting /** - * Callback function used to sort documents by a field + * Callback function used to sort documents by a field * - * Should be initialized before using in usort with a call - * like: orderCallback($tmp, $tmp, "field_want"); + * Should be initialized before using in usort with a call + * like: orderCallback($tmp, $tmp, "field_want"); * - * @param string $word_doc_a doc id of first document to compare - * @param string $word_doc_b doc id of second document to compare - * @param string $field which field of these associative arrays to sort by - * @return int -1 if first doc bigger 1 otherwise + * @param string $word_doc_a doc id of first document to compare + * @param string $word_doc_b doc id of second document to compare + * @param string $order_field which field of these associative arrays to sort by + * @return int -1 if first doc bigger 1 otherwise */ function orderCallback($word_doc_a, $word_doc_b, $order_field = NULL) { @@ -1591,15 +1596,15 @@ function orderCallback($word_doc_a, $word_doc_b, $order_field = NULL) (float)$word_doc_b[$field]) ? -1 : 1; } /** - * Callback function used to sort documents by a field in reverse order + * Callback function used to sort documents by a field in reverse order * - * Should be initialized before using in usort with a call - * like: rorderCallback($tmp, $tmp, "field_want"); + * Should be initialized before using in usort with a call + * like: rorderCallback($tmp, $tmp, "field_want"); * - * @param string $word_doc_a doc id of first document to compare - * @param string $word_doc_b doc id of second document to compare - * @param string $field which field of these associative arrays to sort by - * @return int 1 if first doc bigger -1 otherwise + * @param string $word_doc_a doc id of first document to compare + * @param string $word_doc_b doc id of second document to compare + * @param string $order_field which field of these associative arrays to sort by + * @return int 1 if first doc bigger -1 otherwise */ function rorderCallback($word_doc_a, $word_doc_b, $order_field = NULL) { @@ -1629,7 +1634,7 @@ function lessThan($a, $b) { return ($a < $b) ? -1 : 1; } /** - * Callback to check if $a is greater than $b + * Callback to check if $a is greater than $b * * Used to help sort document results returned in PhraseModel called in * IndexArchiveBundle @@ -1700,10 +1705,13 @@ function readMessage() return rtrim($message); } /** - * Checks if class_1 is the same as class_2 of has class_2 as a parent + * Checks if class_1 is the same as class_2 or has class_2 as a parent * Behaves like 3 param version (last param true) of PHP is_a function * that came into being with Version 5.3.9. * + * @param mixed $class_1 object or string class name to see if in class2 + * @param mixed $class_2 object or string class name to see if contains class1 + * @return bool equal or contains class */ function generalIsA($class_1, $class_2) { @@ -1711,15 +1719,15 @@ function generalIsA($class_1, $class_2) return (is_a($class_1, $class_2) || is_subclass_of($class_1, $class_2)); } /** - * Given an array of arrays acting much like a database table, this - * returns a sequence of key value pairs, where the keys are the distinct - * entries in $key_column and the values are the counts of numbers in - * $count_column for each particular key; + * Given an array of arrays acting much like a database table, this + * returns a sequence of key value pairs, where the keys are the distinct + * entries in $key_column and the values are the counts of numbers in + * $count_column for each particular key; * - * @param array $arr an array of arrays - * @param mixed $key_column (string or int) field name of key column - * @param mixed $count_column (string or int) field name of count column - * @return array key => values pairs of counts + * @param array $arr an array of arrays + * @param mixed $key_column (string or int) field name of key column + * @param mixed $count_column (string or int) field name of count column + * @return array key => values pairs of counts */ function arrayColumnCount($arr, $key_column, $count_column) { @@ -1733,13 +1741,13 @@ function arrayColumnCount($arr, $key_column, $count_column) return $out_arr; } /** - * Given the contents of a start XML/HMTL tag strips out all the attributes - * non listed in $safe_attribute_list + * Given the contents of a start XML/HMTL tag strips out all the attributes + * non listed in $safe_attribute_list * - * @param string $start_tag_contents the contents of an HTML/XML tag. I.e., - * if the tag was <tag stuff> then $start_tag_contents could be stuff - * @param array $safe_attribute_list a list of attributes which should be kept - * @return string containing only safe attributes and their values + * @param string $start_tag_contents the contents of an HTML/XML tag. I.e., + * if the tag was <tag stuff> then $start_tag_contents could be stuff + * @param array $safe_attribute_list a list of attributes which should be kept + * @return string containing only safe attributes and their values */ function stripAttributes($start_tag_contents, $safe_attribute_list = array()) { @@ -1765,14 +1773,14 @@ function arrayColumnCount($arr, $key_column, $count_column) return $out; } /** - * Computes a Unix-style diff of two strings. That is it only - * outputs lines which disagree between the two strings. It outputs +line - * if a line occurs in the second but not first string and -line if a - * line occurs in the first string but not the second. + * Computes a Unix-style diff of two strings. That is it only + * outputs lines which disagree between the two strings. It outputs +line + * if a line occurs in the second but not first string and -line if a + * line occurs in the first string but not the second. * - * @param string $data1 first string to compare - * @param string $data2 second string to compare - * @param bool $html whether to output html highlighting + * @param string $data1 first string to compare + * @param string $data2 second string to compare + * @param bool $html whether to output html highlighting */ function diff($data1, $data2, $html = false) { @@ -1894,11 +1902,11 @@ function diff($data1, $data2, $html = false) return $out_string; } /** - * Computes the longest common subsequence of two arrays + * Computes the longest common subsequence of two arrays * - * @param array $lines1 an array of lines to compute LCS of - * @param array $lines2 an array of lines to compute LCS of - * @param int $offset an offset to shift over array addresses in output by + * @param array $lines1 an array of lines to compute LCS of + * @param array $lines2 an array of lines to compute LCS of + * @param int $offset an offset to shift over array addresses in output by */ function computeLCS($lines1, $lines2, $offset = 0) { @@ -1943,20 +1951,21 @@ function computeLCS($lines1, $lines2, $offset = 0) return $lcs; } /** - * Extracts from a table of longest common sequence moves (probably calculated - * by @see computeLCS) and a starting coordinate $i, $j in that table, - * a longest common subsequence + * Extracts from a table of longest common sequence moves (probably calculated + * by @see computeLCS) and a starting coordinate $i, $j in that table, + * a longest common subsequence * - * @param array $lcs_moves a table of move computed by computeLCS - * @param int $i a line number in string 1 - * @param int $j a line number in string 2 - * @param int $offset a number to add to each line number output into $lcs. - * This is useful if we have trimmed off the initially common lines from - * our two strings we are trying to compute the LCS of - * @param array &$lcs an array of triples - * (index_string1, index_string2, line) - * the indexes indicate the line number in each string, line is the line - * in common the two strings + * @param array $lcs_moves a table of move computed by computeLCS + * @param array $lines from first of the two arrays computing LCS of + * @param int $i a line number in string 1 + * @param int $j a line number in string 2 + * @param int $offset a number to add to each line number output into $lcs. + * This is useful if we have trimmed off the initially common lines from + * our two strings we are trying to compute the LCS of + * @param array& $lcs an array of triples + * (index_string1, index_string2, line) + * the indexes indicate the line number in each string, line is the line + * in common the two strings */ function extractLCSFromTable($lcs_moves, $lines, $i, $j, $offset, &$lcs) { @@ -2003,12 +2012,12 @@ function extractLCSFromTable($lcs_moves, $lines, $i, $j, $offset, &$lcs) return $tmp; } /** - * Returns a random prime of the given length in decimal + * Returns a random prime of the given length in decimal * - * @param int $len length of prime to generate in terms of base 10 digits - * @param int $accuracy the resulting number will be prime with prob - * 1 - 1/2^($accuracy) - * @return string a big prime + * @param int $len length of prime to generate in terms of base 10 digits + * @param int $accuracy the resulting number will be prime with prob + * 1 - 1/2^($accuracy) + * @return string a big prime */ function randProbablyPrime($len, $accuracy = 30) { @@ -2019,12 +2028,12 @@ function randProbablyPrime($len, $accuracy = 30) return $num; } /** - * Check if a big num is a prime or not + * Check if a big num is a prime or not * - * @param string big number to check coded as a long string in decimal - * @param int $accuracy the resulting number will be prime with prob - * 1 - 1/2^($accuracy) - * @param bool whether it is prime or not + * @param string $num big number to check coded as a long string in decimal + * @param int $accuracy the resulting number will be prime with prob + * 1 - 1/2^($accuracy) + * @param bool whether it is prime or not */ function probablyPrime($num, $accuracy) { @@ -2061,9 +2070,9 @@ function probablyPrime($num, $accuracy) * Generates a random big number between the two big number $low and $high * * @param string $low a decimal coded big num lower bounding the desired - * range (inclusive) + * range (inclusive) * @param string $high a decimal coded big num upper bounding the desired - * range (exclusive) + * range (exclusive) */ function bcrand($low, $high) { diff --git a/lib/web_archive.php b/lib/web_archive.php index 8e4a31140..f3ba59b11 100755 --- a/lib/web_archive.php +++ b/lib/web_archive.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -94,11 +94,11 @@ class WebArchive * * @param string $fname filename to use to store archive to disk * @param string $compressor what kind of Compressor object should be - * used to read and write objects in the archive + * used to read and write objects in the archive * @param bool $fast_construct do we read the info block of the web - * archive as part of the constructing process + * archive as part of the constructing process * @param bool $is_string says whether the archive stores to string - * rather than a file + * rather than a file */ function __construct($fname, $compressor, $fast_construct = false, $is_string = false) @@ -156,8 +156,8 @@ class WebArchive * stored * * @param resource $fh resource for the web archive file. If null - * the web archive is open first and close when the data is written - * @param array &$data data to write into the info block of the archive + * the web archive is open first and close when the data is written + * @param array& $data data to write into the info block of the archive */ function writeInfoBlock($fh = NULL, &$data = NULL) { @@ -214,16 +214,16 @@ class WebArchive * Adds objects to the WebArchive * * @param string $offset_field field in objects to return the byte offset - * at which they were stored - * @param array &$objects references to objects that will be stored - * the offset field in these references will be adjusted if + * at which they were stored + * @param array& $objects references to objects that will be stored + * the offset field in these references will be adjusted if * @param array $data data to write in the WebArchive's info block * @param string $callback name of a callback - * $callback($data, $new_objects, $offset_field) - * used to modify $data before it is written - * to the info block. For instance, we can add offset info to data. + * $callback($data, $new_objects, $offset_field) + * used to modify $data before it is written + * to the info block. For instance, we can add offset info to data. * @param bool $return_flag if true rather than adjust the offsets by - * reference, create copy objects and adjust their offsets anf return + * reference, create copy objects and adjust their offsets anf return * @return mixed adjusted objects or void */ function addObjects($offset_field, &$objects, @@ -289,6 +289,8 @@ class WebArchive } /** * Closes a file handle (which should be of a web archive) + * + * @param resource $fh filehandle to close */ function close($fh) { diff --git a/lib/web_archive_bundle.php b/lib/web_archive_bundle.php index a393811ff..8d6e3e4f9 100755 --- a/lib/web_archive_bundle.php +++ b/lib/web_archive_bundle.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -100,12 +100,15 @@ class WebArchiveBundle * characteristics * * @param string $dir_name folder name of the bundle + * @param bool $read_only_archive whether to open archive in a read only + * mode suitable for obtaining search results to open it in a read + * write mode as used during a crawl * @param int $num_docs_per_partition number of documents before the - * web archive is changed + * web archive is changed * @param string $description a short text name/description of this - * WebArchiveBundle + * WebArchiveBundle * @param string $compressor the Compressor object used to - * compress/uncompress data stored in the bundle + * compress/uncompress data stored in the bundle */ function __construct($dir_name, $read_only_archive = true, $num_docs_per_partition = NUM_DOCS_PER_GENERATION, $description = NULL, @@ -171,7 +174,7 @@ class WebArchiveBundle * the resulting offsets given by $offset_field. * * @param string $offset_field field used to record offsets after storing - * @param array &$pages data to store + * @param array& $pages data to store * @return int the write_partition the pages were stored in */ function addPages($offset_field, &$pages) @@ -198,6 +201,8 @@ class WebArchiveBundle /** * Advances the index of the write partition by one and creates the * corresponding web archive. + * + * @param int $i the number of the current write partition */ function setWritePartition($i) { @@ -234,9 +239,9 @@ class WebArchiveBundle * this bundle. * * @param int $index the number of the partition within this bundle to - * return + * return * @param bool $fast_construct should the constructor of the WebArchive - * avoid reading in its info block. + * avoid reading in its info block. * @return object the WebArchive file which was requested */ function getPartition($index, $fast_construct = true) @@ -306,10 +311,10 @@ class WebArchiveBundle * file * * @param string $dir_name folder name of the WebArchiveBundle to get info - * for + * for * @return array containing the name (description) of the WebArchiveBundle, - * the number of items stored in it, and the number of WebArchive - * file partitions it uses. + * the number of items stored in it, and the number of WebArchive + * file partitions it uses. */ static function getArchiveInfo($dir_name) { diff --git a/lib/web_queue_bundle.php b/lib/web_queue_bundle.php index 69be6df94..909d4c83d 100755 --- a/lib/web_queue_bundle.php +++ b/lib/web_queue_bundle.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -53,15 +53,15 @@ require_once 'hash_table.php'; */ require_once BASE_DIR.'/lib/compressors/non_compressor.php'; /** - * Used to store to crawl urls + * Used to store to crawl urls */ require_once 'web_archive.php'; /** - * Used for getHost function + * Used for getHost function */ require_once 'url_parser.php'; /** - * Used for the crawlHash function + * Used for the crawlHash function */ require_once 'utility.php'; /** @@ -69,7 +69,7 @@ require_once 'utility.php'; */ require_once "btree.php"; /** - * Needed for robot stuff + * Needed for robot stuff */ require_once 'crawl_constants.php'; /** @@ -228,10 +228,10 @@ class WebQueueBundle implements Notifier * * @param string $dir_name folder name used by this WebQueueBundle * @param int $filter_size size of each partition in the page exists - * BloomFilterBundle + * BloomFilterBundle * @param int $num_urls_ram number of entries in ram for the priority queue * @param string $min_or_max when the priority queue maintain the heap - * property with respect to the least or the largest weight + * property with respect to the least or the largest weight */ function __construct($dir_name, $filter_size, $num_urls_ram, $min_or_max) @@ -411,7 +411,7 @@ class WebQueueBundle implements Notifier * * @param string $url url whose weight in queue we want to adjust * @param int $flag should be one of self::ROBOT, self::NO_FLAGS, - * self::SCHEDULABLE or self::SCHEDULABLE + crawl_delay + * self::SCHEDULABLE or self::SCHEDULABLE + crawl_delay */ function setQueueFlag(&$url, $flag) { @@ -514,7 +514,7 @@ class WebQueueBundle implements Notifier /** * Makes the weight sum of the to-crawl priority queue sum to $new_total * @param int $new_total amount weights should sum to. All weights will be - * scaled by the same factor. + * scaled by the same factor. */ function normalize($new_total = NUM_URLS_QUEUE_RAM) { @@ -551,10 +551,10 @@ class WebQueueBundle implements Notifier } /** * Removes all url objects from $url_array which have been seen - * @param array &$url_array objects to check if have been seen + * @param array& $url_array objects to check if have been seen * @param array $field_names an array of components of a url_array element * which - * contains a url to check if seen + * contains a url to check if seen */ function differenceSeenUrls(&$url_array, $field_names = NULL) { @@ -581,8 +581,8 @@ class WebQueueBundle implements Notifier /** * Adds all the paths for a host to the Robots Web Archive. * @param string $host name that the paths are to be added for. - * @param array an array with two keys CrawlConstants::ALLOWED_SITES and - * CrawlConstants::DISALLOWED_SITES. For each key + * @param array $paths an array with two keys CrawlConstants::ALLOWED_SITES + * and CrawlConstants::DISALLOWED_SITES. For each key * one has an array of paths */ function addRobotPaths($host, $paths) @@ -651,7 +651,7 @@ class WebQueueBundle implements Notifier * * @param string $host hostname to add to DNS Lookup table * @param string $ip_address in presentation format (not as int) to add - * to table + * to table */ function addDNSCache($host, $ip_address) { @@ -759,13 +759,13 @@ class WebQueueBundle implements Notifier * * @param string $key the things to look up * @param int $return_probe_value one of self::ALWAYS_RETURN_PROBE, - * self::RETURN_PROBE_ON_KEY_FOUND, self::RETURN_VALUE, or self::BOTH. - * Here value means the value associated with the key and probe is - * either the location in the array where the key was found or - * the first location in the array where it was determined the - * key could not be found. + * self::RETURN_PROBE_ON_KEY_FOUND, self::RETURN_VALUE, or self::BOTH. + * Here value means the value associated with the key and probe is + * either the location in the array where the key was found or + * the first location in the array where it was determined the + * key could not be found. * @return mixed would be string if the value is being returned, - * otherwise, false if the key is not found + * otherwise, false if the key is not found */ function lookupHashTable($key, $return_probe_value = HashTable::RETURN_VALUE) @@ -775,7 +775,7 @@ class WebQueueBundle implements Notifier /** * Removes an entries from the to crawl hash table * @param int $probe if the location in the hash table is already known - * to be $probe then this variable can be used to save a lookup + * to be $probe then this variable can be used to save a lookup * @param string $key usually a hash of a url */ function deleteHashTable($key, $probe = false) @@ -791,9 +791,9 @@ class WebQueueBundle implements Notifier * * @param string $key intended to be a hash of a url * @param string $value intended to be offset into a webarchive for urls - * together with an index into the priority queue + * together with an index into the priority queue * @param int $probe if the location in the hash table is already known - * to be $probe then this variable can be used to save a lookup + * to be $probe then this variable can be used to save a lookup * @return bool whether the insert was a success or not */ function insertHashTable($key, $value, $probe = false) diff --git a/lib/wiki_parser.php b/lib/wiki_parser.php index c5a892f2c..4cea6b0e6 100644 --- a/lib/wiki_parser.php +++ b/lib/wiki_parser.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -59,6 +59,8 @@ class WikiParser implements CrawlConstants * regexes) * * @param string $base_address base url for link substitutions + * @param array $add_substitutions additional wiki rule subsitutions in + * addition to the default ones that should be used by this wiki parser */ function __construct($base_address = "", $add_substitutions = array()) { @@ -209,19 +211,19 @@ class WikiParser implements CrawlConstants } } /** - * Parses a mediawiki document to produce an HTML equivalent + * Parses a mediawiki document to produce an HTML equivalent * - * @param string $document a document which might have mediawiki markup - * @param bool $parse_head_vars header variables are an extension of - * mediawiki syntax used to add meta variable and titles to - * the head tag of an html document. This flag controls whether to - * supprot this extension or not - * @param bool $handle_big_files for indexing purposes Yioop by default - * truncates long documents before indexing them. If true, this - * method does not do this default truncation. The true value - * is more useful when using Yioop's built-in wiki. - * @return string HTML document obtained by parsing mediawiki - * markup in $document + * @param string $document a document which might have mediawiki markup + * @param bool $parse_head_vars header variables are an extension of + * mediawiki syntax used to add meta variable and titles to + * the head tag of an html document. This flag controls whether to + * supprot this extension or not + * @param bool $handle_big_files for indexing purposes Yioop by default + * truncates long documents before indexing them. If true, this + * method does not do this default truncation. The true value + * is more useful when using Yioop's built-in wiki. + * @return string HTML document obtained by parsing mediawiki + * markup in $document */ function parse($document, $parse_head_vars = true, $handle_big_files = false) @@ -301,9 +303,9 @@ class WikiParser implements CrawlConstants * Used to make a table of contents for a wiki page based on the * level two headings on that page. * - * @param string $page a wiki document - * @return string HTML table of contents to be inserted after wiki - * page processed + * @param string $page a wiki document + * @return string HTML table of contents to be inserted after wiki + * page processed */ function makeTableOfContents($page) { @@ -326,9 +328,9 @@ class WikiParser implements CrawlConstants * Used to make a reference list for a wiki page based on the * cite tags on that page. * - * @param string $page a wiki document - * @return string HTML reference list to be inserted after wiki - * page processed + * @param string $page a wiki document + * @return string HTML reference list to be inserted after wiki + * page processed */ function makeReferences($page) { @@ -456,13 +458,13 @@ class WikiParser implements CrawlConstants return array($page, $references); } /** - * After regex processing has been done on a wiki page this function - * inserts into the resulting page a table of contents just before - * the first h2 tag, then returns the result page + * After regex processing has been done on a wiki page this function + * inserts into the resulting page a table of contents just before + * the first h2 tag, then returns the result page * - * @param string $page page in which to insert table of contents - * @param string $toc HTML table of contents - * @return string resulting page after insert + * @param string $page page in which to insert table of contents + * @param string $toc HTML table of contents + * @return string resulting page after insert */ function insertTableOfContents($page, $toc) { @@ -475,13 +477,13 @@ class WikiParser implements CrawlConstants return $page; } /** - * After regex processing has been done on a wiki page this function - * inserts into the resulting page a reference at - * {{reflist locations, then returns the result page + * After regex processing has been done on a wiki page this function + * inserts into the resulting page a reference at + * {{reflist locations, then returns the result page * - * @param string $page page in which to insert the reference lists - * @param string $toc HTML table of contents - * @return string resulting page after insert + * @param string $page page in which to insert the reference lists + * @param string $references HTML table of contents + * @return string resulting page after insert */ function insertReferences($page, $references) { @@ -566,7 +568,7 @@ function makeTableCallback($matches) * Used to convert {{cite }} to a numbered link to a citation * * @param array $matches from regular expression to check for {{cite }} - * @param int init used to initialize counter for citations + * @param int $init used to initialize counter for citations * @return string a HTML link to citation in current document */ function citeCallback($matches, $init = -1) @@ -597,7 +599,7 @@ function fixLinksCallback($matches) * Callback used to base64 encode the contents of nowiki tags so they * won't be manipulated by wiki replacements. * - * @param array $matches[1] should contain the contents of a nowiki tag + * @param array $matches $matches[1] should contain the contents of a nowiki tag * @return string base 64 encoded contents surrounded by an escaped nowiki tag. */ function base64EncodeCallback($matches) @@ -610,7 +612,7 @@ function base64EncodeCallback($matches) * (@see base64EncodeCallback) nowiki tags after all mediawiki substitutions * have been done * - * @param array $matches[1] should contain the contents of a nowiki tag + * @param array $matches $matches[1] should contain the contents of a nowiki tag * @return string base 64 decoded contents surrounded by a pre-formatted tag. */ function base64DecodeCallback($matches) diff --git a/locale/ar/resources/locale.js b/locale/ar/resources/locale.js index dc37b42ae..2c899e328 100755 --- a/locale/ar/resources/locale.js +++ b/locale/ar/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/ar/resources/tokenizer.php b/locale/ar/resources/tokenizer.php index 16b8dd9e4..fe0e71c69 100755 --- a/locale/ar/resources/tokenizer.php +++ b/locale/ar/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} diff --git a/locale/bn/resources/locale.js b/locale/bn/resources/locale.js index 5ab15e356..43eb5a3a0 100755 --- a/locale/bn/resources/locale.js +++ b/locale/bn/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Snigdha Rao Parvatneni * @package seek_quarry diff --git a/locale/bn/resources/tokenizer.php b/locale/bn/resources/tokenizer.php index 0113a0f42..1f5d41156 100755 --- a/locale/bn/resources/tokenizer.php +++ b/locale/bn/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Snigdha Rao Parvatneni - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Snigdha Rao Parvatneni + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} diff --git a/locale/de/resources/locale.js b/locale/de/resources/locale.js index 2990a8d50..7713b2766 100755 --- a/locale/de/resources/locale.js +++ b/locale/de/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/de/resources/tokenizer.php b/locale/de/resources/tokenizer.php index 25445c2ae..c62f5db2a 100755 --- a/locale/de/resources/tokenizer.php +++ b/locale/de/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} diff --git a/locale/en-US/resources/locale.js b/locale/en-US/resources/locale.js index c215ff5fc..59eb3b47b 100755 --- a/locale/en-US/resources/locale.js +++ b/locale/en-US/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sandhya Vissapragada * @package seek_quarry diff --git a/locale/en-US/resources/tokenizer.php b/locale/en-US/resources/tokenizer.php index 0c3392de0..173a43b05 100755 --- a/locale/en-US/resources/tokenizer.php +++ b/locale/en-US/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /* If you would like to use wordnet for thesaurus reordering of query results @@ -91,10 +91,10 @@ class EnTokenizer */ static $j; /** - * The constructor for a tokenizer can be used to say that a thesaurus - * for final query reordering is present. For english we do this if - * the WORDNET_EXEC variable is set. In which case we use WordNet for - * our reordering + * The constructor for a tokenizer can be used to say that a thesaurus + * for final query reordering is present. For english we do this if + * the WORDNET_EXEC variable is set. In which case we use WordNet for + * our reordering */ function __construct() { @@ -103,13 +103,13 @@ class EnTokenizer } } /** - * Stub function which could be used for a word segmenter. - * Such a segmenter on input thisisabunchofwords would output - * this is a bunch of words + * Stub function which could be used for a word segmenter. + * Such a segmenter on input thisisabunchofwords would output + * this is a bunch of words * - * @param string $pre_segment before segmentation - * @return string should return string with words separated by space - * in this case does nothing + * @param string $pre_segment before segmentation + * @return string should return string with words separated by space + * in this case does nothing */ static function segment($pre_segment) { @@ -120,12 +120,12 @@ class EnTokenizer * * @param string $term term to find related thesaurus terms * @param string $word_type is the type of word such as "NN" (noun), - * "VB" (verb), "AJ" (adjective), or "AV" (adverb) - * (all other types will be ignored) + * "VB" (verb), "AJ" (adjective), or "AV" (adverb) + * (all other types will be ignored) * @param string $whole_query the original query $term came from * @return array a sequence of - * (score => array of thesaurus terms) associations. The score - * representing one word sense of term + * (score => array of thesaurus terms) associations. The score + * representing one word sense of term */ static function scoredThesaurusMatches($term, $word_type, $whole_query) @@ -175,7 +175,7 @@ class EnTokenizer $score[$j] = PhraseParser::getCosineRank($query_parts, $example_sentence_parts); /* If Cosine similarity is zero then go for - * intersection similarity ranking + * intersection similarity ranking */ if($score[$j] == 0) { $score[$j] = PhraseParser::getIntersection($query_parts, @@ -357,7 +357,7 @@ class EnTokenizer * * @param string $phrase text to add parts speech tags to * @return string $tagged_phrase phrase where each term has ~part_of_speech - * appended + * appended */ static function tagPartsOfSpeechPhrase($phrase) { @@ -395,13 +395,13 @@ class EnTokenizer * m() measures the number of consonant sequences between 0 and j. if c is * a consonant sequence and v a vowel sequence, and [.] indicates arbitrary * presence, - * <pre> - * [c][v] gives 0 - * [c]vc[v] gives 1 - * [c]vcvc[v] gives 2 - * [c]vcvcvc[v] gives 3 - * .... - * </pre> + * <pre> + * [c][v] gives 0 + * [c]vc[v] gives 1 + * [c]vcvc[v] gives 2 + * [c]vcvcvc[v] gives 3 + * .... + * </pre> */ private static function m() { @@ -446,6 +446,7 @@ class EnTokenizer /** * Checks if $j,($j-1) contain a double consonant. * + * @param int $j position to check in buffer for double consonant * @return bool if it does or not */ private static function doublec($j) @@ -460,9 +461,10 @@ class EnTokenizer * not w,x or y. this is used when trying to restore an e at the end of a * short word. e.g. *<pre> - * cav(e), lov(e), hop(e), crim(e), but - * snow, box, tray. + * cav(e), lov(e), hop(e), crim(e), but + * snow, box, tray. *</pre> + * @param int $i position to check in buffer for consonant-vowel-consonant * @return bool whether the letters at indices have the given form */ private static function cvc($i) @@ -517,23 +519,23 @@ class EnTokenizer /** step1ab() gets rid of plurals and -ed or -ing. e.g. * <pre> - * caresses -> caress - * ponies -> poni - * ties -> ti - * caress -> caress - * cats -> cat + * caresses -> caress + * ponies -> poni + * ties -> ti + * caress -> caress + * cats -> cat * - * feed -> feed - * agreed -> agree - * disabled -> disable + * feed -> feed + * agreed -> agree + * disabled -> disable * - * matting -> mat - * mating -> mate - * meeting -> meet - * milling -> mill - * messing -> mess + * matting -> mat + * mating -> mate + * meeting -> meet + * milling -> mill + * messing -> mess * - * meetings -> meet + * meetings -> meet * </pre> */ private static function step1ab() @@ -708,7 +710,7 @@ class EnTokenizer if (self::m() > 1) self::$k = self::$j; } /** step5() removes a final -e if m() > 1, and changes -ll to -l if - * m() > 1. + * m() > 1. */ private static function step5() { @@ -723,13 +725,13 @@ class EnTokenizer } //private methods for part of speech taggin /** - * Split input text into terms and output an array with one element - * per term, that element consisting of array with the term token - * and the part of speech tag. + * Split input text into terms and output an array with one element + * per term, that element consisting of array with the term token + * and the part of speech tag. * - * @param string $text string to tag and tokenize - * @return array of pairs of the form( "token" => token_for_term, - * "tag"=> part_of_speech_tag_for_term) for one each token in $text + * @param string $text string to tag and tokenize + * @return array of pairs of the form( "token" => token_for_term, + * "tag"=> part_of_speech_tag_for_term) for one each token in $text */ private static function tagTokenizePartOfSpeech($text) { diff --git a/locale/es/resources/locale.js b/locale/es/resources/locale.js index 8b125c77b..cd7c71d29 100755 --- a/locale/es/resources/locale.js +++ b/locale/es/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/es/resources/tokenizer.php b/locale/es/resources/tokenizer.php index 5018ada29..e9c25775d 100755 --- a/locale/es/resources/tokenizer.php +++ b/locale/es/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/fa/resources/locale.js b/locale/fa/resources/locale.js index 9268aa947..7fcb6ac09 100755 --- a/locale/fa/resources/locale.js +++ b/locale/fa/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/fa/resources/tokenizer.php b/locale/fa/resources/tokenizer.php index bd94e63a5..db0eaef57 100755 --- a/locale/fa/resources/tokenizer.php +++ b/locale/fa/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/fr-FR/resources/locale.js b/locale/fr-FR/resources/locale.js index f6e7e1cae..3aa81bca7 100755 --- a/locale/fr-FR/resources/locale.js +++ b/locale/fr-FR/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/fr-FR/resources/tokenizer.php b/locale/fr-FR/resources/tokenizer.php index 149e5949f..810c9f132 100755 --- a/locale/fr-FR/resources/tokenizer.php +++ b/locale/fr-FR/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/he/resources/locale.js b/locale/he/resources/locale.js index 61664b756..4e476b83e 100755 --- a/locale/he/resources/locale.js +++ b/locale/he/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/he/resources/tokenizer.php b/locale/he/resources/tokenizer.php index 51433223c..7b339e4bb 100755 --- a/locale/he/resources/tokenizer.php +++ b/locale/he/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/hi/resources/locale.js b/locale/hi/resources/locale.js index 170efd482..e9773c859 100755 --- a/locale/hi/resources/locale.js +++ b/locale/hi/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Mallika Perepa * @package seek_quarry diff --git a/locale/hi/resources/tokenizer.php b/locale/hi/resources/tokenizer.php index 0e2168f46..13d0102d8 100755 --- a/locale/hi/resources/tokenizer.php +++ b/locale/hi/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/in-ID/resources/locale.js b/locale/in-ID/resources/locale.js index 013c5bbb0..ac87bdb0e 100755 --- a/locale/in-ID/resources/locale.js +++ b/locale/in-ID/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/in-ID/resources/tokenizer.php b/locale/in-ID/resources/tokenizer.php index 91166ace9..88ea04513 100755 --- a/locale/in-ID/resources/tokenizer.php +++ b/locale/in-ID/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/it/resources/locale.js b/locale/it/resources/locale.js index 25cd37991..5317660fe 100755 --- a/locale/it/resources/locale.js +++ b/locale/it/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/it/resources/tokenizer.php b/locale/it/resources/tokenizer.php index e093036bf..1dec92665 100755 --- a/locale/it/resources/tokenizer.php +++ b/locale/it/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** @@ -86,7 +86,12 @@ class ItTokenizer */ static $step1_changes; /** + * This method currently does nothing. For some locales it could + * used to split strings of the form "thisisastring" into a string + * with the words seperated: "this is a string" * + * @param string $pre_segment string to be segmented + * @return string after segmentation done (same string in this case) */ static function segment($pre_segment) { diff --git a/locale/ja/resources/locale.js b/locale/ja/resources/locale.js index 973a8e6fa..886b6fe8e 100755 --- a/locale/ja/resources/locale.js +++ b/locale/ja/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sandhya Vissapragada * @package seek_quarry diff --git a/locale/ja/resources/tokenizer.php b/locale/ja/resources/tokenizer.php index fe723147e..54594fb82 100755 --- a/locale/ja/resources/tokenizer.php +++ b/locale/ja/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/kn/resources/locale.js b/locale/kn/resources/locale.js index 973a8e6fa..886b6fe8e 100755 --- a/locale/kn/resources/locale.js +++ b/locale/kn/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sandhya Vissapragada * @package seek_quarry diff --git a/locale/kn/resources/tokenizer.php b/locale/kn/resources/tokenizer.php index 019e12521..3a60f5a08 100755 --- a/locale/kn/resources/tokenizer.php +++ b/locale/kn/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/ko/resources/locale.js b/locale/ko/resources/locale.js index 973a8e6fa..886b6fe8e 100755 --- a/locale/ko/resources/locale.js +++ b/locale/ko/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sandhya Vissapragada * @package seek_quarry diff --git a/locale/ko/resources/tokenizer.php b/locale/ko/resources/tokenizer.php index 873eb918f..c5d751338 100755 --- a/locale/ko/resources/tokenizer.php +++ b/locale/ko/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/pl/resources/locale.js b/locale/pl/resources/locale.js index 29b29ed2d..eb036b74b 100755 --- a/locale/pl/resources/locale.js +++ b/locale/pl/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/pl/resources/tokenizer.php b/locale/pl/resources/tokenizer.php index 48456109c..902a3b196 100755 --- a/locale/pl/resources/tokenizer.php +++ b/locale/pl/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/pt/resources/locale.js b/locale/pt/resources/locale.js index 25cd37991..5317660fe 100755 --- a/locale/pt/resources/locale.js +++ b/locale/pt/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/pt/resources/tokenizer.php b/locale/pt/resources/tokenizer.php index fa72f3615..9b8766e2d 100755 --- a/locale/pt/resources/tokenizer.php +++ b/locale/pt/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/ru/resources/locale.js b/locale/ru/resources/locale.js index a1a8f3b99..b6694e44e 100755 --- a/locale/ru/resources/locale.js +++ b/locale/ru/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/ru/resources/tokenizer.php b/locale/ru/resources/tokenizer.php index 3db2f0bef..3540f3e75 100755 --- a/locale/ru/resources/tokenizer.php +++ b/locale/ru/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} diff --git a/locale/te/resources/locale.js b/locale/te/resources/locale.js index 516e5cff2..877a0d4ea 100755 --- a/locale/te/resources/locale.js +++ b/locale/te/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sandhya Vissapragada * @package seek_quarry diff --git a/locale/th/resources/locale.js b/locale/th/resources/locale.js index 973a8e6fa..886b6fe8e 100755 --- a/locale/th/resources/locale.js +++ b/locale/th/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sandhya Vissapragada * @package seek_quarry diff --git a/locale/th/resources/tokenizer.php b/locale/th/resources/tokenizer.php index 2f1511f00..63f874de9 100755 --- a/locale/th/resources/tokenizer.php +++ b/locale/th/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/tr/resources/locale.js b/locale/tr/resources/locale.js index 5d41a2366..b1519a745 100755 --- a/locale/tr/resources/locale.js +++ b/locale/tr/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/tr/resources/tokenizer.php b/locale/tr/resources/tokenizer.php index d09f4568a..78518e5ba 100755 --- a/locale/tr/resources/tokenizer.php +++ b/locale/tr/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** diff --git a/locale/vi-VN/resources/locale.js b/locale/vi-VN/resources/locale.js index e0d5b692c..376047684 100755 --- a/locale/vi-VN/resources/locale.js +++ b/locale/vi-VN/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry diff --git a/locale/vi-VN/resources/tokenizer.php b/locale/vi-VN/resources/tokenizer.php index 5ec0986d8..fdfcc5f60 100755 --- a/locale/vi-VN/resources/tokenizer.php +++ b/locale/vi-VN/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} diff --git a/locale/zh-CN/resources/locale.js b/locale/zh-CN/resources/locale.js index b24a568ad..c82269295 100755 --- a/locale/zh-CN/resources/locale.js +++ b/locale/zh-CN/resources/locale.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sandhya Vissapragada * @package seek_quarry diff --git a/locale/zh-CN/resources/tokenizer.php b/locale/zh-CN/resources/tokenizer.php index fb950257e..5aca520e2 100755 --- a/locale/zh-CN/resources/tokenizer.php +++ b/locale/zh-CN/resources/tokenizer.php @@ -1,32 +1,32 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Chris Pollett chris@pollett.org - * @package seek_quarry - * @subpackage locale - * @license http://www.gnu.org/licenses/ GPL3 - * @link http://www.seekquarry.com/ - * @copyright 2009 - 2014 - * @filesource + * @author Chris Pollett chris@pollett.org + * @package seek_quarry + * @subpackage locale + * @license http://www.gnu.org/licenses/ GPL3 + * @link http://www.seekquarry.com/ + * @copyright 2009 - 2014 + * @filesource */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} @@ -53,12 +53,12 @@ class ZhTokenizer return $page; } /** - * A word segmenter. - * Such a segmenter on input thisisabunchofwords would output - * this is a bunch of words + * A word segmenter. + * Such a segmenter on input thisisabunchofwords would output + * this is a bunch of words * - * @param string $pre_segment before segmentation - * @return string with words separated by space + * @param string $pre_segment before segmentation + * @return string with words separated by space */ static function segment($pre_segment) { diff --git a/models/activity_model.php b/models/activity_model.php index 9d43ce0a0..8b844b63c 100755 --- a/models/activity_model.php +++ b/models/activity_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/models/captcha_model.php b/models/captcha_model.php index a66195f15..236a99ad8 100755 --- a/models/captcha_model.php +++ b/models/captcha_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -45,10 +45,10 @@ require_once BASE_DIR."/models/model.php"; class CaptchaModel extends Model { /** - * Makes a graphical captcha from the provided text string + * Makes a graphical captcha from the provided text string * - * @param string $captcha_text string to make image captcha from - * @return string $data_url a data url containing the obfuscated image + * @param string $captcha_text string to make image captcha from + * @return string $data_url a data url containing the obfuscated image */ function makeGraphicalCaptcha($captcha_text) { diff --git a/models/crawl_model.php b/models/crawl_model.php index ed60941a4..a231a7ece 100755 --- a/models/crawl_model.php +++ b/models/crawl_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -65,22 +65,41 @@ class CrawlModel extends ParallelModel implements CrawlConstants */ var $suggest_url_file; /** - * {@inheritDoc} + * {@inheritDoc} + * + * @param string $db_name the name of the database for the search engine + * @param bool $connect whether to connect to the database by default + * after making the datasource class */ function __construct($db_name = DB_NAME, $connect = true) { $this->suggest_url_file = WORK_DIRECTORY."/data/suggest_url.txt"; parent::__construct($db_name, $connect); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param mixed $args any additional arguments which should be used to + * determine these tables (in this case none) + * @return string a comma separated list of tables suitable for a SQL + * query + */ function fromCallback($args) { return "CRAWL_MIXES"; } - /** {@inheritDoc} */ - function rowCallback($row, $with_components) + /** + * {@inheritDoc} + * + * @param array $row row as retrieved from database query + * @param mixed $args additional arguments that might be used by this + * callback. In this case, should be a boolean flag that says whether + * or not to add information about the components of the crawl mix + * @return array $row after callback manipulation + */ + function rowCallback($row, $args) { - if($with_components) { + if($args) { $mix = $this->getCrawlMix($row['TIMESTAMP'], true); $row['FRAGMENTS'] = $mix['FRAGMENTS']; } @@ -97,17 +116,17 @@ class CrawlModel extends ParallelModel implements CrawlConstants * and get the results back. * * @param string $machine the ip address of domain name of the machine the - * cached page lives on + * cached page lives on * @param string $machine_uri the path from document root on $machine where - * the yioop scripts live + * the yioop scripts live * @param int $partition the partition in the WebArchiveBundle the page is - * in + * in * @param int $offset the offset in bytes into the WebArchive partition in - * the WebArchiveBundle at which the cached page lives. + * the WebArchiveBundle at which the cached page lives. * @param string $crawl_time the timestamp of the crawl the cache page is - * from + * from * @param int $instance_num which fetcher instance for the particular - * fetcher crawled the page (if more than one), false otherwise + * fetcher crawled the page (if more than one), false otherwise * @return array page data of the cached page */ function getCacheFile($machine, $machine_uri, $partition, @@ -155,8 +174,8 @@ class CrawlModel extends ParallelModel implements CrawlConstants * Sets the IndexArchive that will be used for search results * * @param $timestamp the timestamp of the index archive. The timestamp is - * when the crawl was started. Currently, the timestamp appears as substring - * of the index archives directory name + * when the crawl was started. Currently, the timestamp appears as + * substring of the index archives directory name */ function setCurrentIndexDatabaseName($timestamp) { @@ -170,13 +189,13 @@ class CrawlModel extends ParallelModel implements CrawlConstants * more recent than timestamp. The file which have * in their path or name a string in the $excludes array will be exclude * - * @param string a directory to traverse + * @param string $dir a directory to traverse * @param int $timestamp used to check modified times against * @param array $excludes an array of path substrings tot exclude * @return array of file structs consisting of name, modified time and - * size. + * size. */ - function getDeltaFileInfo($dir, $timestamp = 0, $excludes) + function getDeltaFileInfo($dir, $timestamp, $excludes) { $dir_path_len = strlen($dir) + 1; $files = $this->db->fileInfoRecursive($dir, true); @@ -203,9 +222,10 @@ class CrawlModel extends ParallelModel implements CrawlConstants /** * Gets a list of all mixes of available crawls * + * @param int $user_id user that we are getting a list of mixes for * @param bool $with_components if false then don't load the factors - * that make up the crawl mix, just load the name of the mixes - * and their timestamps; otherwise, if true loads everything + * that make up the crawl mix, just load the name of the mixes + * and their timestamps; otherwise, if true loads everything * @return array list of available crawls */ function getMixList($user_id, $with_components = false) @@ -227,9 +247,9 @@ class CrawlModel extends ParallelModel implements CrawlConstants * * @param string $timestamp of the requested crawl mix * @param bool $just_components says whether to find the mix name or - * just the components array. + * just the components array. * @return array the crawls and their weights that make up the - * requested crawl mix. + * requested crawl mix. */ function getCrawlMix($timestamp, $just_components = false) { @@ -288,7 +308,7 @@ class CrawlModel extends ParallelModel implements CrawlConstants /** * Returns whether the supplied timestamp corresponds to a crawl mix * - * @param string timestamp of the requested crawl mix + * @param string $timestamp of the requested crawl mix * * @return bool true if it does; false otherwise */ @@ -359,9 +379,10 @@ class CrawlModel extends ParallelModel implements CrawlConstants } } /** - * Stores in DB the supplied crawl mix object + * Deletes from the DB the crawl mix ans its associated components and + * fragments * - * @param array $mix an associative array repreenting the crawl mix object + * @param int $timestamp of the mix to delete */ function deleteCrawlMix($timestamp) { @@ -392,12 +413,12 @@ class CrawlModel extends ParallelModel implements CrawlConstants } } /** - * Returns the initial sites that a new crawl will start with along with - * crawl parameters such as crawl order, allowed and disallowed crawl sites - * @param bool $use_default whether or not to use the Yioop! default - * crawl.ini file rather than the one created by the user. - * @return array the first sites to crawl during the next crawl - * restrict_by_url, allowed, disallowed_sites + * Returns the initial sites that a new crawl will start with along with + * crawl parameters such as crawl order, allowed and disallowed crawl sites + * @param bool $use_default whether or not to use the Yioop! default + * crawl.ini file rather than the one created by the user. + * @return array the first sites to crawl during the next crawl + * restrict_by_url, allowed, disallowed_sites */ function getSeedInfo($use_default = false) { @@ -416,7 +437,7 @@ class CrawlModel extends ParallelModel implements CrawlConstants * * @param array $info an array containing information about the crawl */ - function setSeedInfo($info, $name="") + function setSeedInfo($info) { if(!isset($info['general']['crawl_index'])) { $info['general']['crawl_index']='12345678'; @@ -539,9 +560,9 @@ EOT; * Returns the crawl parameters that were used during a given crawl * * @param string $timestamp timestamp of the crawl to load the crawl - * parameters of + * parameters of * @return array the first sites to crawl during the next crawl - * restrict_by_url, allowed, disallowed_sites + * restrict_by_url, allowed, disallowed_sites * @param array $machine_urls an array of urls of yioop queue servers * */ @@ -673,10 +694,10 @@ EOT; } } /** - * Returns an array of urls which were stored via the suggest-a-url - * form in suggest_view.php + * Returns an array of urls which were stored via the suggest-a-url + * form in suggest_view.php * - * @return array urls that have been suggested + * @return array urls that have been suggested */ function getSuggestSites() { @@ -689,13 +710,13 @@ EOT; return $urls; } /** - * Add new distinct urls to those already saved in the suggest_url_file - * If the supplied url is not new or the file size - * exceeds MAX_SUGGEST_URL_FILE_SIZE then it is not added. + * Add new distinct urls to those already saved in the suggest_url_file + * If the supplied url is not new or the file size + * exceeds MAX_SUGGEST_URL_FILE_SIZE then it is not added. * - * @param string $url to add - * @return string true if the url was added or already existed - * in the file; false otherwise + * @param string $url to add + * @return string true if the url was added or already existed + * in the file; false otherwise */ function appendSuggestSites($url) { @@ -725,7 +746,7 @@ EOT; return false; } /** - * Resets the suggest_url_file to be the empty file + * Resets the suggest_url_file to be the empty file */ function clearSuggestSites() { @@ -872,6 +893,10 @@ EOT; /** * Used to send a message to the queue_servers to start a crawl * + * @param array $crawl_params has info like the time of the crawl, + * whether starting a new crawl or resuming an old one, etc. + * @param array $seed_info what urls to crawl, etc as from the crawl.ini + * file * @param array $machine_urls an array of urls of yioop queue servers */ function sendStartCrawlMessage($crawl_params, $seed_info = NULL, @@ -928,16 +953,16 @@ EOT; * Gets a list of all index archives of crawls that have been conducted * * @param bool $return_arc_bundles whether index bundles used for indexing - * arc or other archive bundles should be included in the lsit + * arc or other archive bundles should be included in the lsit * @param bool $return_recrawls whether index archive bundles generated as - * a result of recrawling should be included in the result + * a result of recrawling should be included in the result * @param array $machine_urls an array of urls of yioop queue servers * @param bool $cache whether to try to get/set the data to a cache file * * @return array available IndexArchiveBundle directories and - * their meta information this meta information includes the time of - * the crawl, its description, the number of pages downloaded, and the - * number of partitions used in storing the inverted index + * their meta information this meta information includes the time of + * the crawl, its description, the number of pages downloaded, and the + * number of partitions used in storing the inverted index */ function getCrawlList($return_arc_bundles = false, $return_recrawls = false, $machine_urls = NULL, $cache = false) @@ -1044,7 +1069,7 @@ EOT; * used to integrate the crawl lists received by the different machines * * @param array $list_strings serialized crawl list data from different - * queue_servers + * queue_servers * @param string $data_field field of $list_strings to use for data * @return array list of crawls and their meta data */ @@ -1089,7 +1114,7 @@ EOT; * stop the crawl. * * @param array $list_strings serialized crawl list data from different - * queue_servers + * queue_servers * @param array $machine_urls an array of urls of yioop queue servers * @return bool whether the current crawl is stalled or not */ @@ -1124,13 +1149,13 @@ EOT; * machines * * @param array $stall_statuses contains web encoded serialized data one - * one field of which has the boolean data concerning stalled statis + * one field of which has the boolean data concerning stalled statis * * @param string $data_field field of $stall_statuses to use for data - * if NULL then each element of $stall_statuses is a wen encoded - * serialized boolean + * if NULL then each element of $stall_statuses is a wen encoded + * serialized boolean * @return bool true if no queue_server has heard from one - * fetcher within the time out period + * fetcher within the time out period */ function aggregateStalled($stall_statuses, $data_field = NULL) { @@ -1155,13 +1180,13 @@ EOT; return $result; } /** - * Returns data about current crawl such as DESCRIPTION, TIMESTAMP, - * peak memory of various processes, most recent fetcher, most recent - * urls, urls seen, urls visited, etc. + * Returns data about current crawl such as DESCRIPTION, TIMESTAMP, + * peak memory of various processes, most recent fetcher, most recent + * urls, urls seen, urls visited, etc. * - * @param array $machine_urls an array of urls of yioop queue servers - * on which the crawl is being conducted - * @return array associative array of the said data + * @param array $machine_urls an array of urls of yioop queue servers + * on which the crawl is being conducted + * @return array associative array of the said data */ function crawlStatus($machine_urls = NULL) { @@ -1220,8 +1245,8 @@ EOT; * @param array $status_strings * @param string $data_field field of $status_strings to use for data * @return array associative array of DESCRIPTION, TIMESTAMP, - * peak memory of various processes, most recent fetcher, most recent - * urls, urls seen, urls visited, etc. + * peak memory of various processes, most recent fetcher, most recent + * urls, urls seen, urls visited, etc. */ function aggregateStatuses($status_strings, $data_field = NULL) { @@ -1287,14 +1312,14 @@ EOT; return $status; } /** - * This method is used to reduce the number of network requests - * needed by the crawlStatus method of admin_controller. It returns - * an array containing the results of the @see crawlStalled - * @see crawlStatus and @see getCrawlList methods + * This method is used to reduce the number of network requests + * needed by the crawlStatus method of admin_controller. It returns + * an array containing the results of the @see crawlStalled + * @see crawlStatus and @see getCrawlList methods * - * @param array $machine_urls an array of urls of yioop queue servers - * @return array containing three components one for each of the three - * kinds of results listed above + * @param array $machine_urls an array of urls of yioop queue servers + * @return array containing three components one for each of the three + * kinds of results listed above */ function combinedCrawlInfo($machine_urls = NULL) { @@ -1318,13 +1343,13 @@ EOT; return $combined; } /** - * Add the provided urls to the schedule directory of URLs that will - * be crawled + * Add the provided urls to the schedule directory of URLs that will + * be crawled * - * @param string $timestamp Unix timestamp of crawl to add to schedule of - * @param array $inject_urls urls to be added to the schedule of - * the active crawl - * @param array $machine_urls an array of urls of yioop queue servers + * @param string $timestamp Unix timestamp of crawl to add to schedule of + * @param array $inject_urls urls to be added to the schedule of + * the active crawl + * @param array $machine_urls an array of urls of yioop queue servers */ function injectUrlsCurrentCrawl($timestamp, $inject_urls, $machine_urls = NULL) @@ -1373,12 +1398,12 @@ EOT; return false; } /** - * Computes for each word in an array of words a count of the total number - * of times it occurs in this crawl model's default index. + * Computes for each word in an array of words a count of the total number + * of times it occurs in this crawl model's default index. * - * @param array $words words to find the counts for - * @param array $machine_urls machines to invoke this command on - * @return array associative array of word => counts + * @param array $words words to find the counts for + * @param array $machine_urls machines to invoke this command on + * @return array associative array of word => counts */ function countWords($words, $machine_urls = NULL) { diff --git a/models/cron_model.php b/models/cron_model.php index e12fd6fc1..7427aec0c 100644 --- a/models/cron_model.php +++ b/models/cron_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -58,7 +58,11 @@ class CronModel extends Model */ var $cron_table; /** - * {@inheritDoc} + * {@inheritDoc} + * + * @param string $db_name the name of the database for the search engine + * @param bool $connect whether to connect to the database by default + * after making the datasource class */ function __construct($db_name = DB_NAME, $connect = true) { @@ -67,10 +71,12 @@ class CronModel extends Model $this->cron_file = WORK_DIRECTORY."/data/cron_time.txt"; } /** - * Returns the timestamp of last time cron run. Not using db as sqlite - * seemed to have locking issues if the transaction takes a while + * Returns the timestamp of last time the $key field was updated in + * the cron_time.txt file associate array. Not using db as sqlite + * seemed to have locking issues if the transaction takes a while * - * @return int a Unix timestamp + * @param $key field to find last update of + * @return int a Unix timestamp */ function getCronTime($key) { @@ -99,10 +105,12 @@ class CronModel extends Model } /** * Updates the Cron timestamp to the current time. + * + * @param $key field to update time for * @param bool $transaction if you are doing a sequence of cron updates - * you can set this value to true so data is not immediately - * written to disk. Then you can write to disk using saveCronTable - * so only do one write. + * you can set this value to true so data is not immediately + * written to disk. Then you can write to disk using saveCronTable + * so only do one write. */ function updateCronTime($key, $transaction = false) { diff --git a/models/datasources/datasource_manager.php b/models/datasources/datasource_manager.php index d00808eb4..b397bd88a 100755 --- a/models/datasources/datasource_manager.php +++ b/models/datasources/datasource_manager.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -65,18 +65,18 @@ abstract class DatasourceManager * Connects to a database on a DBMS using data provided or from config.php * * @param string $db_host the hostname of where the database is located - * (not used in all dbms's) + * (not used in all dbms's) * @param string $db_user the user to connect as * @param string $db_password the password of the user to connect as * @param string $db_name the name of the database on host we are - * connecting to + * connecting to * @return mixed return false if not successful and some kind of - * connection object/identifier otherwise + * connection object/identifier otherwise */ abstract function connect($db_host = DB_HOST, $db_user = DB_USER, $db_password = DB_PASSWORD, $db_name = DB_NAME); /** - * Closes connections to DBMS + * Closes connections to DBMS * */ abstract function disconnect(); @@ -86,9 +86,11 @@ abstract class DatasourceManager * This method operates on either query or data manipulation statements * * @param string $sql SQL statement to execute + * @param array $params bind_name => value values to interpolate into + * the $sql to be executes * @return mixed false if query fails, resource or true otherwise */ - abstract function exec($sql); + abstract function exec($sql, $params = array()); /** * Returns the number of rows affected by the last sql statement * @@ -100,7 +102,7 @@ abstract class DatasourceManager * Returns the ID generated by the last insert statement * if table has an auto increment key column * - * @param string name of table of last insert + * @param string $table_name of table of last insert * @return string the ID of the insert */ abstract function insertID($table_name = ""); @@ -109,7 +111,7 @@ abstract class DatasourceManager * * @param resource $result result set reference of a query * @return array the next row from the result set as an - * associative array in the form column_name => value + * associative array in the form column_name => value */ abstract function fetchArray($result); /** @@ -127,8 +129,8 @@ abstract class DatasourceManager * This method operates either query or data manipulation statements * * @param string $sql SQL statement to execute - * @param array $param bind_name => value values to interpolate into - * the $sql to be executes + * @param array $params bind_name => value values to interpolate into + * the $sql to be executes * @return mixed false if query fails, resource or true otherwise */ function execute($sql, $params = array()) @@ -172,11 +174,17 @@ abstract class DatasourceManager /** * Returns arrays of filesizes and file modifcations times of files in * a directory + * + * @param string $dir directory to get filesizes for + * @param bool $rootToo whether to have an entry for the whole directory + * too + * @return array of fileinfo information for each file in the folder in + * question */ - function fileInfoRecursive($dir, $chmodRootToo = true) + function fileInfoRecursive($dir, $rootToo = true) { return $this->traverseDirectory($dir, - "fileInfo", $chmodRootToo); + "fileInfo", $rootToo); } /** * Recursively copies a source directory to a destination directory @@ -185,7 +193,7 @@ abstract class DatasourceManager * it was a little bit too much of a stretch to shoehorn the code to match * * @param string $source_dir the name of the source directory - * @param string $desitnation_dir the name of the destination directory + * @param string $destination_dir the name of the destination directory */ function copyRecursive($source_dir, $destination_dir) { @@ -219,6 +227,8 @@ abstract class DatasourceManager * * @param string $dir Directory name * @param function $callback Function to call as traverse structure + * @param bool $rootToo whether to have an apply the callback to the + * whole directory as well * @return array results computed by performing the traversal */ function traverseDirectory($dir, $callback, $rootToo = true) @@ -286,13 +296,13 @@ abstract class DatasourceManager return $auto_increment; } /** - * Used to return the database column type for a column that can be - * used to do autoincrementing. Usually this will just be INTEGER, - * however, for Postgres is SERIAL. + * Used to return the database column type for a column that can be + * used to do autoincrementing. Usually this will just be INTEGER, + * however, for Postgres is SERIAL. * - * @param array $dbinfo containing fields for the current DBMS - * (pdo for Postgres) and DB_HOST (DSN connection string to database) - * @return string what to use for serial data type + * @param array $dbinfo containing fields for the current DBMS + * (pdo for Postgres) and DB_HOST (DSN connection string to database) + * @return string what to use for serial data type */ function serialType($dbinfo) { @@ -303,19 +313,19 @@ abstract class DatasourceManager return $serial; } /** - * How a daabase can perform LIMIT OFFSET queries is not standardized - * between DBMS's. This method take a $limit, a $num, and a $dbinfo - * and returns the string that would restrict a query to show $num - * many rows starting at $limit. In the case that $num is not provided - * then it returns the string represent returning the first $limit many - * rows. In the case that $dbinfo is not provided the current Yioop - * default database is used. + * How a daabase can perform LIMIT OFFSET queries is not standardized + * between DBMS's. This method take a $limit, a $num, and a $dbinfo + * and returns the string that would restrict a query to show $num + * many rows starting at $limit. In the case that $num is not provided + * then it returns the string represent returning the first $limit many + * rows. In the case that $dbinfo is not provided the current Yioop + * default database is used. * - * @param int $limit starting row to return from - * @param int $num number of rows to return - * @param array $dbinfo containing fields for how tot connect to a database - * @return string what to use for for LIMIT OFFSET query with input $limit - * and $num for the DBMS in question + * @param int $limit starting row to return from + * @param int $num number of rows to return + * @param array $dbinfo containing fields for how tot connect to a database + * @return string what to use for for LIMIT OFFSET query with input $limit + * and $num for the DBMS in question */ function limitOffset($limit, $num = -1, $dbinfo = NULL) { diff --git a/models/datasources/mysql_manager.php b/models/datasources/mysql_manager.php index 38d379123..2f85efb25 100755 --- a/models/datasources/mysql_manager.php +++ b/models/datasources/mysql_manager.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Loads base datasource class if necessary + * Loads base datasource class if necessary */ require_once BASE_DIR."/models/datasources/pdo_manager.php"; /** @@ -57,11 +57,22 @@ require_once BASE_DIR."/models/datasources/pdo_manager.php"; class MysqlManager extends PdoManager { /** Used when to quote column names of db names that contain a - * a keyword or special character - * @var string + * a keyword or special character + * @var string */ var $special_quote = "`"; - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param string $db_host the hostname of where the database is located + * (not used in all dbms's) + * @param string $db_user the user to connect as + * @param string $db_password the password of the user to connect as + * @param string $db_name the name of the database on host we are + * connecting to + * @return mixed return false if not successful and some kind of + * connection object/identifier otherwise + */ function connect($db_host = DB_HOST, $db_user = DB_USER, $db_password = DB_PASSWORD, $db_name = DB_NAME) { diff --git a/models/datasources/pdo_manager.php b/models/datasources/pdo_manager.php index b2ab966db..549d0bcdf 100644 --- a/models/datasources/pdo_manager.php +++ b/models/datasources/pdo_manager.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Loads base datasource class if necessary + * Loads base datasource class if necessary */ require_once "datasource_manager.php"; /** @@ -51,8 +51,8 @@ require_once "datasource_manager.php"; class PdoManager extends DatasourceManager { /** - * Used to hold the PDO database object - * @var resource + * Used to hold the PDO database object + * @var resource */ var $pdo = NULL; /** @@ -61,13 +61,24 @@ class PdoManager extends DatasourceManager */ var $num_affected = 0; /** - * if DBMS is one like postgres which lower cases table names that aren't - * in quotes that this field has the name of the database; - * otherwise, false. + * If DBMS is one like postgres which lower cases table names that aren't + * in quotes that this field has the name of the database; + * otherwise, false. * @var mixed */ var $to_upper_dbms; - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param string $db_host the hostname of where the database is located + * (not used in all dbms's) + * @param string $db_user the user to connect as + * @param string $db_password the password of the user to connect as + * @param string $db_name the name of the database on host we are + * connecting to + * @return mixed return false if not successful and some kind of + * connection object/identifier otherwise + */ function connect($db_host = DB_HOST, $db_user = DB_USER, $db_password = DB_PASSWORD, $db_name = DB_NAME) { @@ -90,7 +101,14 @@ class PdoManager extends DatasourceManager unset($this->pdo); $this->pdo = NULL; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param string $sql SQL statement to execute + * @param array $params bind_name => value values to interpolate into + * the $sql to be executes + * @return mixed false if query fails, resource or true otherwise + */ function exec($sql, $params = array()) { static $last_sql = NULL; @@ -129,16 +147,27 @@ class PdoManager extends DatasourceManager { return $this->num_affected; } - /** {@inheritDoc} */ - function insertID($table = "") + /** + * {@inheritDoc} + * + * @param string $table_name of table of last insert + * @return string the ID of the insert + */ + function insertID($table_name = "") { - if($table && $this->to_upper_dbms == "PGSQL") { - $table .= "_ID_SEQ"; - return $this->pdo->lastInsertId($table); + if($table_name && $this->to_upper_dbms == "PGSQL") { + $table_name .= "_ID_SEQ"; + return $this->pdo->lastInsertId($table_name); } return $this->pdo->lastInsertId(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param resource $result result set reference of a query + * @return array the next row from the result set as an + * associative array in the form column_name => value + */ function fetchArray($result) { if(!$result) { @@ -154,7 +183,12 @@ class PdoManager extends DatasourceManager } return $out_row; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param string $str string to escape + * @return string a string which is safe to insert into the db + */ function escapeString($str) { return substr($this->pdo->quote($str), 1, -1); diff --git a/models/datasources/sqlite3_manager.php b/models/datasources/sqlite3_manager.php index 3568704fe..52952f377 100644 --- a/models/datasources/sqlite3_manager.php +++ b/models/datasources/sqlite3_manager.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Loads base datasource class if necessary + * Loads base datasource class if necessary */ require_once BASE_DIR."/models/datasources/pdo_manager.php"; /** @@ -68,14 +68,14 @@ class Sqlite3Manager extends PdoManager $this->db_name = NULL; } /** - * Select file name of database. If the - * @param string $db_host not used but in base constructor - * @param string $db_user not used but in base constructor - * @param string $db_password not used but in base constructor - * @param string $db_name filename of sqlite database. If the name - * does not contain any "/" symbols assume it is in the - * crawl directory data folder and we don't have a file extension; - * otherwise assume the name is a complete filepath + * Select file name of database. If the + * @param string $db_host not used but in base constructor + * @param string $db_user not used but in base constructor + * @param string $db_password not used but in base constructor + * @param string $db_name filename of sqlite database. If the name + * does not contain any "/" symbols assume it is in the + * crawl directory data folder and we don't have a file extension; + * otherwise assume the name is a complete filepath */ function connect($db_host = DB_HOST, $db_user = DB_USER, $db_password = DB_PASSWORD, $db_name = DB_NAME) diff --git a/models/group_model.php b/models/group_model.php index f918b40f2..ba4c52b13 100644 --- a/models/group_model.php +++ b/models/group_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Mallika Perepa, Chris Pollett * @package seek_quarry @@ -52,11 +52,11 @@ require_once BASE_DIR."/lib/wiki_parser.php"; class GroupModel extends Model { /** - * Associations of the form - * name of field for web forms => database column names/abbreviations - * In this case, things will in general map to the GROUPS, or USER_GROUP - * or GROUP_ITEM tables in the Yioop database - * @var array + * Associations of the form + * name of field for web forms => database column names/abbreviations + * In this case, things will in general map to the GROUPS, or USER_GROUP + * or GROUP_ITEM tables in the Yioop database + * @var array */ var $search_table_column_map = array("access"=>"G.MEMBER_ACCESS", "group_id"=>"G.GROUP_ID", "post_id" => "GI.ID", @@ -66,18 +66,18 @@ class GroupModel extends Model "register"=>"G.REGISTER_TYPE", "status"=>"UG.STATUS", "user_id"=>"P.USER_ID"); /** - * These fields if present in $search_array (used by @see getRows() ), - * but with value "0", will be skipped as part of the where clause - * but will be used for order by clause - * @var array + * These fields if present in $search_array (used by @see getRows() ), + * but with value "0", will be skipped as part of the where clause + * but will be used for order by clause + * @var array */ var $any_fields = array("access", "register"); /** - * Used to determine the select clause for GROUPS table when do query - * to marshal group objects for the controller mainly in mangeGroups - * @param mixed $args -- $args[1] say whether in browse mode or not - * browse mode is for groups a user could join rather than ones already - * joined + * Used to determine the select clause for GROUPS table when do query + * to marshal group objects for the controller mainly in mangeGroups + * @param mixed $args We use $args[1] to say whether in browse mode or not. + * browse mode is for groups a user could join rather than ones already + * joined */ function selectCallback($args) { @@ -98,24 +98,29 @@ class GroupModel extends Model G.MEMBER_ACCESS $join_date"; return $select; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param mixed $args any additional arguments which should be used to + * determine these tables (in this case none) + */ function fromCallback($args) { return "GROUPS G, USER_GROUP UG, USERS O"; } /** - * Used to restrict getRows in which rows it returns. Rows in this - * case corresponding to Yioop groups. The restrictions added are to - * restrict to those group available to a given user_id and whether or - * not the user wants groups subscribed to, or groups that could be - * subscribed to + * Used to restrict getRows in which rows it returns. Rows in this + * case corresponding to Yioop groups. The restrictions added are to + * restrict to those group available to a given user_id and whether or + * not the user wants groups subscribed to, or groups that could be + * subscribed to * - * @param array $args first two elements are the $user_id of the user - * and the $browse flag which says whether or not user is browing - * through all groups to which he could subscribe and read or - * just those groups to which he is alrady subscribed. - * @return string a SQL WHERE clause suitable to perform the above - * restrictions + * @param array $args first two elements are the $user_id of the user + * and the $browse flag which says whether or not user is browing + * through all groups to which he could subscribe and read or + * just those groups to which he is alrady subscribed. + * @return string a SQL WHERE clause suitable to perform the above + * restrictions */ function whereCallback($args) { @@ -136,13 +141,13 @@ class GroupModel extends Model return $where; } /** - * Get an array of users that belong to a group + * Get an array of users that belong to a group * - * @param string $group_id the group_id to get users for - * @param string $filter to LIKE filter users - * @param int $limit first user to get - * @param int $num number of users to return - * @return array of USERS rows + * @param string $group_id the group_id to get users for + * @param string $filter to LIKE filter users + * @param int $limit first user to get + * @param int $num number of users to return + * @return array of USERS rows */ function getGroupUsers($group_id, $filter, $limit, $num = NUM_RESULTS_PER_PAGE) @@ -170,12 +175,12 @@ class GroupModel extends Model return $users; } /** - * Get the number of users which belong to a group and whose user_name - * matches a filter + * Get the number of users which belong to a group and whose user_name + * matches a filter * - * @param int $group_id id of the group to get a count of - * @param string $filter to filter usernames by - * @return int count of matching users + * @param int $group_id id of the group to get a count of + * @param string $filter to filter usernames by + * @return int count of matching users */ function countGroupUsers($group_id, $filter="") { @@ -197,12 +202,18 @@ class GroupModel extends Model return $row['NUM']; } /** - * Add a groupname to the database using provided string + * Add a groupname to the database using provided string * - * @param string $group_name the groupname to be added + * @param string $group_name the groupname to be added + * @param int $user_id user identifier of who owns the group + * @param int $register flag that says what kinds of registration are + * allowed for this group NO_JOIN, REQUEST_JOIN, PUBLIC_JOIN + * @param int $member flag that says how members other than the owner can + * access this group GROUP_READ, GROUP_READ_COMMENT (can comment + * on threads but not start. i.e., a blog), GROUP_READ_WRITE */ function addGroup($group_name, $user_id, $register = REQUEST_JOIN, - $member=GROUP_READ) + $member = GROUP_READ) { $db = $this->db; $timestamp = microTimestamp(); @@ -225,12 +236,12 @@ class GroupModel extends Model return $last_id; } /** - * Takes the passed associated array $group representing changes - * fields of a GROUPS row, and executes an UPDATE statement to persist - * those changes fields to the database. + * Takes the passed associated array $group representing changes + * fields of a GROUPS row, and executes an UPDATE statement to persist + * those changes fields to the database. * - * @param array $group associative array with a GROUP_ID as well as the - * fields to update + * @param array $group associative array with a GROUP_ID as well as the + * fields to update */ function updateGroup($group) { @@ -254,14 +265,14 @@ class GroupModel extends Model $db->execute($sql, $params); } /** - * Check is a user given by $user_id belongs to a group given - * by $group_id. If the field $status is sent then check if belongs - * to the group with $status access (active, invited, request, banned) + * Check is a user given by $user_id belongs to a group given + * by $group_id. If the field $status is sent then check if belongs + * to the group with $status access (active, invited, request, banned) * - * @param int $user_id user to look up - * @param int $group_id group to check if member of - * @param int $status membership type - * @return bool whether or not is a member + * @param int $user_id user to look up + * @param int $group_id group to check if member of + * @param int $status membership type + * @return bool whether or not is a member */ function checkUserGroup($user_id, $group_id, $status = -1) { @@ -283,11 +294,11 @@ class GroupModel extends Model return true; } /** - * Change the status of a user in a group + * Change the status of a user in a group * - * @param int $user_id of user to change - * @param int $group_id of group to change status for - * @pram int $status what the new status should be + * @param int $user_id of user to change + * @param int $group_id of group to change status for + * @param int $status what the new status should be */ function updateStatusUserGroup($user_id, $group_id, $status) { @@ -314,10 +325,10 @@ class GroupModel extends Model return $row['GROUP_ID']; } /** - * Delete a group from the database and any associated data in - * GROUP_ITEM and USER_GROUP tables. + * Delete a group from the database and any associated data in + * GROUP_ITEM and USER_GROUP tables. * - * @param string $group_id id of the group to delete + * @param string $group_id id of the group to delete */ function deleteGroup($group_id) { @@ -333,12 +344,12 @@ class GroupModel extends Model $db->execute($sql, $params); } /** - * Return the type of the registration for a group given by $group_id - * This says who is allowed to register for the group (i.e., is it - * by invitation only, by request, or anyone can join) + * Return the type of the registration for a group given by $group_id + * This says who is allowed to register for the group (i.e., is it + * by invitation only, by request, or anyone can join) * - * @param int $group_id which group to find the type of - * @return int the numeric code for the registration type + * @param int $group_id which group to find the type of + * @return int the numeric code for the registration type */ function getRegisterType($group_id) { @@ -352,13 +363,13 @@ class GroupModel extends Model return $row['REGISTER_TYPE']; } /** - * Returns information about the group with id $group_id provided - * that the requesting user $user_id has access to it + * Returns information about the group with id $group_id provided + * that the requesting user $user_id has access to it * - * @param int $group_id id of group to look up - * @param int $user_id user asking for group info - * @return array row from group table or false (if no access or doesn't - * exists) + * @param int $group_id id of group to look up + * @param int $user_id user asking for group info + * @return array row from group table or false (if no access or doesn't + * exists) */ function getGroupById($group_id, $user_id) { @@ -390,15 +401,15 @@ class GroupModel extends Model return $group; } /** - * Get a list of all groups which user_id belongs to. Group names - * are not localized since these are - * created by end user admins of the search engine + * Get a list of all groups which user_id belongs to. Group names + * are not localized since these are + * created by end user admins of the search engine * - * @param int $user_id to get groups for - * @param string $filter to LIKE filter groups - * @param int $limit first user to get - * @param int $num number of users to return - * @return array an array of group_id, group_name pairs + * @param int $user_id to get groups for + * @param string $filter to LIKE filter groups + * @param int $limit first user to get + * @param int $num number of users to return + * @return array an array of group_id, group_name pairs */ function getUserGroups($user_id, $filter, $limit, $num = NUM_RESULTS_PER_PAGE) @@ -426,11 +437,11 @@ class GroupModel extends Model return $groups; } /** - * Get a count of the number of groups to which user_id belongs. + * Get a count of the number of groups to which user_id belongs. * - * @param int $user_id to get groups for - * @param string $filter to LIKE filter groups - * @return int number of groups of the filtered type for the user + * @param int $user_id to get groups for + * @param string $filter to LIKE filter groups + * @return int number of groups of the filtered type for the user */ function countUserGroups($user_id, $filter="") { @@ -452,10 +463,10 @@ class GroupModel extends Model return $row['NUM']; } /** - * To update the OWNER_ID of a group + * To update the OWNER_ID of a group * - * @param string $groupid the group id to transfer admin privileges - * @param string $userid the id of the user who becomes the admin of group + * @param string $group_id the group id to transfer admin privileges + * @param string $user_id the id of the user who becomes the admin of group */ function changeOwnerGroup($user_id, $group_id) { @@ -464,10 +475,13 @@ class GroupModel extends Model $db->execute($sql, array($user_id, $group_id)); } /** - * Add an allowed user to an existing group + * Add an allowed user to an existing group * - * @param string $userid the id of the user to add - * @param string $groupid the group id of the group to add the user to + * @param string $user_id the id of the user to add + * @param string $group_id the group id of the group to add the user to + * @param int $status what should be the membership status of the added + * user. Should be one of ACTIVE_STATUS, INACTIVE_STATUS, + * BANNED_STATUS, INVITED_STATUS */ function addUserGroup($user_id, $group_id, $status = ACTIVE_STATUS) { @@ -477,12 +491,12 @@ class GroupModel extends Model $db->execute($sql, array($user_id, $group_id, $status, $join_date)); } /** - * Checks if a user belongs to a group but is not the owner of that group - * Such a user could be deleted from the group + * Checks if a user belongs to a group but is not the owner of that group + * Such a user could be deleted from the group * - * @param int $user_id which user to look up - * @param int $group_id which group to look up for - * @return bool where user is deletable + * @param int $user_id which user to look up + * @param int $group_id which group to look up for + * @return bool where user is deletable */ function deletableUser($user_id, $group_id) { @@ -499,10 +513,10 @@ class GroupModel extends Model return true; } /** - * Delete a user from a group by userid an groupid + * Delete a user from a group by userid an groupid * - * @param string $userid the userid of the user to delete - * @param string $groupid the group id of the group to delete + * @param string $user_id the userid of the user to delete + * @param string $group_id the group id of the group to delete */ function deleteUserGroup($user_id, $group_id) { @@ -511,10 +525,10 @@ class GroupModel extends Model $db->execute($sql, array($user_id, $group_id)); } /** - * Returns the GROUP_FEED item with the given id + * Returns the GROUP_FEED item with the given id * - * @param int $item_id the item to get info about - * @return array row from GROUP_FEED table + * @param int $item_id the item to get info about + * @return array row from GROUP_FEED table */ function getGroupItem($item_id) { @@ -526,14 +540,17 @@ class GroupModel extends Model return $row; } /** - * Creates a new group item + * Creates a new group item * - * @param int $parent_id thread id to use for the item - * @param int $group_id what group the item should be added to - * @param int $user_id of user making the post - * @param string $title title of the group feed item - * @param string $description actual content of the post - * @return int $id of item added + * @param int $parent_id thread id to use for the item + * @param int $group_id what group the item should be added to + * @param int $user_id of user making the post + * @param string $title title of the group feed item + * @param string $description actual content of the post + * @param int $type flag saying what kind of group item this is. One of + * STANDARD_GROUP_ITEM, WIKI_GROUP_ITEM (used for threads discussing + * a wiki page) + * @return int $id of item added */ function addGroupItem($parent_id, $group_id, $user_id, $title, $description, $type= STANDARD_GROUP_ITEM) @@ -553,12 +570,12 @@ class GroupModel extends Model return $id; } /** - * Updates a group feed item's title and description. This assumes - * the given item already exists. + * Updates a group feed item's title and description. This assumes + * the given item already exists. * - * @param int $post_id which item to change - * @param string $title the new title - * @pararm string $description the new description + * @param int $id which item to change + * @param string $title the new title + * @param string $description the new description */ function updateGroupItem($id, $title, $description) { @@ -571,8 +588,8 @@ class GroupModel extends Model * * @param int $post_id of item to remove * @param int $user_id the id of the person trying to perform the - * removal. If not root, or the original creator of the item, - * the item won'r be removed + * removal. If not root, or the original creator of the item, + * the item won'r be removed */ function deleteGroupItem($post_id, $user_id) { @@ -589,20 +606,20 @@ class GroupModel extends Model return $db->affectedRows(); } /** - * Gets the group feed items visible to a user with $user_id - * and which match the supplied search criteria found in $search_array, - * starting from the $limit'th matching item to the $limit+$num item. + * Gets the group feed items visible to a user with $user_id + * and which match the supplied search criteria found in $search_array, + * starting from the $limit'th matching item to the $limit+$num item. * - * @param int $limit starting offset group item to display - * @param int $num number of items from offset to display - * @param array $search_array each element of this is a quadruple - * name of a field, what comparison to perform, a value to check, - * and an order (ascending/descending) to sort by - * @param int $user_id who is making this request to determine which - * @param int $for_group if this value is set it is a assumed - * that group_items are being returned for only one group - * and that they should be grouped by thread - * @return array elements of which represent one group feed item + * @param int $limit starting offset group item to display + * @param int $num number of items from offset to display + * @param array $search_array each element of this is a quadruple + * name of a field, what comparison to perform, a value to check, + * and an order (ascending/descending) to sort by + * @param int $user_id who is making this request to determine which + * @param int $for_group if this value is set it is a assumed + * that group_items are being returned for only one group + * and that they should be grouped by thread + * @return array elements of which represent one group feed item */ function getGroupItems($limit = 0, $num = 100, $search_array = array(), $user_id = ROOT_ID, $for_group = -1) @@ -671,19 +688,19 @@ class GroupModel extends Model return $groups; } /** - * Gets the number of group feed items visible to a user with $user_id - * and which match the supplied search criteria found in $search_array + * Gets the number of group feed items visible to a user with $user_id + * and which match the supplied search criteria found in $search_array * - * @param array $search_array each element of this is a quadruple - * name of a field, what comparison to perform, a value to check, - * and an order (ascending/descending) to sort by - * @param int $user_id who is making this request to determine which - * @param int $for_group if this value is set it is a assumed - * that group_items are being returned for only one group - * and that the count desrired is over the number of threads in that - * group - * @return int number of items matching the search criteria for the - * given user_id + * @param array $search_array each element of this is a quadruple + * name of a field, what comparison to perform, a value to check, + * and an order (ascending/descending) to sort by + * @param int $user_id who is making this request to determine which + * @param int $for_group if this value is set it is a assumed + * that group_items are being returned for only one group + * and that the count desrired is over the number of threads in that + * group + * @return int number of items matching the search criteria for the + * given user_id */ function getGroupItemCount($search_array = array(), $user_id = ROOT_ID, $for_group = -1) @@ -721,28 +738,28 @@ class GroupModel extends Model return $row['NUM']; } /** - * Used to add a wiki page revision by a given user to a wiki page - * of a given name in a given group viewing the group under a given - * language. If the page does not exist yet it, and its corresponding - * discussion thread is created. Two pages are used for storage - * GROUP_PAGE which contains a parsed to html version of the most recent - * revision of a wiki page and GROUP_PAGE_HISTORY which contains non-parsed - * versions of all revisions + * Used to add a wiki page revision by a given user to a wiki page + * of a given name in a given group viewing the group under a given + * language. If the page does not exist yet it, and its corresponding + * discussion thread is created. Two pages are used for storage + * GROUP_PAGE which contains a parsed to html version of the most recent + * revision of a wiki page and GROUP_PAGE_HISTORY which contains non-parsed + * versions of all revisions * - * @param int $user_id identifier of who is adding this revision - * @param int $group_id which group the wiki page revision if being done in - * @param string $page_name title of page being revised - * @param string $page wiki page with potential wiki mark up containing the - * revision - * @param string $locale_tag locale we are adding the revision to - * @param string $edit_comment user's reason for making the revision - * @param string $thread_title if this is the first revision, then this - * should contain the title for the discussion thread about the - * revision - * @param string $thread_description if this is the first revision, then - * this should be the body of the first post in discussion thread - * @param string $base_address default url to be used in links - * on wiki page that use short syntax + * @param int $user_id identifier of who is adding this revision + * @param int $group_id which group the wiki page revision if being done in + * @param string $page_name title of page being revised + * @param string $page wiki page with potential wiki mark up containing the + * revision + * @param string $locale_tag locale we are adding the revision to + * @param string $edit_comment user's reason for making the revision + * @param string $thread_title if this is the first revision, then this + * should contain the title for the discussion thread about the + * revision + * @param string $thread_description if this is the first revision, then + * this should be the body of the first post in discussion thread + * @param string $base_address default url to be used in links + * on wiki page that use short syntax */ function setPageName($user_id, $group_id, $page_name, $page, $locale_tag, $edit_comment, $thread_title, $thread_description, $base_address = "") @@ -771,14 +788,14 @@ class GroupModel extends Model $page_name, $page, $locale_tag, $pubdate, $edit_comment)); } /** - * Looks up the page_id of a wiki page based on the group it belongs to, - * its title, and the language it is in (these three things together - * should uniquely fix a page). + * Looks up the page_id of a wiki page based on the group it belongs to, + * its title, and the language it is in (these three things together + * should uniquely fix a page). * - * @param int $group_id group identifier of group wiki page belongs to - * @param string $name title of wiki page to look up - * @param string $locale_tag IANA language tag of page to lookup - * @return mixed $page_id of page if exists, false otherwise + * @param int $group_id group identifier of group wiki page belongs to + * @param string $page_name title of wiki page to look up + * @param string $locale_tag IANA language tag of page to lookup + * @return mixed $page_id of page if exists, false otherwise */ function getPageId($group_id, $page_name, $locale_tag) { @@ -794,18 +811,18 @@ class GroupModel extends Model return false; } /** - * Return the page id, page string, and discussion thread id of the - * most recent revision of a wiki page + * Return the page id, page string, and discussion thread id of the + * most recent revision of a wiki page * - * @param int $group_id group identifier of group wiki page belongs to - * @param string $name title of wiki page to look up - * @param string $locale_tag IANA language tag of page to lookup - * @param string mode if "edit" we assume we are looking up the page - * so that it can be edited and so we return the most recent non-parsed - * revision of the page. Otherwise, we assume the page is meant to be - * read and so we return the variant of the page where wiki markup - * has already been replaced with HTML - * @return array (page_id, page, discussion_id) of desired wiki page + * @param int $group_id group identifier of group wiki page belongs to + * @param string $name title of wiki page to look up + * @param string $locale_tag IANA language tag of page to lookup + * @param string $mode if "edit" we assume we are looking up the page + * so that it can be edited and so we return the most recent non-parsed + * revision of the page. Otherwise, we assume the page is meant to be + * read and so we return the variant of the page where wiki markup + * has already been replaced with HTML + * @return array (page_id, page, discussion_id) of desired wiki page */ function getPageInfoByName($group_id, $name, $locale_tag, $mode) { @@ -829,11 +846,11 @@ class GroupModel extends Model return $row; } /** - * Returns the group_id, language, and page name of a wiki page - * corresponding to a page discussion thread with id $page_thread_id - * @param int $page_thread_id the id of a wiki page discussion thread - * to look up page info for - * @return array(group_id, language, and page name) of that wiki page + * Returns the group_id, language, and page name of a wiki page + * corresponding to a page discussion thread with id $page_thread_id + * @param int $page_thread_id the id of a wiki page discussion thread + * to look up page info for + * @return array(group_id, language, and page name) of that wiki page */ function getPageInfoByThread($page_thread_id) { @@ -849,10 +866,10 @@ class GroupModel extends Model return $row; } /** - * Returns the group_id, language, and page name of a wiki page - * corresponding to $page_id - * @param int $page_id to look up page info for - * @return array(group_id, language, and page name) of that wiki page + * Returns the group_id, language, and page name of a wiki page + * corresponding to $page_id + * @param int $page_id to look up page info for + * @return array(group_id, language, and page name) of that wiki page */ function getPageInfoByPageId($page_id) { @@ -868,12 +885,12 @@ class GroupModel extends Model return $row; } /** - * Returns an historical revision of a wiki page + * Returns an historical revision of a wiki page * - * @param int $page_id identifier of wiki page want revision for - * @param int $pubdate timestamp of revision desired - * @return array (id, non-parsed wiki page, page_name, - * discussion thread id) of page revision + * @param int $page_id identifier of wiki page want revision for + * @param int $pubdate timestamp of revision desired + * @return array (id, non-parsed wiki page, page_name, + * discussion thread id) of page revision */ function getHistoryPage($page_id, $pubdate) { @@ -891,15 +908,15 @@ class GroupModel extends Model return $row; } /** - * Returns a list of revision history info for a wiki page. + * Returns a list of revision history info for a wiki page. * - * @param int $page_id indentifier for page want revision history of - * @param string $limit first row we want from the result set - * @param string $num number of rows we want starting from the first row - * in the result set - * @return array elements of which are array with the revision date - * (PUBDATE), user name, page length, edit reason for the wiki pages - * revision + * @param int $page_id indentifier for page want revision history of + * @param string $limit first row we want from the result set + * @param string $num number of rows we want starting from the first row + * in the result set + * @return array elements of which are array with the revision date + * (PUBDATE), user name, page length, edit reason for the wiki pages + * revision */ function getPageHistoryList($page_id, $limit, $num) { @@ -935,18 +952,18 @@ class GroupModel extends Model return array($total, $page_name, $pages); } /** - * Returns a list of applicable wiki pages of a group + * Returns a list of applicable wiki pages of a group * - * @param int $group_id of group want list of wiki pages for - * @param string $locale_tag language want wiki page list for - * @param string $filter string we want to filter wiki page title by - * @param string $limit first row we want from the result set - * @param string $num number of rows we want starting from the first row - * in the result set - * @return array a pair ($total, $pages) where $total is the total number - * of rows that could be returned if $limit and $num not present - * $pages is an array each of whose elements is an array corresponding - * to one TITLE and the first 100 chars out of a wiki page. + * @param int $group_id of group want list of wiki pages for + * @param string $locale_tag language want wiki page list for + * @param string $filter string we want to filter wiki page title by + * @param string $limit first row we want from the result set + * @param string $num number of rows we want starting from the first row + * in the result set + * @return array a pair ($total, $pages) where $total is the total number + * of rows that could be returned if $limit and $num not present + * $pages is an array each of whose elements is an array corresponding + * to one TITLE and the first 100 chars out of a wiki page. */ function getPageList($group_id, $locale_tag, $filter, $limit, $num) { diff --git a/models/locale_model.php b/models/locale_model.php index 12ff5e5c9..05216b965 100755 --- a/models/locale_model.php +++ b/models/locale_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -42,7 +42,7 @@ require_once BASE_DIR."/lib/url_parser.php"; * @param array $b an associative array of locale info * * @return int -1, 0, or 1 depending on which is alphabetically smaller or if - * they are the same size + * they are the same size */ function lessThanLocale($a, $b) { if ($a["LOCALE_TAG"] == $b["LOCALE_TAG"]) { @@ -99,36 +99,43 @@ class LocaleModel extends Model */ var $extensions = array("php"); /** - * Associations of the form - * name of field for web forms => database column names/abbreviations - * In this case, things will in general map to the LOCALES tables in the - * Yioop database - * @var array + * Associations of the form + * name of field for web forms => database column names/abbreviations + * In this case, things will in general map to the LOCALES tables in the + * Yioop database + * @var array */ var $search_table_column_map = array("name"=>"LOCALE_NAME", "tag"=>"LOCALE_TAG", "mode" => "WRITING_MODE"); /** - * These fields if present in $search_array (used by @see getRows() ), - * but with value "0", will be skipped as part of the where clause - * but will be used for order by clause + * These fields if present in $search_array (used by @see getRows() ), + * but with value "0", will be skipped as part of the where clause + * but will be used for order by clause * @var array */ var $any_fields = array("mode"); - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param mixed $args any additional arguments which should be used to + * determine the columns + * @return string a comma separated list of columns suitable for a SQL + * query + */ function selectCallback($args = NULL) { return "LOCALE_ID, LOCALE_TAG, LOCALE_NAME, WRITING_MODE"; } /** - * This is called after each row is retrieved by getRows. This method - * Then reads in the corresponding statistics.txt file (or rebuilds - * it from the configure.ini file if it is out of date) to add to the - * row percent translated info. + * This is called after each row is retrieved by getRows. This method + * Then reads in the corresponding statistics.txt file (or rebuilds + * it from the configure.ini file if it is out of date) to add to the + * row percent translated info. * - * @param string $locale one getRows row corresponding to a given locale - * @param mixed $args additional arguments that might be used for this - * method (none used for this sub-class) - * @return $locale row with PERCENT_WITH_STRINGS field added + * @param string $locale one getRows row corresponding to a given locale + * @param mixed $args additional arguments that might be used for this + * method (none used for this sub-class) + * @return $locale row with PERCENT_WITH_STRINGS field added */ function rowCallback($locale, $args) { @@ -171,7 +178,7 @@ class LocaleModel extends Model * (for to format numbers, etc.) * * @param string $locale_tag the tag of the locale to use as the current - * locale + * locale */ function initialize($locale_tag) { @@ -202,9 +209,9 @@ class LocaleModel extends Model } /** - * Returns information about all available locales + * Returns information about all available locales * - * @return array rows of locale information + * @return array rows of locale information */ function getLocaleList() { @@ -257,10 +264,10 @@ class LocaleModel extends Model } /** - * Check if there is a locale with tag equal to $locale_tag + * Check if there is a locale with tag equal to $locale_tag * - * @param string $locale_tag to check for - * @return bool whether or not has exists + * @param string $locale_tag to check for + * @return bool whether or not has exists */ function checkLocaleExists($locale_tag) { @@ -278,10 +285,10 @@ class LocaleModel extends Model return true; } /** - * Returns the locale name, tag, and writing mode for tag $locale_tag + * Returns the locale name, tag, and writing mode for tag $locale_tag * - * @param string $locale_tag to get name for - * @return string name of locale + * @param string $locale_tag to get name for + * @return string name of locale */ function getLocaleInfo($locale_tag) { @@ -296,10 +303,10 @@ class LocaleModel extends Model return $row; } /** - * Returns the name of the locale for tag $locale_tag + * Returns the name of the locale for tag $locale_tag * - * @param string $locale_tag to get name for - * @return string name of locale + * @param string $locale_tag to get name for + * @return string name of locale */ function getLocaleName($locale_tag) { @@ -317,10 +324,10 @@ class LocaleModel extends Model * Adds information concerning a new locale to the database * * @param string $locale_name the name of the locale in the locale's - * language + * language * @param string $locale_tag the IANA langauge tag for the locale * @param string $writing_mode a combination of the horizontal and - * vertical text direction used for writing in the locale + * vertical text direction used for writing in the locale */ function addLocale($locale_name, $locale_tag, $writing_mode) { @@ -334,9 +341,9 @@ class LocaleModel extends Model } } /** - * Remove a locale from the database + * Remove a locale from the database * - * @param string $locale_tag the IANA language tag for the locale to remove + * @param string $locale_tag the IANA language tag for the locale to remove */ function deleteLocale($locale_tag) { @@ -347,10 +354,10 @@ class LocaleModel extends Model } } /** - * Used to update the fields stored in a LOCALE row according to - * an array holding new values + * Used to update the fields stored in a LOCALE row according to + * an array holding new values * - * @param array $locale_indo updated values for a LOCALE row + * @param array $locale_info updated values for a LOCALE row */ function updateLocaleInfo($locale_info) { @@ -375,8 +382,8 @@ class LocaleModel extends Model * return its name together with its translation into the given locale * if such a translation exists. * - * @param string $locale_tag the IANA language tag to translate string into - * @return array rows of identfier string - translation pairs + * @param string $locale_tag the IANA language tag to translate string into + * @return array rows of identfier string - translation pairs */ function getStringData($locale_tag) { @@ -450,7 +457,7 @@ class LocaleModel extends Model } /** * Translate an array consisting of an identifier string together with - * additional variable parameters into the current locale. + * additional variable parameters into the current locale. * * Suppose the identifier string was some_view_fraction_received and two * additional arguments 5 and 10 were given. Suppose further that its @@ -458,10 +465,10 @@ class LocaleModel extends Model * Then the string returned by translate would be "5 out of 10". * * @param array $arr an array consisting of an identifier string followed - * optionally by parameter values. + * optionally by parameter values. * @return mixed the translation of the identifier string into the - * current locale where all %s have been replaced by the corresponding - * parameter values. Returns false if no translation + * current locale where all %s have been replaced by the corresponding + * parameter values. Returns false if no translation */ function translate($arr) { if(!is_array($arr)) {return; } @@ -484,18 +491,18 @@ class LocaleModel extends Model return $msg_string; } /** - * Get the current IANA language tag being used by the search engine + * Get the current IANA language tag being used by the search engine * - * @return string an IANA language tag + * @return string an IANA language tag */ function getLocaleTag() { return $this->locale_tag; } /** - * The text direction of the current locale being used by the text engine + * The text direction of the current locale being used by the text engine * - * @return string either ltr (left-to-right) or rtl (right-to-left) + * @return string either ltr (left-to-right) or rtl (right-to-left) */ function getLocaleDirection() { @@ -521,7 +528,7 @@ class LocaleModel extends Model * the current locale * * @return string a direction which is one of tb -- top-bottom, - * rl -- right-to-left, or lr -- left-to-right + * rl -- right-to-left, or lr -- left-to-right */ function getBlockProgression() { @@ -558,10 +565,10 @@ class LocaleModel extends Model * translation the translation is untouched by this process). * * @param array $force_folders which locale subfolders should be forced - * updated to the fallback dir's version + * updated to the fallback dir's version * * @return array a pair consisting of the data from the general.ini file - * together with an array of msg_ids msg_strings. + * together with an array of msg_ids msg_strings. */ function extractMergeLocales($force_folders = array()) { @@ -574,18 +581,18 @@ class LocaleModel extends Model return array($general_ini, $strings); } /** - * Cycles through locale subdirectories in LOCALE_DIR, for each - * locale it merges out the current general_ini and strings data. - * It deletes identifiers that are not in strings, it adds new identifiers - * and it leaves existing identifier translation pairs untouched. + * Cycles through locale subdirectories in LOCALE_DIR, for each + * locale it merges out the current general_ini and strings data. + * It deletes identifiers that are not in strings, it adds new identifiers + * and it leaves existing identifier translation pairs untouched. * * @param array $general_ini data that would typically come from the - * general.ini file - * @param array $string lines from what is equivalent to an ini file - * of msg_id msg_string pairs these lines also have comments on the - * file that strings were extracted from + * general.ini file + * @param array $strings lines from what is equivalent to an ini file + * of msg_id msg_string pairs these lines also have comments on the + * file that strings were extracted from * @param array $force_folders which locale subfolders should be forced - * updated to the fallback dir's version + * updated to the fallback dir's version * */ function updateLocales($general_ini, $strings, $force_folders = array()) @@ -619,13 +626,13 @@ class LocaleModel extends Model * * @param array $general_ini data from the general.ini file * @param array $strings line array data extracted from files in - * directories that have strings in need of translation + * directories that have strings in need of translation * @param string $dir the directory of all the locales * @param string $locale the particular locale in $dir to update * @param array $new_configure translations of identifier strings from - * another source such as a localizer using a web form + * another source such as a localizer using a web form * @param array $force_folders which locale subfolders should be forced - * updated to the fallback dir's version + * updated to the fallback dir's version */ function updateLocale($general_ini, $strings, $dir, $locale, $new_configure = NULL, $force_folders = array()) @@ -706,19 +713,19 @@ EOT; file_put_contents($cur_path.'/configure.ini', $out); } /** - * Computes a string of the form string_id = 'translation' for a string_id - * from among translation array data in $new_configure (most preferred, - * probably come from recent web form data), $old_configure - * (probably from work dir), and $fallback_configure (probably from base - * dir of Yioop instance, least preferred). + * Computes a string of the form string_id = 'translation' for a string_id + * from among translation array data in $new_configure (most preferred, + * probably come from recent web form data), $old_configure + * (probably from work dir), and $fallback_configure (probably from base + * dir of Yioop instance, least preferred). * - * @param array $new_configure string_id => translation pairs - * @param array $old_configure string_id => translation pairs - * @param array $fallback_configure string_id => translation pairs - * @param string $string_id an id to translate - * @param string $default_value value to use if no configuration - * has a translation for a string_id - * @return string translation in format describe above + * @param array $new_configure string_id => translation pairs + * @param array $old_configure string_id => translation pairs + * @param array $fallback_configure string_id => translation pairs + * @param string $string_id an id to translate + * @param string $default_value value to use if no configuration + * has a translation for a string_id + * @return string translation in format describe above */ function updateTranslation($new_configure, $old_configure, $fallback_configure, $string_id, $default_value = "") @@ -729,18 +736,18 @@ EOT; return $translation; } /** - * Translates a string_id from among translation array data in - * $new_configure (most preferred, probably come from recent web form - * data), $old_configure (probably from work dir), and $fallback_configure - * (probably from base dir of Yioop instance, least preferred). + * Translates a string_id from among translation array data in + * $new_configure (most preferred, probably come from recent web form + * data), $old_configure (probably from work dir), and $fallback_configure + * (probably from base dir of Yioop instance, least preferred). * - * @param array $new_configure string_id => translation pairs - * @param array $old_configure string_id => translation pairs - * @param array $fallback_configure string_id => translation pairs - * @param string $string_id an id to translate - * @param string $default_value value to use if no configuration - * has a translation for a string_id - * @return string translation of string id + * @param array $new_configure string_id => translation pairs + * @param array $old_configure string_id => translation pairs + * @param array $fallback_configure string_id => translation pairs + * @param string $string_id an id to translate + * @param string $default_value value to use if no configuration + * has a translation for a string_id + * @return string translation of string id */ function lookupTranslation($new_configure, $old_configure, $fallback_configure, $string_id, $default_value = "") @@ -764,7 +771,7 @@ EOT; * * @param string $string_id what to check if translated * @param array $translations of form string_id => translation - * defaults to current configuration + * defaults to current configuration * @return bool whether a translation of nonzero length exists */ function isTranslated($string_id, $translations = false) @@ -776,16 +783,16 @@ EOT; strlen($translations[$string_id]) > 0; } /** - * Copies over subfolder items of the correct file extensions - * which exists in a fallback directory, but not in the actual directory - * of a locale. + * Copies over subfolder items of the correct file extensions + * which exists in a fallback directory, but not in the actual directory + * of a locale. * - * @param string $locale_pages_path static page directory to which will - * copy - * @param string $fallback_pages_path static page directory from which will - * copy - * @param array $file_extensions an array of strings names of file - * extensions for example: .txt.gz .thtml .php ,etc + * @param string $locale_pages_path static page directory to which will + * copy + * @param string $fallback_pages_path static page directory from which will + * copy + * @param array $file_extensions an array of strings names of file + * extensions for example: .txt.gz .thtml .php ,etc */ function updateLocaleSubFolder($locale_pages_path, $fallback_pages_path, $file_extensions) { @@ -818,9 +825,9 @@ EOT; * configure.ini files in the locale directory * * @param array $extract_dirs directories to start looking for files with - * strings to be translated + * strings to be translated * @param array $extensions file extensions of files which might contain - * such strings + * such strings * @return array of lines for any ini file of msg_id msg_string pairs */ function getTranslateStrings($extract_dirs, $extensions) @@ -850,9 +857,9 @@ EOT; * line file and line number of the item to be translated * * @param string $dir current directory to start looking for files with - * strings to be translated + * strings to be translated * @param array $extensions file extensions of files which might contain - * such strings + * such strings * @return array of lines for any ini file of msg_id msg_string pairs */ function traverseExtractRecursive($dir, $extensions) diff --git a/models/machine_model.php b/models/machine_model.php index 56a37a1ec..01d1d872e 100644 --- a/models/machine_model.php +++ b/models/machine_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -47,18 +47,34 @@ require_once BASE_DIR."/lib/fetch_url.php"; */ class MachineModel extends Model { + /** + * Associations of the form + * name of field for web forms => database column names/abbreviations + * @var array + */ var $search_table_column_map = array("name" => "NAME"); - /** {@inheritDoc} */ + /** + * Called after getRows has retrieved all the rows that it would retrieve + * but before they are returned to give one last place where they could + * be further manipulated. This callback + * is used to make parallel network calls to get the status of each machine + * returned by getRows. The default for this method is to leave the + * rows that would be returned unchanged + * + * @param array $rows that have been calculated so far by getRows + * @return array $rows after this final manipulation + * + */ function postQueryCallback($rows) { return $this->getMachineStatuses($rows); } /** - * Returns urls for all the queue_servers stored in the DB + * Returns urls for all the queue_servers stored in the DB * - * @param string a crawl_time of a crawl to see the machines used in - * that crawl - * @return array machine names + * @param string $crawl_time of a crawl to see the machines used in + * that crawl + * @return array machine names */ function getQueueServerUrls($crawl_time = 0) { @@ -89,11 +105,11 @@ class MachineModel extends Model return $machines[$crawl_time]; } /** - * Check if there is a machine with $column equal to value + * Check if there is a machine with $column equal to value * - * @param string $column to use to look up machine (either name or url) - * @param string $value for that field - * @return bool whether or not has machine + * @param string $field to use to look up machine (either name or url) + * @param string $value for that field + * @return bool whether or not has machine */ function checkMachineExists($field, $value) { @@ -111,16 +127,16 @@ class MachineModel extends Model return true; } /** - * Add a machine to the database using provided string + * Add a machine to the database using provided string * - * @param string $name the name of the machine to be added - * @param string $url the url of this machine - * @param boolean $has_queue_server - whether this machine is running a - * queue_server - * @param int $num_fetchers - how many managed fetchers are on this - * machine. - * @param string $parent - if this machine replicates some other machine - * then the name of the parent + * @param string $name the name of the machine to be added + * @param string $url the url of this machine + * @param boolean $has_queue_server - whether this machine is running a + * queue_server + * @param int $num_fetchers - how many managed fetchers are on this + * machine. + * @param string $parent - if this machine replicates some other machine + * then the name of the parent */ function addMachine($name, $url, $has_queue_server, $num_fetchers, $parent = "") @@ -133,9 +149,9 @@ class MachineModel extends Model $parent)); } /** - * Delete a machine by its name + * Delete a machine by its name * - * @param string name - the name of the machine to delete + * @param string $machine_name the name of the machine to delete */ function deleteMachine($machine_name) { @@ -149,7 +165,7 @@ class MachineModel extends Model * * @param array $machines an array of machines to check the status for * @return array a list of machines, together with all their properties - * and the statuses of their fetchers and queue_servers + * and the statuses of their fetchers and queue_servers */ function getMachineStatuses($machines = array()) { @@ -194,13 +210,17 @@ class MachineModel extends Model return $machines; } /** - * Get either a fetcher or queue_server log for a machine + * Get either a fetcher or queue_server log for a machine * - * @param string name the name of the machine to get the log file for - * @param int $fetcher_num if a fetcher, which instance on the machine - * @param bool whether the requested machine is a mirror of another machine - * @return string containing the last MachineController::LOG_LISTING_LEN - * bytes of the log record + * @param string $machine_name the name of the machine to get the log file + * for + * @param int $fetcher_num if a fetcher, which instance on the machine + * @param string $filter only lines out of log containing this string + * returned + * @param bool $is_mirror whether the requested machine is a mirror of + * another machine + * @return string containing the last MachineController::LOG_LISTING_LEN + * bytes of the log record */ function getLog($machine_name, $fetcher_num = NULL, $filter="", $is_mirror = false) @@ -240,7 +260,12 @@ class MachineModel extends Model * a machine managed by the current one * * @param string $machine_name name of machine - * @param bool whether the requested machine is a mirror of another machine + * @param string $action "start" or "stop" + * @param int $fetcher_num if the action is for a fetcher this value is not + * NULL and indicated which fetcher. + * @param bool $is_mirror whether the requested machine is a mirror of + * another machine. (If $fetcher_num is NULL and this is false, + * then message is for a queue server) * */ function update($machine_name, $action, $fetcher_num = NULL, diff --git a/models/model.php b/models/model.php index 1f74076c1..7dbdb7f17 100755 --- a/models/model.php +++ b/models/model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -65,11 +65,11 @@ class Model implements CrawlConstants */ const DEFAULT_DESCRIPTION_LENGTH = 150; /** Reference to a DatasourceManager - * @var object + * @var object */ var $db; /** Name of the search engine database - * @var string + * @var string */ var $db_name; /** @@ -79,15 +79,15 @@ class Model implements CrawlConstants */ var $edited_page_summaries = NULL; /** - * These fields if present in $search_array (used by @see getRows() ), - * but with value "0", will be skipped as part of the where clause - * but will be used for order by clause - * @var array + * These fields if present in $search_array (used by @see getRows() ), + * but with value "0", will be skipped as part of the where clause + * but will be used for order by clause + * @var array */ var $any_fields = array(); /** - * Associations of the form - * name of field for web forms => database column names/abbreviations + * Associations of the form + * name of field for web forms => database column names/abbreviations * @var array */ var $search_table_column_map = array(); @@ -95,9 +95,9 @@ class Model implements CrawlConstants * Sets up the database manager that will be used and name of the search * engine database * - * @param string $db_name the name of the database for the search engine + * @param string $db_name the name of the database for the search engine * @param bool $connect whether to connect to the database by default - * after making the datasource class + * after making the datasource class */ function __construct($db_name = DB_NAME, $connect = true) { @@ -114,7 +114,7 @@ class Model implements CrawlConstants * search terms, and then creates a new summary array. * * @param array $results web pages summaries (these in turn are - * arrays!) + * arrays!) * @param array $words keywords (typically what was searched on) * @param int $description_length length of the description * @return array summaries which have been snippified and bold faced @@ -210,10 +210,10 @@ class Model implements CrawlConstants * There is also a rule that a snippet should avoid ending in the middle of * a word * - * @param string $text haystack to extract snippet from - * @param array $words keywords used to make look in haystack - * @param string $description_length length of the description desired - * @return string a concatenation of the extracted snippets of each word + * @param string $text haystack to extract snippet from + * @param array $words keywords used to make look in haystack + * @param string $description_length length of the description desired + * @return string a concatenation of the extracted snippets of each word */ function getSnippets($text, $words, $description_length) { @@ -298,12 +298,12 @@ class Model implements CrawlConstants return $snippet_string; } /** - * Given a string, wraps in bold html tags a set of key words it contains. + * Given a string, wraps in bold html tags a set of key words it contains. * - * @param string $text haystack string to look for the key words - * @param array $words an array of words to bold face + * @param string $text haystack string to look for the key words + * @param array $words an array of words to bold face * - * @return string the resulting string after boldfacing has been applied + * @return string the resulting string after boldfacing has been applied */ function boldKeywords($text, $words) { @@ -320,7 +320,7 @@ class Model implements CrawlConstants /** * Gets a list of all DBMS that work with the search engine * - * @return array Names of availabledatasources + * @return array Names of availabledatasources */ function getDbmsList() { @@ -354,11 +354,11 @@ class Model implements CrawlConstants * the current local machine or not * * @param array $machine_urls urls of yioop instances to which the action - * applies + * applies * @param string $index_timestamp if timestamp exists checks if the index - * has declared itself to be a no network index. + * has declared itself to be a no network index. * @return bool whether it involves a single local yioop instance (true) - * or not (false) + * or not (false) */ function isSingleLocalhost($machine_urls, $index_timestamp = -1) { @@ -373,12 +373,12 @@ class Model implements CrawlConstants UrlParser::isLocalhostUrl($machine_urls[0]); } /** - * Used to get the translation of a string_id stored in the database to - * the given locale. + * Used to get the translation of a string_id stored in the database to + * the given locale. * - * @param string $string_id id to translate - * @param string $locale_tag to translate to - * @return mixed translation if found, $string_id, otherwise + * @param string $string_id id to translate + * @param string $locale_tag to translate to + * @return mixed translation if found, $string_id, otherwise */ function translateDb($string_id, $locale_tag) { @@ -403,12 +403,12 @@ class Model implements CrawlConstants return $string_id; } /** - * Get the user_id associated with a given username - * (In base class as used as an internal method in both signin and - * user models) + * Get the user_id associated with a given username + * (In base class as used as an internal method in both signin and + * user models) * - * @param string $username the username to look up - * @return string the corresponding userid + * @param string $username the username to look up + * @return string the corresponding userid */ function getUserId($username) { @@ -424,17 +424,17 @@ class Model implements CrawlConstants return $user_id; } /** - * Creates the WHERE and ORDER BY clauses for a query of a Yioop - * table such as USERS, ROLE, GROUP, which have associated search web - * forms. Searches are case insensitive + * Creates the WHERE and ORDER BY clauses for a query of a Yioop + * table such as USERS, ROLE, GROUP, which have associated search web + * forms. Searches are case insensitive * - * @param array $search_array each element of this is a quadruple - * name of a field, what comparison to perform, a value to check, - * and an order (ascending/descending) to sort by - * @param array $any_fields these fields if present in search array - * but with value "0" will be skipped as part of the where clause - * but will be used for order by clause - * @return array string for where clause, string for order by clause + * @param array $search_array each element of this is a quadruple + * name of a field, what comparison to perform, a value to check, + * and an order (ascending/descending) to sort by + * @param array $any_fields these fields if present in search array + * but with value "0" will be skipped as part of the where clause + * but will be used for order by clause + * @return array string for where clause, string for order by clause */ function searchArrayToWhereOrderClauses($search_array, $any_fields = array('status')) @@ -491,17 +491,19 @@ class Model implements CrawlConstants return array($where, $order_by); } /** - * Gets a range of rows which match the procided search criteria from - * $th provided table + * Gets a range of rows which match the procided search criteria from + * $th provided table * * @param int $limit starting row from the potential results to return * @param int $num number of rows after start row to return - * @param int &$total_rows gets set with the total number of rows that - * can be returned by the given database query + * @param int& $total gets set with the total number of rows that + * can be returned by the given database query * @param array $search_array each element of this is a - * quadruple name of a field, what comparison to perform, a value to - * check, and an order (ascending/descending) to sort by - * @param array $args + * quadruple name of a field, what comparison to perform, a value to + * check, and an order (ascending/descending) to sort by + * @param array $args additional values which may be used to get rows + * (what these are will typically depend on the subclass + * implementation) * @return array */ function getRows($limit = 0, $num = 100, &$total, @@ -541,32 +543,32 @@ class Model implements CrawlConstants return $rows; } /** - * Controls which columns and the names of those columns from the tables - * underlying the given model should be return from a getRows call. - * This defaults to *, but in general will be overriden in subclasses of - * Model + * Controls which columns and the names of those columns from the tables + * underlying the given model should be return from a getRows call. + * This defaults to *, but in general will be overriden in subclasses of + * Model * - * @param mixed $args any additional arguments which should be used to - * determine the columns - * @return string a comma separated list of columns suitable for a SQL - * query + * @param mixed $args any additional arguments which should be used to + * determine the columns + * @return string a comma separated list of columns suitable for a SQL + * query */ function selectCallback($args) { return "*"; } /** - * Controls which tables and the names of tables - * underlie the given model and should be used in a getRows call - * This defaults to the single table whose name is whatever is before - * Model in the name of the model. For example, by default on FooModel - * this method would return "FOO". If a different behavior, this can be - * overriden in subclasses of Model + * Controls which tables and the names of tables + * underlie the given model and should be used in a getRows call + * This defaults to the single table whose name is whatever is before + * Model in the name of the model. For example, by default on FooModel + * this method would return "FOO". If a different behavior, this can be + * overriden in subclasses of Model * - * @param mixed $args any additional arguments which should be used to - * determine these tables - * @return string a comma separated list of tables suitable for a SQL - * query + * @param mixed $args any additional arguments which should be used to + * determine these tables + * @return string a comma separated list of tables suitable for a SQL + * query */ function fromCallback($args) { @@ -575,45 +577,44 @@ class Model implements CrawlConstants return $name; } /** - * Controls the WHERE clause of the SQL query that - * underlies the given model and should be used in a getRows call. - * This defaults to an empty WHERE clause. + * Controls the WHERE clause of the SQL query that + * underlies the given model and should be used in a getRows call. + * This defaults to an empty WHERE clause. * - * @param mixed $args additional arguments that might be used to construct - * the WHERE clause. - * @return string a SQL WHERE clause + * @param mixed $args additional arguments that might be used to construct + * the WHERE clause. + * @return string a SQL WHERE clause */ function whereCallback($args) { return ""; } /** - * Called after as row is retrieved by getRows from the database to - * perform some manipulation that would be useful for this model. - * For example, in CrawlModel, after a row representing a crawl mix - * has been gotten, this is used to perform an additional query to marshal - * its components. By default this method just returns this row unchanged. + * Called after as row is retrieved by getRows from the database to + * perform some manipulation that would be useful for this model. + * For example, in CrawlModel, after a row representing a crawl mix + * has been gotten, this is used to perform an additional query to marshal + * its components. By default this method just returns this row unchanged. * - * @param mixed $args additional arguments that might be used by this - * callback - * @return array $row after callback manipulation + * @param array $row row as retrieved from database query + * @param mixed $args additional arguments that might be used by this + * callback + * @return array $row after callback manipulation */ function rowCallback($row, $args) { return $row; } /** - * Called after getRows has retrieved all the rows that it would retrieve - * but before they are returned to give one last place where they could - * be further manipulated. For example, in MachineModel this callback - * is used to make parallel network calls to get the status of each machine - * returned by getRows. The default for this method is to leave the - * rows that would be returned unchanged + * Called after getRows has retrieved all the rows that it would retrieve + * but before they are returned to give one last place where they could + * be further manipulated. For example, in MachineModel this callback + * is used to make parallel network calls to get the status of each machine + * returned by getRows. The default for this method is to leave the + * rows that would be returned unchanged * - * @param array $rows that have been calculated so far by getRows - * @param mixed $args additional arguments that might be used by this - * callback - * @return array $rows after this final manipulation + * @param array $rows that have been calculated so far by getRows + * @return array $rows after this final manipulation * */ function postQueryCallback($rows) diff --git a/models/parallel_model.php b/models/parallel_model.php index a22b6c6c6..24af5e8ea 100755 --- a/models/parallel_model.php +++ b/models/parallel_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -85,7 +85,11 @@ class ParallelModel extends Model implements CrawlConstants */ const MIN_DESCRIPTION_LENGTH = 100; /** - * {@inheritDoc} + * {@inheritDoc} + * + * @param string $db_name the name of the database for the search engine + * @param bool $connect whether to connect to the database by default + * after making the datasource class */ function __construct($db_name = DB_NAME, $connect = true) { @@ -223,25 +227,6 @@ class ParallelModel extends Model implements CrawlConstants } return $summaries; } - function getMachinesTimestamp($timestamp, $machine_urls) - { - static $machines = array(); - if(isset($machines[$timestamp])) { - return $machines[$timestamp]; - } - $cache_file = CRAWL_DIR."/cache/".self::network_base_name. - $timestamp.".txt"; - if(file_exists($cache_file)) { - $info = unserialize(file_get_contents($cache_file)); - } - if(isset($info["MACHINE_URLS"])) { - $machines[$timestamp] = $info["MACHINE_URLS"]; - } else { - $machines[$timestamp] = array(NAME_SERVER); - } - return $machines[$timestamp]; - } - /** * Gets summaries on a particular machine for a set of document by * their url, or by group of 5-tuples of the form @@ -254,7 +239,6 @@ class ParallelModel extends Model implements CrawlConstants * their descriptions. * * @param string $lookups things whose summaries we are trying to look up - * @param array $machine_urls an array of urls of yioop queue servers * @return array of summary data for the matching documents */ function nonNetworkGetCrawlItems($lookups) @@ -377,10 +361,10 @@ class ParallelModel extends Model implements CrawlConstants * that the info:url meta word has been stored. * * @param string $url_or_key either info:base64_hash_url or just a url to - * lookup + * lookup * @param string $index_name index into which to do the lookup * @param bool $is_key whether the string is info:base64_hash_url or just a - * url + * url * @return array (offset, generation) into the web archive bundle */ function lookupSummaryOffsetGeneration($url_or_key, $index_name = "", @@ -429,11 +413,11 @@ class ParallelModel extends Model implements CrawlConstants return array($summary_offset, $generation); } /** - * A save point is used to store to disk a sequence generation-doc-offset - * pairs of a particular mix query when doing an archive crawl of a crawl - * mix. This is used so that the mix can remember where it was the next - * time it is invoked by the web app on the machine in question. - * This function deletes such a save point associated with a timestamp + * A save point is used to store to disk a sequence generation-doc-offset + * pairs of a particular mix query when doing an archive crawl of a crawl + * mix. This is used so that the mix can remember where it was the next + * time it is invoked by the web app on the machine in question. + * This function deletes such a save point associated with a timestamp * * @param int $save_timestamp timestamp of save point to delete * @param array $machine_urls machines on which to try to delete savepoint @@ -463,24 +447,25 @@ class ParallelModel extends Model implements CrawlConstants } } /** - * This method is invoked by other ParallelModel (@see CrawlModel - * for examples) methods when they want to have their method performed - * on an array of other Yioop instances. The results returned can then - * be aggregated. The invocation sequence is - * crawlModelMethodA invokes execMachine with a list of - * urls of other Yioop instances. execMachine makes REST requests of - * those instances of the given command and optional arguments - * This request would be handled by a CrawlController which in turn - * calls crawlModelMethodA on the given Yioop instance, serializes the - * result and gives it back to execMachine and then back to the originally - * calling function. + * This method is invoked by other ParallelModel (@see CrawlModel + * for examples) methods when they want to have their method performed + * on an array of other Yioop instances. The results returned can then + * be aggregated. The invocation sequence is + * crawlModelMethodA invokes execMachine with a list of + * urls of other Yioop instances. execMachine makes REST requests of + * those instances of the given command and optional arguments + * This request would be handled by a CrawlController which in turn + * calls crawlModelMethodA on the given Yioop instance, serializes the + * result and gives it back to execMachine and then back to the originally + * calling function. * - * @param string $command the ParallelModel method to invoke on the remote - * Yioop instances - * @param array $machine_urls machines to invoke this command on - * @param string additional arguments to be passed to the remote machine - * @param int $num_machines the integer to be used in calculating partition - * @return array a list of outputs from each machine that was called. + * @param string $command the ParallelModel method to invoke on the remote + * Yioop instances + * @param array $machine_urls machines to invoke this command on + * @param string $arg additional arguments to be passed to the remote + * machine + * @param int $num_machines the integer to be used in calculating partition + * @return array a list of outputs from each machine that was called. */ function execMachines($command, $machine_urls, $arg = NULL, $num_machines = 0) diff --git a/models/phrase_model.php b/models/phrase_model.php index 5d291b9d5..93fcd4a53 100755 --- a/models/phrase_model.php +++ b/models/phrase_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -72,7 +72,7 @@ class PhraseModel extends ParallelModel * the max description length of results if such a meta word is used * this array is typically set in index.php * - * @var array + * @var array */ var $additional_meta_words; /** @@ -97,6 +97,10 @@ class PhraseModel extends ParallelModel const NUM_CACHE_PAGES = 10; /** * {@inheritDoc} + * + * @param string $db_name the name of the database for the search engine + * @param bool $connect whether to connect to the database by default + * after making the datasource class */ function __construct($db_name = DB_NAME, $connect = true) { @@ -107,7 +111,7 @@ class PhraseModel extends ParallelModel /** * Returns whether there is a index with the provide timestamp * - * @param int $index_timestamp timestamp of the index to check if in cache + * @param int $index_time_stamp timestamp of the index to check if in cache * @return bool whether it exists or not */ function indexExists($index_time_stamp) @@ -188,28 +192,28 @@ class PhraseModel extends ParallelModel * Given a query phrase, returns formatted document summaries of the * documents that match the phrase. * - * @param string $phrase the phrase to try to match + * @param string $input_phrase the phrase to try to match * @param int $low return results beginning with the $low document * @param int $results_per_page how many results to return * @param bool $format whether to highlight in the returned summaries the - * matched text + * matched text * @param array $filter an array of hashes of domains to filter from - * results + * results * @param bool $use_cache_if_allowed if true and USE_CACHE is true then - * an attempt will be made to look up the results in either - * the file cache or memcache. Otherwise, items will be recomputed - * and then potentially restored in cache + * an attempt will be made to look up the results in either + * the file cache or memcache. Otherwise, items will be recomputed + * and then potentially restored in cache * @param int $raw ($raw == 0) normal grouping, ($raw == 1) - * no grouping done on data also no summaries returned (only lookup - * info), $raw > 1 return summaries but no grouping + * no grouping done on data also no summaries returned (only lookup + * info), $raw > 1 return summaries but no grouping * @param array $queue_servers a list of urls of yioop machines which might - * be used during lookup + * be used during lookup * @param bool $guess_semantics whether to do query rewriting before lookup * @param int $save_timestamp if this timestamp is nonzero, then save - * iterate position, so can resume on future queries that make - * use of the timestamp + * iterate position, so can resume on future queries that make + * use of the timestamp * @param bool $limit_news if true the number of media:news items to - * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT + * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT * * @return array an array of summary data */ @@ -457,14 +461,14 @@ class PhraseModel extends ParallelModel return $output; } /** - * Parses from a string phrase representing a conjunctive query, a struct - * consisting of the words keys searched for, the allowed and disallowed - * phrases, the weight that should be put on these query results, and - * which archive to use. + * Parses from a string phrase representing a conjunctive query, a struct + * consisting of the words keys searched for, the allowed and disallowed + * phrases, the weight that should be put on these query results, and + * which archive to use. * - * @param string &$phrase string to extract struct from, if the phrase - * semantics is guessed or an if condition is processed the value of - * phrase will be altered. (Helps for feeding to network queries) + * @param string& $phrase string to extract struct from, if the phrase + * semantics is guessed or an if condition is processed the value of + * phrase will be altered. (Helps for feeding to network queries) * @param bool $guess_semantics whether to do query rewriting before parse * @return array struct representing the conjunctive query */ @@ -500,7 +504,10 @@ class PhraseModel extends ParallelModel $num_words = 0; $quote_positions = array(); foreach($phrase_parts as $phrase_part) { - if(trim($phrase_part) == "") {continue;} + if(trim($phrase_part) == "") { + $quote_state = ($quote_state) ? false : true; + continue; + } /*still use original phrase string here to handle acronyms abbreviations and the like that use periods */ if($quote_state) { @@ -693,9 +700,9 @@ class PhraseModel extends ParallelModel * but apersand substitution applied, the index and the weights found * as part of the query string. * - * @param string $phrase the query string - * @return array containing items listed above in the description of this - * method + * @param string $phrase the query string + * @return array containing items listed above in the description of this + * method */ function extractMetaWordInfo($phrase) { @@ -779,9 +786,9 @@ class PhraseModel extends ParallelModel * when a query term is a url and rewriting it to the appropriate meta * meta word. * - * @param string $phrase input query to guess semantics of - * @return string a phrase that more closely matches the intentions of the - * query. + * @param string $phrase input query to guess semantics of + * @return string a phrase that more closely matches the intentions of the + * query. */ function guessSemantics($phrase) { @@ -860,20 +867,20 @@ class PhraseModel extends ParallelModel return $phrase; } /** - * Matches terms (non white-char strings) in the language $lang_tag in - * $phrase that begin with $start_with and don't contain $not_contain, - * replaces $start_with with $new_prefix and adds $suffix to the end + * Matches terms (non white-char strings) in the language $lang_tag in + * $phrase that begin with $start_with and don't contain $not_contain, + * replaces $start_with with $new_prefix and adds $suffix to the end * - * @param string $phrase string to look for terms in - * @param string $start_with what we're looking to see if term begins with - * @param string $new_prefix what to change $start_with to - * @param string $suffix what to tack on to the end of the term if there is - * a match - * @param string $not_contain string match is not allowed to contain - * @param string $lang_tag what language the phrase must be in for the rule - * to apply + * @param string $phrase string to look for terms in + * @param string $start_with what we're looking to see if term begins with + * @param string $new_prefix what to change $start_with to + * @param string $suffix what to tack on to the end of the term if there is + * a match + * @param string $not_contains string match is not allowed to contain + * @param string $lang_tag what language the phrase must be in for the rule + * to apply * - * @return string $phrase after modifications have been made + * @return string $phrase after modifications have been made */ function beginMatch($phrase, $start_with, $new_prefix, $suffix = "", $not_contains=array(), $lang_tag = "en-US") @@ -904,24 +911,24 @@ class PhraseModel extends ParallelModel return $result_phrase; } /** - * Matches terms (non white-char strings) in the language $lang_tag in - * $phrase that end with $end_with and don't contain $not_contain, - * replaces $end_with with $new_suffix (if not empty) and adds $prefix to - * the beginning + * Matches terms (non white-char strings) in the language $lang_tag in + * $phrase that end with $end_with and don't contain $not_contain, + * replaces $end_with with $new_suffix (if not empty) and adds $prefix to + * the beginning * - * @param string $phrase string to look for terms in - * @param string $end_with what we're looking to see if term ends with - * @param string $prefix what to tack on to the start if there is - * a match - * @param string $new_suffix what to change $end_with to - * @param string $lang_tag what language the phrase must be in for the rule - * to apply + * @param string $phrase string to look for terms in + * @param string $end_with what we're looking to see if term ends with + * @param string $prefix what to tack on to the start if there is + * a match + * @param string $new_suffix what to change $end_with to + * @param string $not_contains string match is not allowed to contain + * @param string $lang_tag what language the phrase must be in for the rule + * to apply * - * @return string $phrase after modifications have been made + * @return string $phrase after modifications have been made */ function endMatch($phrase, $end_with, $prefix, $new_suffix = "", - $not_contains=array(), - $lang_tag = "en-US") + $not_contains = array(), $lang_tag = "en-US") { $phrase .= " "; $quote_end_with = preg_quote($end_with, "/"); @@ -982,34 +989,34 @@ class PhraseModel extends ParallelModel * Gets doc summaries of documents containing given words and meeting the * additional provided criteria * @param array $word_structs an array of word_structs. Here a word_struct - * is an associative array with at least the following fields - * KEYS -- an array of word keys - * QUOTE_POSITIONS -- an array of positions of words that appeared in - * quotes (so need to be matched exactly) - * DISALLOW_PHRASES -- an array of words the document must not contain - * WEIGHT -- a weight to multiple scores returned from this iterator by - * INDEX_NAME -- an index timestamp to get results from + * is an associative array with at least the following fields + * KEYS -- an array of word keys + * QUOTE_POSITIONS -- an array of positions of words that appeared in + * quotes (so need to be matched exactly) + * DISALLOW_PHRASES -- an array of words the document must not contain + * WEIGHT -- a weight to multiple scores returned from this iterator by + * INDEX_NAME -- an index timestamp to get results from * @param int $limit number of first document in order to return * @param int $num number of documents to return summaries of - * @param array &$filter an array of hashes of domains to filter from - * results + * @param array& $filter an array of hashes of domains to filter from + * results * @param bool $use_cache_if_allowed if true and USE_CACHE is true then - * an attempt will be made to look up the results in either - * the file cache or memcache. Otherwise, items will be recomputed - * and then potentially restored in cache + * an attempt will be made to look up the results in either + * the file cache or memcache. Otherwise, items will be recomputed + * and then potentially restored in cache * @param int $raw ($raw == 0) normal grouping, ($raw > 0) - * no grouping done on data. if ($raw == 1) no lookups of summaries - * done + * no grouping done on data. if ($raw == 1) no lookups of summaries + * done * @param array $queue_servers a list of urls of yioop machines which might - * be used during lookup + * be used during lookup * @param string $original_query if set, the original query that corresponds - * to $word_structs + * to $word_structs * @param string $save_timestamp_name if this timestamp is not empty, then - * save iterate position, so can resume on future queries that make - * use of the timestamp. If used then $limit ignored and get next $num - * docs after $save_timestamp 's previous iterate position. + * save iterate position, so can resume on future queries that make + * use of the timestamp. If used then $limit ignored and get next $num + * docs after $save_timestamp 's previous iterate position. * @param bool $limit_news if true the number of media:news items to - * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT + * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT * * @return array document summaries */ @@ -1311,7 +1318,9 @@ class PhraseModel extends ParallelModel * do WordNet processing. Also user has to specify the WordNet directory * * @param array $results document summaries - * @param string $original query + * @param string $original_query the original query that we are computing + * results for + * @param string $lang locale tag of query * @return array results document summaries sorted by wordnet score */ function sortByThesaurusScore($results, $original_query, $lang) @@ -1347,11 +1356,11 @@ class PhraseModel extends ParallelModel * are location's then looks these up in turn. This method handles robot * meta tags which might forbid indexing. * - * @param array &$pages of page data without text summaries - * @param array &$queue_servers array of queue server to find data on + * @param array& $pages of page data without text summaries + * @param array& $queue_servers array of queue server to find data on * @param int $raw only lookup locations if 0 * @param bool $groups_with_docs whether to return only groups that - * contain at least one doc as opposed to a groups with only links + * contain at least one doc as opposed to a groups with only links * @return array pages with summaries added */ function getSummariesFromOffsets(&$pages, &$queue_servers, $raw, @@ -1446,33 +1455,33 @@ class PhraseModel extends ParallelModel * results to a query * * @param array $word_structs an array of word_structs. Here a word_struct - * is an associative array with at least the following fields - * KEYS -- an array of word keys - * QUOTE_POSITIONS -- an array of positions of words that appreared in - * quotes (so need to be matched exactly) - * DISALLOW_PHRASES -- an array of words the document must not contain - * WEIGHT -- a weight to multiple scores returned from this iterator by - * INDEX_NAME -- an index timestamp to get results from - * @param array &$filter an array of hashes of domains to filter from - * results - * and then potentially restored in cache + * is an associative array with at least the following fields + * KEYS -- an array of word keys + * QUOTE_POSITIONS -- an array of positions of words that appreared in + * quotes (so need to be matched exactly) + * DISALLOW_PHRASES -- an array of words the document must not contain + * WEIGHT -- a weight to multiple scores returned from this iterator by + * INDEX_NAME -- an index timestamp to get results from + * @param array& $filter an array of hashes of domains to filter from + * results + * and then potentially restored in cache * @param int $raw ($raw == 0) normal grouping, ($raw == 1) - * no grouping done on data also no summaries returned (only lookup - * info), $raw > 1 return summaries but no grouping + * no grouping done on data also no summaries returned (only lookup + * info), $raw > 1 return summaries but no grouping * @param int $to_retrieve number of items to retrieve from location in - * in interator + * in interator * @param array $queue_servers a list of urls of yioop machines which might - * be used during lookup + * be used during lookup * @param string $original_query if set, the orginal query that corresponds - * to $word_structs + * to $word_structs * @param string $save_timestamp_name if this timestamp is non empty, then - * when making iterator get sub-iterators to advance to gen doc_offset - * stored with respect to save_timestamp if exists. + * when making iterator get sub-iterators to advance to gen doc_offset + * stored with respect to save_timestamp if exists. * @param bool $limit_news if true the number of media:news items to - * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT + * allow in search results is limited to WordIterator::LIMIT_NEWS_COUNT * * @return &object an iterator for iterating through results to the - * query + * query */ function getQueryIterator($word_structs, &$filter, $raw, &$to_retrieve, $queue_servers = array(), $original_query = "", diff --git a/models/profile_model.php b/models/profile_model.php index 66074201d..df7843842 100755 --- a/models/profile_model.php +++ b/models/profile_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -47,9 +47,9 @@ require_once(BASE_DIR.'/lib/url_parser.php'); class ProfileModel extends Model { /** - * These are fields whose values might be set in a Yioop instance - * profile.php file - * @var array + * These are fields whose values might be set in a Yioop instance + * profile.php file + * @var array */ var $profile_fields = array('API_ACCESS', 'AUTH_KEY', 'AUTHENTICATION_MODE', 'CACHE_LINK', 'CAPTCHA_MODE','DEBUG_LEVEL', @@ -65,14 +65,18 @@ class ProfileModel extends Model 'USER_AGENT_SHORT', 'WEB_URI', 'WEB_ACCESS', 'WORD_SUGGEST' ); /** - * Associative array (table_name => SQL statement to create that table) - * List is alphabetical and contains all Yioop tables. List is only - * initialized after an @see initializeSql call. - * @var array + * Associative array (table_name => SQL statement to create that table) + * List is alphabetical and contains all Yioop tables. List is only + * initialized after an @see initializeSql call. + * @var array */ var $create_statements; /** - * {@inheritDoc} + * {@inheritDoc} + * + * @param string $db_name the name of the database for the search engine + * @param bool $connect whether to connect to the database by default + * after making the datasource class */ function __construct($db_name = DB_NAME, $connect = true) { @@ -80,13 +84,13 @@ class ProfileModel extends Model $this->create_statements = array(); } /** - * Used to construct $this->create_statements, the list of all SQL - * CREATE statements needed to build a Yioop database + * Used to construct $this->create_statements, the list of all SQL + * CREATE statements needed to build a Yioop database * - * @param object $dbm a datasource_manager object used to get strings - * for autoincrement and serial types for a given db - * @param array $dbinfo connect info for the database, also used in - * getting autoincrement and serial types + * @param object $dbm a datasource_manager object used to get strings + * for autoincrement and serial types for a given db + * @param array $dbinfo connect info for the database, also used in + * getting autoincrement and serial types */ function initializeSql($dbm, $dbinfo) { @@ -223,7 +227,7 @@ class ProfileModel extends Model * Creates the directory provides as well as subdirectories for crawls, * locales, logging, and sqlite DBs. * - * @param string $directory parth and name of directory to create + * @param string $directory parth and name of directory to create */ function makeWorkDirectory($directory) { @@ -261,12 +265,12 @@ class ProfileModel extends Model * doesn't exist, etc. * * @param string $directory the work directory to output the profile.php - * file + * file * @param array $new_profile_data fields and values containing at least - * some profile information (only $this->profile_fields + * some profile information (only $this->profile_fields * fields of $new_profile_data will be considered). * @param array $old_profile_data fields and values that come from - * presumably a previously existing profile + * presumably a previously existing profile */ function updateProfile($directory, $new_profile_data, $old_profile_data) { @@ -274,27 +278,27 @@ class ProfileModel extends Model $n[] = <<<EOT <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009-2012 Chris Pollett chris@pollett.org + * Copyright (C) 2009-2012 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Computer generated file giving the key defines of directory locations * as well as database settings used to run the SeekQuarry/Yioop search engine @@ -374,11 +378,11 @@ EOT; * to recreate the database from the default copy stored in /data dir. * * @param array $dbinfo has fields for DBMS, DB_USER, DB_PASSWORD, DB_HOST - * and DB_NAME + * and DB_NAME * @param array $skip_list an array of table or index names not to bother - * creating or copying + * creating or copying * @return bool returns true if can connect to/create a valid database; - * returns false otherwise + * returns false otherwise */ function migrateDatabaseIfNecessary($dbinfo, $skip_list = array()) { @@ -411,9 +415,10 @@ EOT; * Yioop less those on a skip list * * @param object $dbm a DatabaseManager open to some DBMS and with a - * blank database selected + * blank database selected + * @param array $dbinfo name of database, host, user, and password * @param array $skip_list an array of table or index names not to bother - * creating + * creating * @return bool whether all of the creates were successful or not */ function createDatabaseTables($dbm, $dbinfo, $skip_list = array()) @@ -434,13 +439,13 @@ EOT; * app db. * * @param array $dbinfo has field for DBMS, DB_USER, DB_PASSWORD, DB_HOST - * and DB_NAME + * and DB_NAME * @return mixed returns true if can connect to DBMS with username and - * password, can select the given database name and that database - * seems to be of Yioop/SeekQuarry type. If the connection works - * but database isn't there it attempts to create it. If the - * database is there but no data, then it returns a resource for - * the database. Otherwise, it returns false. + * password, can select the given database name and that database + * seems to be of Yioop/SeekQuarry type. If the connection works + * but database isn't there it attempts to create it. If the + * database is there but no data, then it returns a resource for + * the database. Otherwise, it returns false. */ function testDatabaseManager($dbinfo) { diff --git a/models/role_model.php b/models/role_model.php index 240c9dcfc..279cf5dc5 100644 --- a/models/role_model.php +++ b/models/role_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -50,15 +50,21 @@ class RoleModel extends Model * @var array */ var $search_table_column_map = array("name"=>"NAME"); - /** {@inheritDoc} */ + /** {@inheritDoc} + * + * @param mixed $args any additional arguments which should be used to + * determine the columns (ignored in this case) + * @return string a comma separated list of columns suitable for a SQL + * query ("NAME" in this case) + */ function selectCallback($args = NULL) { return "NAME"; } /** - * Get the activities (name, method, id) that a given role can perform + * Get the activities (name, method, id) that a given role can perform * - * @param string $role_id the rolid_id to get activities for + * @param string $role_id the rolid_id to get activities for */ function getRoleActivities($role_id) { @@ -105,6 +111,9 @@ class RoleModel extends Model * Gets all the roles associated with a user id * * @param string $user_id the user_id to get roles of + * @param string $filter to SQL LIKE filter roles + * @param int $limit starting index of first role to return + * @param int $num number of roles to return * @return array of role_ids and their names */ function getUserRoles($user_id, $filter, $limit, @@ -138,11 +147,11 @@ class RoleModel extends Model return $roles; } /** - * Get a count of the number of groups that a user_id has. + * Get a count of the number of groups that a user_id has. * - * @param int $user_id to get roles for - * @param string $filter to LIKE filter groups - * @return int number of roles of the filtered type for the user + * @param int $user_id to get roles for + * @param string $filter to SQL LIKE filter roles + * @return int number of roles of the filtered type for the user */ function countUserRoles($user_id, $filter="") { @@ -164,11 +173,11 @@ class RoleModel extends Model return $row['NUM']; } /** - * Check is a user given by $user_id has the role $role_id + * Check is a user given by $user_id has the role $role_id * - * @param int $user_id user to look up - * @param int $role_id role to check if member of - * @return bool whether or not has role + * @param int $user_id user to look up + * @param int $role_id role to check if member of + * @return bool whether or not has role */ function checkUserRole($user_id, $role_id) { @@ -188,8 +197,8 @@ class RoleModel extends Model /** * Adds a role to a given user * - * @param string $userid the id of the user to add the role to - * @param string $roleid the id of the role to add + * @param string $user_id the id of the user to add the role to + * @param string $role_id the id of the role to add */ function addUserRole($user_id, $role_id) { @@ -199,8 +208,8 @@ class RoleModel extends Model /** * Deletes a role from a given user * - * @param string $userid the id of the user to delete the role from - * @param string $roleid the id of the role to delete + * @param string $user_id the id of the user to delete the role from + * @param string $role_id the id of the role to delete */ function deleteUserRole($user_id, $role_id) { @@ -241,9 +250,9 @@ class RoleModel extends Model return $row; } /** - * Add a rolename to the database using provided string + * Add a rolename to the database using provided string * - * @param string $role_name the rolename to be added + * @param string $role_name the rolename to be added */ function addRole($role_name) { @@ -251,10 +260,10 @@ class RoleModel extends Model $this->db->execute($sql, array($role_name)); } /** - * Add an allowed activity to an existing role + * Add an allowed activity to an existing role * - * @param string $role_id the role id of the role to add the activity to - * @param string $activity_id the id of the acitivity to add + * @param string $role_id the role id of the role to add the activity to + * @param string $activity_id the id of the acitivity to add */ function addActivityRole($role_id, $activity_id) { @@ -262,9 +271,9 @@ class RoleModel extends Model $this->db->execute($sql, array($role_id, $activity_id)); } /** - * Delete a role by its roleid + * Delete a role by its roleid * - * @param string $role_id - the roleid of the role to delete + * @param string $role_id - the roleid of the role to delete */ function deleteRole($role_id) { @@ -274,10 +283,10 @@ class RoleModel extends Model $this->db->execute($sql, array($role_id)); } /** - * Remove an allowed activity from a role + * Remove an allowed activity from a role * - * @param string $role_id the roleid of the role to be modified - * @param string $activity_id the activityid of the activity to remove + * @param string $role_id the roleid of the role to be modified + * @param string $activity_id the activityid of the activity to remove */ function deleteActivityRole($role_id, $activity_id) { diff --git a/models/searchfilters_model.php b/models/searchfilters_model.php index 0dfc86a59..0d469baf1 100644 --- a/models/searchfilters_model.php +++ b/models/searchfilters_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -55,7 +55,11 @@ class SearchfiltersModel extends Model implements CrawlConstants */ var $dir_name; /** - * {@inheritDoc} + * {@inheritDoc} + * + * @param string $db_name the name of the database for the search engine + * @param bool $connect whether to connect to the database by default + * after making the datasource class */ function __construct($db_name = DB_NAME, $connect = true) { @@ -68,12 +72,12 @@ class SearchfiltersModel extends Model implements CrawlConstants } } /** - * Gets a list of hostnames to be filtered from search results. - * This method is suitable for displaying what is to be filtered, - * but as it returns full urls it is probably to slow to query and - * might also be a larger file to read + * Gets a list of hostnames to be filtered from search results. + * This method is suitable for displaying what is to be filtered, + * but as it returns full urls it is probably to slow to query and + * might also be a larger file to read * - * @return array $filtered_urls urls to be filtered + * @return array $filtered_urls urls to be filtered */ function getUrls() { @@ -85,11 +89,11 @@ class SearchfiltersModel extends Model implements CrawlConstants return $filtered_urls; } /** - * Gets a list of hashes of hostnames to be filtered from search results. - * This method is suitable for quickly finding a host name in word - * iterator to remove from results. + * Gets a list of hashes of hostnames to be filtered from search results. + * This method is suitable for quickly finding a host name in word + * iterator to remove from results. * - * @return array $filtered hashes of urls to be filtered + * @return array $filtered hashes of urls to be filtered */ function getFilter() { @@ -101,10 +105,10 @@ class SearchfiltersModel extends Model implements CrawlConstants return $filter; } /** - * Sets a list of hostnames to be filtered from search results - * Also, in the 'time' filed records when the set happened. + * Sets a list of hostnames to be filtered from search results + * Also, in the 'time' filed records when the set happened. * - * @param array $urls to be filtered + * @param array $urls to be filtered */ function set($urls) { @@ -127,7 +131,7 @@ class SearchfiltersModel extends Model implements CrawlConstants * @param string $url url of a result page * @param string $title the title to be used on SERP pages * @param string $description the description from which snippets will - * be generated. + * be generated. */ function updateResultPage($url, $title, $description) { @@ -151,8 +155,8 @@ class SearchfiltersModel extends Model implements CrawlConstants * be altered to something other than whats in the current index. * * @return array of summary pages for url for which the summary page - * is being overrided -- the intention is this is not many - * as how this is being done won't in general scale + * is being overrided -- the intention is this is not many + * as how this is being done won't in general scale */ function getEditedPageSummaries() { diff --git a/models/signin_model.php b/models/signin_model.php index 31337edb8..d4fc684f5 100755 --- a/models/signin_model.php +++ b/models/signin_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -52,7 +52,7 @@ class SigninModel extends Model * @param string $username the username to check * @param string $password the password to check * @return bool where the password is that of the given user - * (or at least hashes to the same thing) + * (or at least hashes to the same thing) */ function checkValidSignin($username, $password) { @@ -124,7 +124,7 @@ class SigninModel extends Model * @param string $username the username to check * @param string $email the email to check * @return bool where the email is that of the given user - * (or at least hashes to the same thing) + * (or at least hashes to the same thing) */ function checkValidEmail($username, $email) { @@ -141,10 +141,10 @@ class SigninModel extends Model return ($username == $row['USER_NAME'] && $email == $row['EMAIL']) ; } /** - * Get the user_name associated with a given userid + * Get the user_name associated with a given userid * - * @param string $user_id the userid to look up - * @return string the corresponding username + * @param string $user_id the userid to look up + * @return string the corresponding username */ function getUserName($user_id) { @@ -157,27 +157,27 @@ class SigninModel extends Model return $username; } /** - * Get the email associated with a given user_id + * Get the email associated with a given user_id * - * @param string $user_id the userid to look up - * @return string the corresponding email + * @param string $user_id the userid to look up + * @return string the corresponding email */ - function getEmail($user_id, $limit = 1) + function getEmail($user_id) { $db = $this->db; $sql = "SELECT EMAIL FROM USERS WHERE - USER_ID = ? " . $db->limitOffset($limit); + USER_ID = ? " . $db->limitOffset(1); $result = $db->execute($sql, array($user_id)); $row = $db->fetchArray($result); $email = $row['EMAIL']; return $email; } /** - * Changes the email of a given user + * Changes the email of a given user * - * @param string $username username of user to change email of - * @param string $email new email for user - * @return bool update successful or not. + * @param string $username username of user to change email of + * @param string $email new email for user + * @return bool update successful or not. */ function changeEmail($username, $email) @@ -187,11 +187,11 @@ class SigninModel extends Model return $result != false; } /** - * Changes the password of a given user + * Changes the password of a given user * - * @param string $username username of user to change password of - * @param string $password new password for user - * @return bool update successful or not. + * @param string $username username of user to change password of + * @param string $password new password for user + * @return bool update successful or not. */ function changePassword($username, $password) { @@ -201,11 +201,11 @@ class SigninModel extends Model return $result != false; } /** - * Changes the password of a given user in case of ZKP authentication + * Changes the password of a given user in case of ZKP authentication * - * @param string $username username of user to change password of - * @param string $password new password for user - * @return bool update successful or not. + * @param string $username username of user to change password of + * @param string $password new password for user + * @return bool update successful or not. */ function changePasswordZKP($username, $password) { diff --git a/models/source_model.php b/models/source_model.php index b6715e5dc..da3c9d1f3 100644 --- a/models/source_model.php +++ b/models/source_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -50,15 +50,15 @@ class SourceModel extends Model /** Mamimum number of feeds to download in one try */ const MAX_FEEDS_ONE_GO = 100; /** - * Controls which tables and the names of tables - * underlie the given model and should be used in a getRows call - * As SourceModel is used for both media sources and subsearches. - * The underlying table might be MEDIA_SOURCE or it might be SUBSEARCH. - * The $args variable is a string which is assumed to say which. + * Controls which tables and the names of tables + * underlie the given model and should be used in a getRows call + * As SourceModel is used for both media sources and subsearches. + * The underlying table might be MEDIA_SOURCE or it might be SUBSEARCH. + * The $args variable is a string which is assumed to say which. * - * @param string $args if is "SUBSEARCH" then the SUBSEARCH table will - * be used by getRows rather than MEDIA_SOURCE. - * @return string which table to use + * @param string $args if is "SUBSEARCH" then the SUBSEARCH table will + * be used by getRows rather than MEDIA_SOURCE. + * @return string which table to use */ function fromCallback($args = NULL) { @@ -68,14 +68,14 @@ class SourceModel extends Model return "MEDIA_SOURCE"; } /** - * Returns a list of media sources such as (video, rss sites) and their - * URL and thumb url formats, etc + * Returns a list of media sources such as (video, rss sites) and their + * URL and thumb url formats, etc * - * @param string $source_type the particular kind of media source to return - * for example, video - * @param bool $has_feed_no_items if true returns only those items which - * have not feed_items associated with them. - * @return array a list of web sites which are either video or news sites + * @param string $source_type the particular kind of media source to return + * for example, video + * @param bool $has_no_feed_items if true returns only those items which + * have not feed_items associated with them. + * @return array a list of web sites which are either video or news sites */ function getMediaSources($source_type = "", $has_no_feed_items = false) { @@ -106,10 +106,10 @@ class SourceModel extends Model return $sources; } /** - * Return the media source by the name of the source - * @param string $timestamp of the media source to look up - * @return array associative array with SOURCE_NAME, TYPE, SOURCE_URL, - * THUMB_URL, and LANGUAGE + * Return the media source by the name of the source + * @param string $timestamp of the media source to look up + * @return array associative array with SOURCE_NAME, TYPE, SOURCE_URL, + * THUMB_URL, and LANGUAGE */ function getMediaSource($timestamp) { @@ -123,19 +123,19 @@ class SourceModel extends Model return $row; } /** - * Used to add a new video, rss, or other sources to Yioop + * Used to add a new video, rss, or other sources to Yioop * - * @param string $name - * @param string $source_type whether video, rss, etc - * @param string $source_url url regex of resource (video) or actual - * resource (rss). Not quite a real regex you add {} to the - * location in the url where the name of the particular video - * should go http://www.youtube.com/watch?v={}& - * (anything after & is ignored, so between = and & will be matched - * as the name of a video) - * @param string $thumb_url regex of where to get thumbnails for videos - * based on match of $source_url, for example, - * http://img.youtube.com/vi/{}/2.jpg + * @param string $name + * @param string $source_type whether video, rss, etc + * @param string $source_url url regex of resource (video) or actual + * resource (rss). Not quite a real regex you add {} to the + * location in the url where the name of the particular video + * should go http://www.youtube.com/watch?v={}& + * (anything after & is ignored, so between = and & will be matched + * as the name of a video) + * @param string $thumb_url regex of where to get thumbnails for videos + * based on match of $source_url, for example, + * http://img.youtube.com/vi/{}/2.jpg * @param string $language the locale tag for the media source (rss) */ function addMediaSource($name, $source_type, $source_url, $thumb_url, @@ -148,10 +148,10 @@ class SourceModel extends Model $thumb_url, $language)); } /** - * Used to update the fields stored in a MEDIA_SOURCE row according to - * an array holding new values + * Used to update the fields stored in a MEDIA_SOURCE row according to + * an array holding new values * - * @param array $source_info updated values for a MEDIA_SOURCE row + * @param array $source_info updated values for a MEDIA_SOURCE row */ function updateMediaSource($source_info) { @@ -196,7 +196,7 @@ class SourceModel extends Model * including their names translated to the current locale * * @return array associative array containing subsearch info name in locale, - * folder name, index, number of results per page + * folder name, index, number of results per page */ function getSubsearches() { @@ -241,9 +241,9 @@ class SourceModel extends Model return $subsearches; } /** - * Return the media source by the name of the source - * @param string $folder_name - * @return array + * Return the media source by the name of the source + * @param string $folder_name + * @return array */ function getSubsearch($folder_name) { @@ -261,11 +261,11 @@ class SourceModel extends Model * at the top od the Yioop search pages. * * @param string $folder_name name of subsearch in terms of urls - * (not translated name that appears in the subsearch bar) + * (not translated name that appears in the subsearch bar) * @param string $index_identifier timestamp of crawl or mix to be - * used for results of subsearch + * used for results of subsearch * @param int $per_page number of search results per page when this - * subsearch is used + * subsearch is used */ function addSubsearch($folder_name, $index_identifier, $per_page) { @@ -278,10 +278,10 @@ class SourceModel extends Model $db->execute($sql, array(time(), $locale_string)); } /** - * Used to update the fields stored in a SUBSEARCH row according to - * an array holding new values + * Used to update the fields stored in a SUBSEARCH row according to + * an array holding new values * - * @param array $search_info updated values for a SUBSEARCH row + * @param array $search_info updated values for a SUBSEARCH row */ function updateSubsearch($search_info) { @@ -326,12 +326,12 @@ class SourceModel extends Model $db->execute($sql, array($locale_string)); } /** - * For each feed source downloads the feeds, checks which items are - * not in the database, adds them. This method does not update - * the inverted index shard. + * For each feed source downloads the feeds, checks which items are + * not in the database, adds them. This method does not update + * the inverted index shard. * - * @param int $age how many seconds old records should be ignored - * @return bool whether feed item update was successful + * @param int $age how many seconds old records should be ignored + * @return bool whether feed item update was successful */ function updateFeedItems($age = self::ONE_WEEK) { @@ -487,7 +487,7 @@ class SourceModel extends Model * * @param array $item data from a single news feed item * @param string $source_name string name of the news feed $item was found - * on + * on * @param int $age how many seconds old records should be ignored * @param string $lang locale-tag of the news feed * @return bool whether an item was added @@ -529,14 +529,14 @@ class SourceModel extends Model return true; } /** - * Used to calculate the meta words for RSS feed items + * Used to calculate the meta words for RSS feed items * - * @param string $lang the locale_tag of the feed item - * @param int $pubdate UNIX timestamp publication date of item - * @param string $source_name the name of the news feed - * @param string $guid the guid of the news item + * @param string $lang the locale_tag of the feed item + * @param int $pubdate UNIX timestamp publication date of item + * @param string $source_name the name of the news feed + * @param string $guid the guid of the news item * - * @return array $meta_ids meta words found + * @return array $meta_ids meta words found */ function calculateMetas($lang, $pubdate, $source_name, $guid) { diff --git a/models/user_model.php b/models/user_model.php index 59031f595..ab799cd65 100755 --- a/models/user_model.php +++ b/models/user_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -46,42 +46,57 @@ require_once BASE_DIR."/lib/utility.php"; class UserModel extends Model { /** - * Associations of the form - * name of field for web forms => database column names/abbreviations - * In this case, things will in general map to the USERS table in the - * Yioop data base - * var array + * Associations of the form + * name of field for web forms => database column names/abbreviations + * In this case, things will in general map to the USERS table in the + * Yioop data base + * var array */ var $search_table_column_map = array("first"=>"FIRST_NAME", "last" => "LAST_NAME", "user" => "USER_NAME", "email"=>"EMAIL", "status"=>"STATUS"); /** - * These fields if present in $search_array (used by @see getRows() ), - * but with value "0", will be skipped as part of the where clause - * but will be used for order by clause + * These fields if present in $search_array (used by @see getRows() ), + * but with value "0", will be skipped as part of the where clause + * but will be used for order by clause * @var array */ var $any_fields = array("status"); - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param mixed $args any additional arguments which should be used to + * determine these tables (in this case none) + */ function selectCallback($args = NULL) { return "USER_ID, USER_NAME, FIRST_NAME, LAST_NAME, EMAIL, STATUS"; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param mixed $args any additional arguments which should be used to + * determine these tables (in this case none) + */ function fromCallback($args = NULL) { return "USERS"; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * + * @param mixed $args any additional arguments which should be used to + * determine these tables (in this case none) + */ function whereCallback($args = NULL) { return "USER_ID != '".PUBLIC_USER_ID."'"; } /** - * Get a list of admin activities that a user is allowed to perform. - * This includes their name and their associated method. + * Get a list of admin activities that a user is allowed to perform. + * This includes their name and their associated method. * - * @param string $user_id id of user to get activities fors + * @param string $user_id id of user to get activities fors */ function getUserActivities($user_id) { @@ -130,12 +145,12 @@ class UserModel extends Model return $activities; } /** - * Checks if a user is allowed to perform the activity given by - * method name + * Checks if a user is allowed to perform the activity given by + * method name * - * @param string $user_id id of user to check - * @param string $method_name to see if user allowed to do - * @return bool whether or not the user is allowed + * @param string $user_id id of user to check + * @param string $method_name to see if user allowed to do + * @return bool whether or not the user is allowed */ function isAllowedUserActivity($user_id, $method_name) { @@ -235,12 +250,12 @@ class UserModel extends Model return $row; } /** - * Looks up a USERS row based on their $email (potentially not unique) - * and the time at which their account was create in microseconds - * @param string $email of user to lookup - * @param string $creation_time when the user's account was created in - * the current epoch - * @return array row from USERS table + * Looks up a USERS row based on their $email (potentially not unique) + * and the time at which their account was create in microseconds + * @param string $email of user to lookup + * @param string $creation_time when the user's account was created in + * the current epoch + * @return array row from USERS table */ function getUserByEmailTime($email, $creation_time) { @@ -255,9 +270,11 @@ class UserModel extends Model return $row; } /** - * Get a status of user by user_id + * Set status of user by user_id * * @param string $user_id id of the user + * @param int $status one of ACTIVE_STATUS, INACTIVE_STATUS, or + * BANNED_STATUS */ function updateUserStatus($user_id, $status) { @@ -269,7 +286,20 @@ class UserModel extends Model $sql = "UPDATE USERS SET STATUS=? WHERE USER_ID=?"; $db->execute($sql, array($status, $user_id)); } - + /** + * Does the insert into Users table portion of the creation of a new + * user + * + * @param string $username the username of the user to be added + * @param string $password the password of the user to be added + * @param string $firstname the firstname of the user to be added + * @param string $lastname the lastname of the user to be added + * @param string $email the email of the user to be added + * @param int $status one of ACTIVE_STATUS, INACTIVE_STATUS, or + * BANNED_STATUS + * @param string $zkp_password the password parameters need to + * verify a Fiat-Shamir password + */ function addUserToUsersTable($username, $password, $firstname='', $lastname='', $email='', $status = ACTIVE_STATUS, $zkp_password='') { @@ -288,10 +318,16 @@ class UserModel extends Model * that can login to the admin panel * * @param string $username the username of the user to be added - * @param string $password the password of the user to be added + * @param string $password the password in plaintext + * of the user to be added, and ZKP auth not being used (else + * this can be the empty string) * @param string $firstname the firstname of the user to be added * @param string $lastname the lastname of the user to be added * @param string $email the email of the user to be added + * @param int $status one of ACTIVE_STATUS, INACTIVE_STATUS, or + * BANNED_STATUS + * @param string $zkp_password the password parameters needed to + * verify a Fiat-Shamir password * @return mixed false if operation not successful, user_id otherwise */ function addUser($username, $password, $firstname='', $lastname='', @@ -324,7 +360,7 @@ class UserModel extends Model * Deletes a user by username from the list of users that can login to * the admin panel * - * @param string $username the login name of the user to delete + * @param string $user_name the login name of the user to delete */ function deleteUser($user_name) { @@ -342,10 +378,10 @@ class UserModel extends Model $result = $db->execute($sql, array($user_id)); } /** - * Used to update the fields stored in a USERS row according to - * an array holding new values + * Used to update the fields stored in a USERS row according to + * an array holding new values * - * @param array $user updated values for a USERS row + * @param array $user updated values for a USERS row */ function updateUser($user) { diff --git a/models/visitor_model.php b/models/visitor_model.php index 02a388d4c..6c58f5568 100644 --- a/models/visitor_model.php +++ b/models/visitor_model.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -44,20 +44,21 @@ require_once BASE_DIR."/models/model.php"; class VisitorModel extends Model { /** - * Looks up an ip address to get the last time it was seen and the - * duration of the last time out period. If the last time it was seen - * was more than the forget age then it is removed from the visitor - * table and treated as in never seen (i.e., this function returns - * false if never seen before) + * Looks up an ip address to get the last time it was seen and the + * duration of the last time out period. If the last time it was seen + * was more than the forget age then it is removed from the visitor + * table and treated as in never seen (i.e., this function returns + * false if never seen before) * - * @param string $ip_address the ipv4 or ipv6 address as a string - * @return array associtaive array containing ADDRESS, the ip address; - * PAGE_NAME, the name of the static page to show if within the - * timeout period, END_TIME, time in seconds of current epoch until - * timeout period is over; DELAY, the current length of a timeout - * in seconds that a failed account creation or recovery should incur; - * FORGET_AGE, how long without a visit by this ip until the address - * should be treated as never seen before. + * @param string $ip_address the ipv4 or ipv6 address as a string + * @param string $page_name name of timeout page that we are checking for + * @return array associative array containing ADDRESS, the ip address; + * PAGE_NAME, the name of the static page to show if within the + * timeout period, END_TIME, time in seconds of current epoch until + * timeout period is over; DELAY, the current length of a timeout + * in seconds that a failed account creation or recovery should incur; + * FORGET_AGE, how long without a visit by this ip until the address + * should be treated as never seen before. */ function getVisitor($ip_address, $page_name = 'captcha_time_out') { @@ -79,10 +80,10 @@ class VisitorModel extends Model return $row; } /** - * Deletes an ip address from the VISITOR table + * Deletes an ip address from the VISITOR table * - * @param string $ip_address the ipv4 or ipv6 address as a string - * @param string $page_name + * @param string $ip_address the ipv4 or ipv6 address as a string + * @param string $page_name */ function removeVisitor($ip_address, $page_name = 'captcha_time_out') { @@ -90,22 +91,22 @@ class VisitorModel extends Model $this->db->execute($sql, array($ip_address, $page_name)); } /** - * This creates or updates a visitor table entry for an ip address. - * These entries are used to keep track of which ip should be made to - * see a timeout static page because of failing to input captcha or - * recovery info correctly. + * This creates or updates a visitor table entry for an ip address. + * These entries are used to keep track of which ip should be made to + * see a timeout static page because of failing to input captcha or + * recovery info correctly. * - * @param string $ip_address ipv4 or ipv6 address to insert or update. - * @param string $page_name name of page (served by - * StaticController) to display if ip is in a timeout period - * @param int $start_delay only is used if ip address does not - * already have an entry in the VISITOR table in which case it - * is the initial timeout period a user must wait if the there is - * a captcha or receovery info error - * @param int $forget_age how long without a visit by this ip until the - * address should be treated as never seen before - * @param int string $count_till_double how many accesses before start - * double the delay + * @param string $ip_address ipv4 or ipv6 address to insert or update. + * @param string $page_name name of page (served by + * StaticController) to display if ip is in a timeout period + * @param int $start_delay only is used if ip address does not + * already have an entry in the VISITOR table in which case it + * is the initial timeout period a user must wait if the there is + * a captcha or receovery info error + * @param int $forget_age how long without a visit by this ip until the + * address should be treated as never seen before + * @param int $count_till_double how many accesses before start + * double the delay */ function updateVisitor($ip_address, $page_name, $start_delay = 1, $forget_age = self::ONE_WEEK, $count_till_double = 1) diff --git a/privacy.php b/privacy.php index 00ab1e1e8..138b93676 100755 --- a/privacy.php +++ b/privacy.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Web page used to display information about the privacy policy of * the SeekQuarry/Yioop Search engine diff --git a/scripts/basic.js b/scripts/basic.js index 73dd7f0e8..1d128a276 100755 --- a/scripts/basic.js +++ b/scripts/basic.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -30,9 +30,9 @@ * @filesource */ /* - * Display a two second message in the message div at the top of the web page + * Display a two second message in the message div at the top of the web page * - * @param String msg string to display + * @param String msg string to display */ function doMessage(msg) { @@ -41,8 +41,8 @@ function doMessage(msg) msg_timer = setInterval("undoMessage()", 2000); } /* - * Undisplays the message display in the message div and clears associated - * message display timer + * Undisplays the message display in the message div and clears associated + * message display timer */ function undoMessage() { @@ -51,9 +51,9 @@ function undoMessage() clearInterval(msg_timer); } /* - * Function to set up a request object even in older IE's + * Function to set up a request object even in older IE's * - * @return Object the request object + * @return Object the request object */ function makeRequest() { @@ -73,11 +73,11 @@ function makeRequest() return request; } /* - * Make an AJAX request for a url and put the results as inner HTML of a tag - * If the response is the empty string then the tag is not replaced + * Make an AJAX request for a url and put the results as inner HTML of a tag + * If the response is the empty string then the tag is not replaced * - * @param Object tag a DOM element to put the results of the AJAX request - * @param String url web page to fetch using AJAX + * @param Object tag a DOM element to put the results of the AJAX request + * @param String url web page to fetch using AJAX */ function getPage(tag, url) { @@ -96,9 +96,9 @@ function getPage(tag, url) } } /* - * Returns the position of the caret within anode + * Returns the position of the caret within anode * - * @param String input type element + * @param String input type element */ function caret(node) { @@ -121,39 +121,39 @@ function caret(node) return len; } /* - * Shorthand for document.createElement() + * Shorthand for document.createElement() * - * @param String name tag name of element desired - * @return Element the create element + * @param String name tag name of element desired + * @return Element the create element */ function ce(name) { return document.createElement(name); } /* - * Shorthand for document.getElementById() + * Shorthand for document.getElementById() * - * @param String id the id of the DOM element one wants + * @param String id the id of the DOM element one wants */ function elt(id) { return document.getElementById(id); } /* - * Shorthand for document.getElementsByTagName() + * Shorthand for document.getElementsByTagName() * - * @param String name the name of the DOM element one wants + * @param String name the name of the DOM element one wants */ function tag(name) { return document.getElementsByTagName(name); } /* - * Sets whether an elt is styled as display:none or block + * Sets whether an elt is styled as display:none or block * - * @param String id the id of the DOM element one wants - * @param mixed value true means display block; false display none; - * anything else will display that value + * @param String id the id of the DOM element one wants + * @param mixed value true means display block; false display none; + * anything else will display that value */ function setDisplay(id, value) { @@ -168,7 +168,7 @@ function setDisplay(id, value) } /* * Toggles an element between display:none and display block - * @param String id the id of the DOM element one wants + * @param String id the id of the DOM element one wants */ function toggleDisplay(id) { diff --git a/scripts/big_int.js b/scripts/big_int.js index a2302b961..d98897ff9 100644 --- a/scripts/big_int.js +++ b/scripts/big_int.js @@ -22,7 +22,7 @@ * END LICENSE * * @author Akash Patel (edited by Chris Pollett chris@pollett.org) - * Ideas adapted Leemon Baird's bigint.js + * Ideas adapted Leemon Baird's bigint.js * @package seek_quarry * @subpackage javascript * @license http://www.gnu.org/licenses/ GPL3 @@ -95,7 +95,7 @@ function expandBigInt(x, n) * @param int bits expected number of bits * @param int min_size minimum size of the BigInt. * @return Array stores the BigInt in bits_per_element-bit chunks, - * little endian + * little endian */ function int2BigInt(t, bits, min_size) { diff --git a/scripts/classifiers.js b/scripts/classifiers.js index 42a5e88ea..3227a7921 100644 --- a/scripts/classifiers.js +++ b/scripts/classifiers.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -453,7 +453,7 @@ var Classifier = (function() { * @param string label anchor text displayed to the user * @param string action action associated with this anchor * @param object doc data structure representing the document the action - * should be applied to + * should be applied to * @return object paragraph DOM element wrapping the created anchor */ self.buildActionLinkHTML = function(label, action, doc) @@ -474,7 +474,7 @@ var Classifier = (function() { * * @param object doc data structure representing the document * @return string HTML string to be used to display confidence and - * disagreement + * disagreement */ self.buildPredictionHTML = function(doc) { @@ -500,9 +500,9 @@ var Classifier = (function() { * * @param string tagname opening and closing tag name * @param object attributes optional object for which the keys are - * attribute names, and the values are attribute values (may be empty) + * attribute names, and the values are attribute values (may be empty) * @param string|array nested... optional sequence of HTML strings or - * arrays of HTML strings to be nested within the opening and closing tags + * arrays of HTML strings to be nested within the opening and closing tags * @return string HTML string for the described element */ function tags(tagname, attributes /* ... */) @@ -531,7 +531,7 @@ var Classifier = (function() { * * @param string tagname opening tag name * @param object attributes optional object for which the keys are - * attribute names, and the values are attribute values (may be empty) + * attribute names, and the values are attribute values (may be empty) * @return string HTML string for the described element */ function tag(tagname, attributes) @@ -544,7 +544,7 @@ var Classifier = (function() { * * @param string tagname opening tag name * @param object attributes optional object for which the keys are - * attribute names, and the values are attribute values (may be empty) + * attribute names, and the values are attribute values (may be empty) * @return string HTML string for the opening (or self-closing) tag */ function makeOpenTag(tagname, attributes, endtag) @@ -567,11 +567,11 @@ var Classifier = (function() { * template string. * * @param string template template string that optionally contains sentinel - * sequences of the form '{\d+}' to be replaced + * sequences of the form '{\d+}' to be replaced * @param string arg... positional arguments to be substituted into the - * template string + * template string * @return string the template string with each sentinel pattern replaced - * by the appropriate argument + * by the appropriate argument */ function format(template /* ... */) { @@ -591,41 +591,41 @@ var Classifier = (function() { * being passed to the onSuccess handler. The options object supports the * following keys: * - * string url: URL to send the request to (required) + * string url: URL to send the request to (required) * - * string method: HTTP method to use (default GET, but changes to POST - * if postdata is specified without also setting the method) + * string method: HTTP method to use (default GET, but changes to POST + * if postdata is specified without also setting the method) * - * object postdata: object containing key/value pairs of POST arguments - * to be sent with the request; the values are automatically - * URI-encoded (optional) + * object postdata: object containing key/value pairs of POST arguments + * to be sent with the request; the values are automatically + * URI-encoded (optional) * - * function onSuccess: function to be called upon the completion of a - * successful request; the response body is passed as the first and - * only argument, JSON-decoded if the response content-type was - * application/json (optional) + * function onSuccess: function to be called upon the completion of a + * successful request; the response body is passed as the first and + * only argument, JSON-decoded if the response content-type was + * application/json (optional) * - * function onFailure: function called if the request times out or - * otherwise can't be completed (optional) + * function onFailure: function called if the request times out or + * otherwise can't be completed (optional) * * Example: * - * sendRequest({ - * 'url': '?c=classifier&a=classify&arg=getdocs', - * 'postdata': { - * 'time': self.authTime, - * 'session': self.authSession, - * 'label': self.classLabel, - * 'mix': label_docs_source.value - * 'keywords': label_docs_keywords.value - * }, - * 'onSuccess': function(response) { - * ... - * }, - * 'onFailure': function() { - * ... - * } - * }); + * sendRequest({ + * 'url': '?c=classifier&a=classify&arg=getdocs', + * 'postdata': { + * 'time': self.authTime, + * 'session': self.authSession, + * 'label': self.classLabel, + * 'mix': label_docs_source.value + * 'keywords': label_docs_keywords.value + * }, + * 'onSuccess': function(response) { + * ... + * }, + * 'onFailure': function() { + * ... + * } + * }); * * @param object options request options. */ @@ -679,9 +679,9 @@ var Classifier = (function() { * a.b.c would be converted to a[b][c] in the query string. * * @param object obj optionally-nested object to be converted to a query - * string + * string * @param string prefix optional prefix to prepend to keys in obj (used in - * recursive calls) + * recursive calls) * @return string query string representation of obj */ function buildQueryString(obj, prefix) @@ -747,32 +747,32 @@ var Classifier = (function() { * order to cancel the loading state. The options object may contain the * following fields: * - * bool dots: whether to automatically append dots to the loading text - * with the passage of a set time interval; the dots start over - * each time they reach three (default true) + * bool dots: whether to automatically append dots to the loading text + * with the passage of a set time interval; the dots start over + * each time they reach three (default true) * - * int dotsInterval: how long to wait before drawing the next dot - * (default 333ms) + * int dotsInterval: how long to wait before drawing the next dot + * (default 333ms) * - * string className: class name to add to the element when loading - * starts, and to remove when it completes (default none) + * string className: class name to add to the element when loading + * starts, and to remove when it completes (default none) * * Example: * - * var loading = loadingText(el, 'Loading'); - * someAsynchronousAction({ - * onComplete: function() { - * loading.clear(); - * ... - * } - * }); + * var loading = loadingText(el, 'Loading'); + * someAsynchronousAction({ + * onComplete: function() { + * loading.clear(); + * ... + * } + * }); * * @param object el DOM object to be manipulated * @param string text loading text with which to replace el's innerHTML * @param object options loading options * @return object object with a clear method, which can be called in order - * to cancel the loading state, restoring everything to the way it was - * before loading started + * to cancel the loading state, restoring everything to the way it was + * before loading started */ function loadingText(el, text, options) { diff --git a/scripts/hash_captcha.js b/scripts/hash_captcha.js index 981f5f42f..a41c934b6 100644 --- a/scripts/hash_captcha.js +++ b/scripts/hash_captcha.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -30,12 +30,12 @@ * @filesource */ /* - * Finds the nonce for the input parameters given by the server. + * Finds the nonce for the input parameters given by the server. * - * @param Object nonce_for_string a DOM element to put the value of a nonce - * @param Object random_string a DOM element to get the value of random_string - * @param Object time a DOM element to get the value of the time - * @param Object level a DOM element to get the value of a level + * @param Object nonce_for_string a DOM element to put the value of a nonce + * @param Object random_string a DOM element to get the value of random_string + * @param Object time a DOM element to get the value of the time + * @param Object level a DOM element to get the value of a level */ function findNonce(nonce_for_string, random_string, time, level) { @@ -50,15 +50,15 @@ function findNonce(nonce_for_string, random_string, time, level) } } /* - * This function calculates the sha1 of a string until - * number of a leading zeroes in the sha1 value matchesa level - * parameter. + * This function calculates the sha1 of a string until + * number of a leading zeroes in the sha1 value matchesa level + * parameter. * - * @param String random_string a string sent by the server - * @param String time the time sent by the server - * @param String level define number of leading zeroes - * @return int nonce for which the sha1 of a string - * produces the level number of a zeroes + * @param String random_string a string sent by the server + * @param String time the time sent by the server + * @param String level define number of leading zeroes + * @return int nonce for which the sha1 of a string + * produces the level number of a zeroes */ function hashStamp(random_string, time, level) { diff --git a/scripts/history.js b/scripts/history.js index 8d7979b66..b4510ff6e 100644 --- a/scripts/history.js +++ b/scripts/history.js @@ -31,9 +31,9 @@ */ if(typeof(elt) == "undefined") { /* - * Shorthand for document.getElementById + * Shorthand for document.getElementById * - * @param String id the id of the DOM element one wants + * @param String id the id of the DOM element one wants */ function elt(id) { diff --git a/scripts/mix.js b/scripts/mix.js index 38a6f1d8b..39b13b595 100644 --- a/scripts/mix.js +++ b/scripts/mix.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -70,7 +70,7 @@ function redrawFragments() * Adds a crawl fragment to the end of the list of crawl fragments. * * @param int num_results the number of results the crawl fragment should be - * used for + * used for * @param int the maximum number of fragments one is allowed to add * @param String error to give if too many fragments */ @@ -239,7 +239,7 @@ function removeCrawl(i, j) * * @param int i which crawl fragment the crawl belongs to * @param int j which crawl index within the fragment to draw this weight select - * for + * for * @param int selected_weight the originally selected weight value */ function drawWeightSelect(i, j, selected_weight) { diff --git a/scripts/sha1.js b/scripts/sha1.js index 24d033283..cd474e547 100644 --- a/scripts/sha1.js +++ b/scripts/sha1.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -30,10 +30,10 @@ * @filesource */ /* - * Calculates the sha1 of the given String. + * Calculates the sha1 of the given String. * - * @param String input string for the function - * @return String sha1 of the input string + * @param String input string for the function + * @return String sha1 of the input string */ function generateSha1(str) { @@ -85,10 +85,10 @@ function generateSha1(str) return bin2hex(Array(a, b, c, d, e)); } /* - * Converts a binary array into a hexadecimal value + * Converts a binary array into a hexadecimal value * - * @param array binarray array of a 5 binary values - * @return String hexadecimal + * @param array binarray array of a 5 binary values + * @return String hexadecimal */ function bin2hex(binarray) { @@ -103,13 +103,13 @@ function bin2hex(binarray) return str; } /* - * Computes sha1 f values based on iteration + * Computes sha1 f values based on iteration * - * @param int t value of iteration - * @param int b constant value - * @param int c constant value - * @param int d constant value - * @return int result of a xor value on constants + * @param int t value of iteration + * @param int b constant value + * @param int c constant value + * @param int d constant value + * @return int result of a xor value on constants */ function hashOperationByIteration(t, b, c, d) { @@ -125,10 +125,10 @@ function hashOperationByIteration(t, b, c, d) return b^c^d; } /* - * Finds a constant based on the iteration + * Finds a constant based on the iteration * - * @param int t value of iteration - * @return int constant value + * @param int t value of iteration + * @return int constant value */ function constantForIteration(t) { @@ -143,11 +143,11 @@ function constantForIteration(t) } } /* - * Add integers, wrapping at 2^32 + * Add integers, wrapping at 2^32 * - * @param int x first operand of the add operation - * @param int y second operand of the add operation - * @return int result of the add operation + * @param int x first operand of the add operation + * @param int y second operand of the add operation + * @return int result of the add operation */ function safeAdd(x, y) { @@ -156,22 +156,22 @@ function safeAdd(x, y) return (msw << 16) | (lsw & 0xFFFF); } /* - * Bitwise rotate a 32-bit number + * Bitwise rotate a 32-bit number * - * @param int num number on which rotation operation is performed - * @param int count define a number of times the shift opeation should perform - * @return int result of the rotate operation + * @param int num number on which rotation operation is performed + * @param int count define a number of times the shift opeation should perform + * @return int result of the rotate operation */ function rotate(num, cnt) { return (num << cnt) | zeroFill(num, 32 - cnt); } /* - * Used for zero padding an the input number if a number is not 32 bit + * Used for zero padding an the input number if a number is not 32 bit * - * @param int a input number - * @param int b to define how many leading zero should be added - * @return int 32 bit number + * @param int a input number + * @param int b to define how many leading zero should be added + * @return int 32 bit number */ function zeroFill(a, b) { @@ -190,10 +190,10 @@ function zeroFill(a, b) return bin2dec(bin); } /* - * Converts decimal number to binary string + * Converts decimal number to binary string * - * @param int number input number - * @return string binary number + * @param int number input number + * @return string binary number */ function dec2bin(number) { @@ -203,10 +203,10 @@ function dec2bin(number) return parseInt(number, 10).toString(2); } /* - * Converts binary string to decimal number + * Converts binary string to decimal number * - * @param string binary string input string - * @return int decimal number + * @param string binary string input string + * @return int decimal number */ function bin2dec(binary_string) { diff --git a/scripts/suggest.js b/scripts/suggest.js index 78f8bbceb..652c5f30e 100644 --- a/scripts/suggest.js +++ b/scripts/suggest.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sandhya Vissapragada, Chris Pollett * @package seek_quarry @@ -35,7 +35,7 @@ */ SUGGEST_VERSION_NO = 0; /* - * Constants for key codes will handle + * Constants for key codes will handle */ KeyCodes = new Object(); KeyCodes.UP_ARROW = 38; @@ -449,7 +449,7 @@ function sortLocalTerms() * @param String a in format described above * @param String b in format described above * @return number 0 - if same frequncy, negative if b has larger frequency, - * postive otherwise + * postive otherwise */ function termFrequencyComparison(a, b) { @@ -493,7 +493,7 @@ function termClick(term,termid) * @param Array trie_array contains all search terms * @param String parent_word the prefix want to find sub-term for in trie * @param String highlighted_word parent_word, root_word + "<b>" + rest of - * parent + * parent */ function getTrieTerms(trie_array, parent_word, highlighted_word) { diff --git a/scripts/wiki.js b/scripts/wiki.js index 80b462ca2..8629fa764 100755 --- a/scripts/wiki.js +++ b/scripts/wiki.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Eswara Rajesh Pinapala (edited Chris Pollett) * @package seek_quarry @@ -62,8 +62,8 @@ var editor_all_buttons = []; */ var editor_buttons = []; /** - * Object that buffers selection information. - * @var Object + * Object that buffers selection information. + * @var Object */ var editor_buffer = {}; /** @@ -336,7 +336,7 @@ function setCaretPosition(text_field, pos) * * @param String name identifier of the wiki task to be performed * @param String id indentifer of the textarea to add wiki code for the given - * task + * task */ function wikifySelection(name, id) { @@ -493,9 +493,9 @@ function addWikiSearch(id) } /** - * Gets the size of the search widget to load. + * Gets the size of the search widget to load. * - * @param String id identifier of the textarea to put search form on + * @param String id identifier of the textarea to put search form on */ function useInputForSearch(id) { @@ -680,11 +680,11 @@ function createTableForm(id) /** * Creates an HTMLFormElement with two text fields to get the URL and text of - * a link + * a link * @param String id identifier of the text area that we want to add a wiki link - * to + * to * @return HTMLFormElement containing form that we will use to get info from - * the user so that we can later add a wiki link + * the user so that we can later add a wiki link */ function createHyperlinkForm(id) { diff --git a/scripts/zkp.js b/scripts/zkp.js index 45d57cf72..832a791a6 100644 --- a/scripts/zkp.js +++ b/scripts/zkp.js @@ -1,25 +1,25 @@ /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Akash Patel (edited by Chris Pollett chris@pollett.org) * @package seek_quarry @@ -30,11 +30,11 @@ * @filesource */ /* - * Returns RSA like modulus. + * Returns RSA like modulus. * - * @param String id identifier of a hidden input field containing the - * modulus to use in the Fiat Shamir Protocol - * @return BigInt RSA-like modulus. + * @param String id identifier of a hidden input field containing the + * modulus to use in the Fiat Shamir Protocol + * @return BigInt RSA-like modulus. */ function getN(id) { @@ -42,15 +42,15 @@ function getN(id) return str2BigInt(n, 10, 0); } /* - * Generates Fiat shamir parameters such as x and y and append - * with the input form + * Generates Fiat shamir parameters such as x and y and append + * with the input form * - * @param Object fiat_shamir_id id of the form - * @param String sha1 of the user password - * @param int e random value sent by the server. Either 0 or 1. - * @param String user_name id of the form - * @param String modulus_id identifier of hidden field with modulus to use in - * Fiat Shamir + * @param Object fiat_shamir_id id of the form + * @param String sha1 of the user password + * @param int e random value sent by the server. Either 0 or 1. + * @param String user_name id of the form + * @param String modulus_id identifier of hidden field with modulus to use in + * Fiat Shamir */ function dynamicForm(zkp_form_id, sha1, e, user_name, modulus_id) { @@ -77,16 +77,16 @@ function dynamicForm(zkp_form_id, sha1, e, user_name, modulus_id) zkp_form.submit(); } /* - * Generates Fiat shamir parameters Y. When user gives username, password - * for the first time it stored the password on the cookie. From rest of - * the Fiat shamir iteration it uses password stores on the client side - * cookie. + * Generates Fiat shamir parameters Y. When user gives username, password + * for the first time it stored the password on the cookie. From rest of + * the Fiat shamir iteration it uses password stores on the client side + * cookie. * - * @param String sha1 sha1 of the password - * @param int e random value sent by the server. Either 0 or 1. - * @param BigInt r random value picked by the client - * @param BigInt n RSA like modulus - * @return BigInt y fiat-shamir parameter Y. + * @param String sha1 sha1 of the password + * @param int e random value sent by the server. Either 0 or 1. + * @param BigInt r random value picked by the client + * @param BigInt n RSA like modulus + * @return BigInt y fiat-shamir parameter Y. */ function getY(sha1, e, r, n) { @@ -102,10 +102,10 @@ function getY(sha1, e, r, n) return y; } /* - * Generates random number and converts it into BigInteger in provided range + * Generates random number and converts it into BigInteger in provided range * - * @param BigInt range. Random number be from 0 to range - 1 - * @return BigInteger final_r random BigInteger + * @param BigInt range. Random number be from 0 to range - 1 + * @return BigInteger final_r random BigInteger */ function getR(range) { @@ -142,15 +142,15 @@ function getR(range) return final_r; } /* - * Generates Fiat shamir parameters such as x and y and append - * with the input form. This method calls first time when user - * provides user name and password + * Generates Fiat shamir parameters such as x and y and append + * with the input form. This method calls first time when user + * provides user name and password * - * @param Object zkp_form_id identifier of the form with zkp data - * @param String username_id identifier of the form element with the username - * @param String password_id identifier of the form element with the password - * @param int e random value send by the server. Either 0 or 1. - * @param int auth_count number of Fiat-Shamir iterations + * @param Object zkp_form_id identifier of the form with zkp data + * @param String username_id identifier of the form element with the username + * @param String password_id identifier of the form element with the password + * @param int e random value send by the server. Either 0 or 1. + * @param int auth_count number of Fiat-Shamir iterations */ function generateKeys(zkp_form_id, username_id, password_id, modulus_id, e, auth_count) @@ -199,16 +199,16 @@ function generateKeys(zkp_form_id, username_id, password_id, dynamicForm(zkp_form_id, sha1, e, u, modulus_id); } /* - * Sends Fiat-Shamir via AJAX parameters and receives parameter e from server + * Sends Fiat-Shamir via AJAX parameters and receives parameter e from server * - * @param BigInt x Fiat-Shamir parameter x - * (@see SigninModel::checkValidSigninForZKP for details) - * @param BigInt y Fiat-Shamir parameter y - * @param String u username provided by user - * @param String token CSRF token sent by the server - * @param String token_name name to use for CSRF token - * @param String round_num on the server this is used only to see if 0 - * in which case it restarts the count + * @param BigInt x Fiat-Shamir parameter x + * (@see SigninModel::checkValidSigninForZKP for details) + * @param BigInt y Fiat-Shamir parameter y + * @param String u username provided by user + * @param String token CSRF token sent by the server + * @param String token_name name to use for CSRF token + * @param String round_num on the server this is used only to see if 0 + * in which case it restarts the count */ function sendFiatShamirParameters(x, y, u, token, token_name, round_num) { @@ -226,12 +226,12 @@ function sendFiatShamirParameters(x, y, u, token, token_name, round_num) http.send(params); } /* - * This function is used during create account module and when - * authentication mode is ZKP. + * This function is used during create account module and when + * authentication mode is ZKP. * - * @param String password_id element that holds ZKP password - * @param String repassword_id element that holds retyped ZKP password - * @param String modulus_id element that holds fiat shamir modulus + * @param String password_id element that holds ZKP password + * @param String repassword_id element that holds retyped ZKP password + * @param String modulus_id element that holds fiat shamir modulus */ function registration(password_id, repassword_id, modulus_id) { diff --git a/terms.php b/terms.php index 491561e16..7dfd00b10 100755 --- a/terms.php +++ b/terms.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Web page used to display information about the terms cna condition for * the use of this web site diff --git a/tests/bloom_filter_file_test.php b/tests/bloom_filter_file_test.php index a12242bb7..ce2baa4f5 100755 --- a/tests/bloom_filter_file_test.php +++ b/tests/bloom_filter_file_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load in the BloomFilterFile class we are testing + * Load in the BloomFilterFile class we are testing * */ require_once BASE_DIR."/lib/bloom_filter_file.php"; diff --git a/tests/btree_test.php b/tests/btree_test.php index aa377b86a..e9d74ea79 100644 --- a/tests/btree_test.php +++ b/tests/btree_test.php @@ -1,27 +1,27 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -44,13 +44,6 @@ * For base model class */ require_once BASE_DIR."/models/model.php"; - /** - * Used to test insert, lookup, and deletion of key-value pairs on the B-Tree. - * - * @author Akshat Kukreti - * @package seek_quarry - * @subpackage test - */ /** * Test directory to hold btree used for these unit tests */ @@ -63,6 +56,13 @@ define('DEGREE', 2); * Number of key value pairs to insert for unit tests */ define('NUM_VALS', 25); +/** + * Used to test insert, lookup, and deletion of key-value pairs on the B-Tree. + * + * @author Akshat Kukreti + * @package seek_quarry + * @subpackage test + */ class BTreeTest extends UnitTest { /** diff --git a/tests/epub_processor_test.php b/tests/epub_processor_test.php index f4c67530e..c3139a26a 100644 --- a/tests/epub_processor_test.php +++ b/tests/epub_processor_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Vijeth Patil vijeth.patil@gmail.com * @package seek_quarry @@ -32,15 +32,15 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load search engine-wide configuration file + * Load search engine-wide configuration file */ require_once BASE_DIR.'/configs/config.php'; /** - * Load the EpubProcessor class we are going to test + * Load the EpubProcessor class we are going to test */ require_once BASE_DIR."/lib/processors/epub_processor.php"; /** - * Load the base unit test class + * Load the base unit test class */ require_once BASE_DIR."/lib/unit_test.php"; diff --git a/tests/hash_table_test.php b/tests/hash_table_test.php index 968d35841..7b67f51f3 100755 --- a/tests/hash_table_test.php +++ b/tests/hash_table_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,21 +32,21 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load the hash table library we'll be testing + * Load the hash table library we'll be testing */ require_once BASE_DIR."/lib/hash_table.php"; /** - * Load the crawlHash function + * Load the crawlHash function */ require_once BASE_DIR.'/lib/utility.php'; /** - * Used to test that the HashTable class properly stores key value pairs, - * handles insert, deletes, collisions okay. It should also detect when - * table is full + * Used to test that the HashTable class properly stores key value pairs, + * handles insert, deletes, collisions okay. It should also detect when + * table is full * - * @author Chris Pollett - * @package seek_quarry - * @subpackage test + * @author Chris Pollett + * @package seek_quarry + * @subpackage test */ class HashTableTest extends UnitTest { @@ -203,7 +203,7 @@ class HashTableTest extends UnitTest "New Item hi7 location does not overwrite deleted items"); } /** - * Test how fast insertion and deletions can be done + * Test how fast insertion and deletions can be done */ function timingTestCase() { diff --git a/tests/index.php b/tests/index.php index 082a8a02c..b6b6448fe 100644 --- a/tests/index.php +++ b/tests/index.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Web page used to display test results for the available unit tests of * the SeekQuarry/Yioop Search engine @@ -80,11 +80,11 @@ define("NO_CACHE", true); <body> <?php /** - * Load the base unit test class + * Load the base unit test class */ require_once BASE_DIR."/lib/unit_test.php"; /** - * Load the base unit test class for Javascript tests + * Load the base unit test class for Javascript tests */ require_once BASE_DIR."/lib/javascript_unit_test.php"; /** @@ -127,7 +127,7 @@ function listTests() } /** - * Runs all the unit_tests in the current directory and displays the results + * Runs all the unit_tests in the current directory and displays the results */ function runAllTests() { diff --git a/tests/index_shard_test.php b/tests/index_shard_test.php index f4286ab92..8320d2feb 100644 --- a/tests/index_shard_test.php +++ b/tests/index_shard_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,25 +32,25 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load the library for crawlHash + * Load the library for crawlHash */ require_once BASE_DIR."/lib/utility.php"; /** - * Load the library for crawlHash + * Load the library for crawlHash */ require_once BASE_DIR."/lib/crawl_constants.php"; /** - * Load the index_shard library we'll be testing + * Load the index_shard library we'll be testing */ require_once BASE_DIR."/lib/index_shard.php"; /** - * Used to test that the IndexShard class can properly add new documents - * and retrieve those documents by word. Checks that doc offsets can be - * updated, shards can be saved and reloaded + * Used to test that the IndexShard class can properly add new documents + * and retrieve those documents by word. Checks that doc offsets can be + * updated, shards can be saved and reloaded * - * @author Chris Pollett - * @package seek_quarry - * @subpackage test + * @author Chris Pollett + * @package seek_quarry + * @subpackage test */ class IndexShardTest extends UnitTest { diff --git a/tests/it_tokenizer_test.php b/tests/it_tokenizer_test.php index 0148fcf2a..0d8728ee3 100644 --- a/tests/it_tokenizer_test.php +++ b/tests/it_tokenizer_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,11 +32,11 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load the Italian Tokenizer via phrase_parser (5.4 hack) + * Load the Italian Tokenizer via phrase_parser (5.4 hack) */ require_once BASE_DIR."/lib/phrase_parser.php"; /** - * Load the run function + * Load the run function */ require_once BASE_DIR.'lib/unit_test.php'; /** diff --git a/tests/many_user_experiment.php b/tests/many_user_experiment.php index 220f9b59c..88dfb4ff4 100644 --- a/tests/many_user_experiment.php +++ b/tests/many_user_experiment.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Test to see for big strings which how long various string concatenation * operations take. diff --git a/tests/pdf_processor_test.php b/tests/pdf_processor_test.php index 4fcc58b19..1fc981811 100644 --- a/tests/pdf_processor_test.php +++ b/tests/pdf_processor_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,15 +32,15 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load search engine-wide configuration file + * Load search engine-wide configuration file */ require_once BASE_DIR.'/configs/config.php'; /** - * Load the PdfProcessor class we are going to test + * Load the PdfProcessor class we are going to test */ require_once BASE_DIR."/lib/processors/pdf_processor.php"; /** - * Load the base unit test class + * Load the base unit test class */ require_once BASE_DIR."/lib/unit_test.php"; /** diff --git a/tests/phrase_parser_test.php b/tests/phrase_parser_test.php index 61ac3d4b8..975d3cd97 100644 --- a/tests/phrase_parser_test.php +++ b/tests/phrase_parser_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,20 +32,20 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load the url parser library we'll be testing + * Load the url parser library we'll be testing */ require_once BASE_DIR."/lib/phrase_parser.php"; /** - * For guessLocaleFromString + * For guessLocaleFromString */ require_once BASE_DIR."/lib/locale_functions.php"; /** - * Used to test that the PhraseParser class. Want to make sure bigram - * extracting works correctly + * Used to test that the PhraseParser class. Want to make sure bigram + * extracting works correctly * - * @author Chris Pollett - * @package seek_quarry - * @subpackage test + * @author Chris Pollett + * @package seek_quarry + * @subpackage test */ class PhraseParserTest extends UnitTest { diff --git a/tests/pptx_processor_test.php b/tests/pptx_processor_test.php index de14dab3b..35b9d9c82 100644 --- a/tests/pptx_processor_test.php +++ b/tests/pptx_processor_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Nakul Natu nakul.natu@gmail.com * @package seek_quarry @@ -46,7 +46,7 @@ require_once BASE_DIR."lib/processors/pptx_processor.php"; class PptxProcessorTest extends UnitTest implements CrawlConstants { /** - * Creates a summary of pptx document to check + * Creates a summary of pptx document to check */ function setUp() { diff --git a/tests/priority_queue_test.php b/tests/priority_queue_test.php index ca802f731..97ca57d42 100755 --- a/tests/priority_queue_test.php +++ b/tests/priority_queue_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/tests/queue_server_test.php b/tests/queue_server_test.php index 8918ab247..950eb6696 100644 --- a/tests/queue_server_test.php +++ b/tests/queue_server_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -35,16 +35,16 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} require_once BASE_DIR.'/configs/config.php'; define("UNIT_TEST_MODE", true); /** - * Load the queue server class we'll be testing + * Load the queue server class we'll be testing */ require_once BASE_DIR."/bin/queue_server.php"; /** - * Used to test functions related to scheduling websites to crawl for - * a web crawl (the responsibility of a QueueServer) + * Used to test functions related to scheduling websites to crawl for + * a web crawl (the responsibility of a QueueServer) * - * @author Chris Pollett - * @package seek_quarry - * @subpackage test + * @author Chris Pollett + * @package seek_quarry + * @subpackage test */ class QueueServerTest extends UnitTest { diff --git a/tests/sha1_javascript_test.php b/tests/sha1_javascript_test.php index b995ccfc9..b0a121237 100644 --- a/tests/sha1_javascript_test.php +++ b/tests/sha1_javascript_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -31,10 +31,10 @@ * @filesource */ /** - * Used to test the Javascript implementation of the sha1 function. - * @author Akash Patel - * @package seek_quarry - * @subpackage test + * Used to test the Javascript implementation of the sha1 function. + * @author Akash Patel + * @package seek_quarry + * @subpackage test */ class Sha1JavascriptTest extends JavascriptUnitTest { @@ -44,10 +44,10 @@ class Sha1JavascriptTest extends JavascriptUnitTest */ const NUM_TEST_CASES = 5; /** - * This test case generates random strings and computes their sha1 hash - * in PHP-land. It then sends the strings and their hashes to Javascript - * land to test if the Javascript implementation of Sha1 gets the same - * answer. + * This test case generates random strings and computes their sha1 hash + * in PHP-land. It then sends the strings and their hashes to Javascript + * land to test if the Javascript implementation of Sha1 gets the same + * answer. */ function sha1TestCase() { diff --git a/tests/socket_experiment.php b/tests/socket_experiment.php index 4e0e2552a..2eaf9cfb9 100755 --- a/tests/socket_experiment.php +++ b/tests/socket_experiment.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Test to see how many sockets system can open. On *nix systems, by doing * ulimit -n diff --git a/tests/string_array_test.php b/tests/string_array_test.php index 62e60d9d7..ec1ffd057 100644 --- a/tests/string_array_test.php +++ b/tests/string_array_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,16 +32,16 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load the string_array library we'll be testing + * Load the string_array library we'll be testing */ require_once BASE_DIR."/lib/string_array.php"; /** - * Used to test that the StringArray class properly stores/retrieves values, - * and can handle loading and saving + * Used to test that the StringArray class properly stores/retrieves values, + * and can handle loading and saving * - * @author Chris Pollett - * @package seek_quarry - * @subpackage test + * @author Chris Pollett + * @package seek_quarry + * @subpackage test */ class StringArrayTest extends UnitTest { diff --git a/tests/string_cat_experiment.php b/tests/string_cat_experiment.php index 7f6ae9f8e..67c221890 100644 --- a/tests/string_cat_experiment.php +++ b/tests/string_cat_experiment.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * Test to see for big strings which how long various string concatenation * operations take. diff --git a/tests/trie_test.php b/tests/trie_test.php index b180407ee..6164cf67a 100755 --- a/tests/trie_test.php +++ b/tests/trie_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,20 +32,20 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load the Trie class we'll be testing + * Load the Trie class we'll be testing */ require_once BASE_DIR."/lib/trie.php"; /** - * Load the crawlHash function + * Load the crawlHash function */ require_once BASE_DIR.'/lib/utility.php'; /** - * Used to test that the Trie class properly stores words that - * could be used for an autosuggest dictionary + * Used to test that the Trie class properly stores words that + * could be used for an autosuggest dictionary * - * @author Chris Pollett - * @package seek_quarry - * @subpackage test + * @author Chris Pollett + * @package seek_quarry + * @subpackage test */ class TrieTest extends UnitTest { diff --git a/tests/url_parser_test.php b/tests/url_parser_test.php index 11f974345..6be50adaf 100644 --- a/tests/url_parser_test.php +++ b/tests/url_parser_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,17 +32,17 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load the url parser library we'll be testing + * Load the url parser library we'll be testing */ require_once BASE_DIR."/lib/url_parser.php"; /** - * Used to test that the UrlParser class. For now, want to see that the - * method canonicalLink is working correctly and that - * isPathMemberRegexPaths (used in robot_processor.php) works + * Used to test that the UrlParser class. For now, want to see that the + * method canonicalLink is working correctly and that + * isPathMemberRegexPaths (used in robot_processor.php) works * - * @author Chris Pollett - * @package seek_quarry - * @subpackage test + * @author Chris Pollett + * @package seek_quarry + * @subpackage test */ class UrlParserTest extends UnitTest { diff --git a/tests/utility_test.php b/tests/utility_test.php index 2ea6a8cea..7156c67b9 100644 --- a/tests/utility_test.php +++ b/tests/utility_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,20 +32,20 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load the library for crawlHash + * Load the library for crawlHash */ require_once BASE_DIR."/lib/utility.php"; /** - * Load the library for crawlHash + * Load the library for crawlHash */ require_once BASE_DIR."/lib/crawl_constants.php"; /** - * Used to test the various methods in utility, in particular, those - * related to posting lists. + * Used to test the various methods in utility, in particular, those + * related to posting lists. * - * @author Chris Pollett - * @package seek_quarry - * @subpackage test + * @author Chris Pollett + * @package seek_quarry + * @subpackage test */ class UtilityTest extends UnitTest { diff --git a/tests/web_archive_test.php b/tests/web_archive_test.php index 55b3301ba..6c944443c 100755 --- a/tests/web_archive_test.php +++ b/tests/web_archive_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -36,8 +36,8 @@ require_once BASE_DIR.'/configs/config.php'; /** Loads the WebArchive class we are going to test */ require_once BASE_DIR."/lib/web_archive.php"; /** - * A compressor determines how objects are written into a web_archive. - * This require loads a gzip-based compressor. + * A compressor determines how objects are written into a web_archive. + * This require loads a gzip-based compressor. */ require_once BASE_DIR."/lib/compressors/gzip_compressor.php"; /** @@ -52,7 +52,7 @@ require_once BASE_DIR."/lib/compressors/gzip_compressor.php"; class WebArchiveTest extends UnitTest { /** - * Creates a new web archive object that we can add objects to + * Creates a new web archive object that we can add objects to */ function setUp() { diff --git a/tests/web_queue_bundle_test.php b/tests/web_queue_bundle_test.php index d0bc96402..962efdb1d 100644 --- a/tests/web_queue_bundle_test.php +++ b/tests/web_queue_bundle_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -71,7 +71,7 @@ class WebQueueBundleTest extends UnitTest 1000, 1000, CrawlConstants::MAX); } /** - * Delete the directory and files associated with the WebQueueBundle + * Delete the directory and files associated with the WebQueueBundle */ function tearDown() { diff --git a/tests/xlsx_processor_test.php b/tests/xlsx_processor_test.php index a452ed2ed..c49ae4805 100644 --- a/tests/xlsx_processor_test.php +++ b/tests/xlsx_processor_test.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Tarun Ramaswamy tarun.pepira@gmail.com * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load in the xlsx_processor class we are testing + * Load in the xlsx_processor class we are testing * */ require_once BASE_DIR."/lib/processors/xlsx_processor.php"; diff --git a/views/admin_view.php b/views/admin_view.php index 4273fd107..10c2c4448 100755 --- a/views/admin_view.php +++ b/views/admin_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -42,7 +42,7 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class AdminView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; diff --git a/views/crawlstatus_view.php b/views/crawlstatus_view.php index 36a6d10d8..3742b57c8 100755 --- a/views/crawlstatus_view.php +++ b/views/crawlstatus_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/elements/activity_element.php b/views/elements/activity_element.php index c258beb67..220e9b7df 100755 --- a/views/elements/activity_element.php +++ b/views/elements/activity_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/elements/configure_element.php b/views/elements/configure_element.php index 409a386a8..f58d8e6d5 100644 --- a/views/elements/configure_element.php +++ b/views/elements/configure_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -59,7 +59,7 @@ class ConfigureElement extends Element * from the latter form until a proper working directory is established. * * @param array $data holds data on the profile elements which have been - * filled in as well as data about which form fields to display + * filled in as well as data about which form fields to display */ function render($data) { diff --git a/views/elements/crawloptions_element.php b/views/elements/crawloptions_element.php index 7cc328bdd..0547bb309 100644 --- a/views/elements/crawloptions_element.php +++ b/views/elements/crawloptions_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -47,7 +47,7 @@ class CrawloptionsElement extends Element * Draws configurable options about how a web crawl should be conducted * * @param array $data keys are generally the different setting that can - * be set in the crawl.ini file + * be set in the crawl.ini file */ function render($data) { diff --git a/views/elements/editclassifier_element.php b/views/elements/editclassifier_element.php index 1b4b9c817..52c0db51d 100644 --- a/views/elements/editclassifier_element.php +++ b/views/elements/editclassifier_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -49,7 +49,7 @@ class EditclassifierElement extends Element * Draws the "edit classifier" element to the output buffers. * * @param array $data used to pass the class label, classifier instance, - * and list of existing crawls + * and list of existing crawls */ function render($data) { diff --git a/views/elements/editlocales_element.php b/views/elements/editlocales_element.php index 22ef6f435..9ebbbd265 100644 --- a/views/elements/editlocales_element.php +++ b/views/elements/editlocales_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/elements/editmix_element.php b/views/elements/editmix_element.php index 84179a131..3a80f77c3 100644 --- a/views/elements/editmix_element.php +++ b/views/elements/editmix_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/elements/element.php b/views/elements/element.php index 0b38e2b33..046ed54e7 100755 --- a/views/elements/element.php +++ b/views/elements/element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -51,20 +51,20 @@ abstract class Element */ var $view; /** - * constructor stores a reference to the view this element will reside on + * constructor stores a reference to the view this element will reside on * - * @param object $view object this element will reside on + * @param object $view object this element will reside on */ function __construct($view = NULL) { $this->view = $view; } /** - * This method is responsible for actually drawing the view. - * It should be implemented in subclasses. + * This method is responsible for actually drawing the view. + * It should be implemented in subclasses. * - * @param $data - contains all external data from the controller - * that should be used in drawing the view + * @param $data - contains all external data from the controller + * that should be used in drawing the view */ public abstract function render($data); } diff --git a/views/elements/footer_element.php b/views/elements/footer_element.php index ee1c690ee..b0ff21c65 100755 --- a/views/elements/footer_element.php +++ b/views/elements/footer_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -42,10 +42,10 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class FooterElement extends Element { /** - * Element used to render the login screen for the admin control panel + * Element used to render the login screen for the admin control panel * - * @param array $data many data from the controller for the footer - * (so far none) + * @param array $data many data from the controller for the footer + * (so far none) */ function render($data) { diff --git a/views/elements/groupfeed_element.php b/views/elements/groupfeed_element.php index 27338f56a..087ecc19e 100644 --- a/views/elements/groupfeed_element.php +++ b/views/elements/groupfeed_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -43,11 +43,11 @@ require_once BASE_DIR."/lib/crawl_constants.php"; class GroupfeedElement extends Element implements CrawlConstants { /** - * Draws the Feeds for the Various Groups a User is a associated with. + * Draws the Feeds for the Various Groups a User is a associated with. * - * @param array $data feed items should be prepared by the controller - * and stored in the $data['PAGES'] variable. - * makes use of the CSRF token for anti CSRF attacks + * @param array $data feed items should be prepared by the controller + * and stored in the $data['PAGES'] variable. + * makes use of the CSRF token for anti CSRF attacks */ function render($data) { @@ -269,10 +269,10 @@ class GroupfeedElement extends Element implements CrawlConstants } } /** - * Used to render the Javascript that appears at the non-status updating - * portion of the footer of this element. + * Used to render the Javascript that appears at the non-status updating + * portion of the footer of this element. * - * @param array $data contains arguments needs to draw urls correctly. + * @param array $data contains arguments needs to draw urls correctly. */ function renderScripts($data) { diff --git a/views/elements/language_element.php b/views/elements/language_element.php index 0e0b5ae17..2e881112d 100755 --- a/views/elements/language_element.php +++ b/views/elements/language_element.php @@ -45,8 +45,8 @@ class LanguageElement extends Element * Draws a selects tag with a list of available languages * * @param array $data this variables LANGUAGES elt contains pairs of - * IANA tag and language names; its LOCALE_TAG is the current - * IANA locale tag + * IANA tag and language names; its LOCALE_TAG is the current + * IANA locale tag */ function render($data) { diff --git a/views/elements/machinelog_element.php b/views/elements/machinelog_element.php index 55593f455..fba83e206 100644 --- a/views/elements/machinelog_element.php +++ b/views/elements/machinelog_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/elements/manageaccount_element.php b/views/elements/manageaccount_element.php index 8e020e718..292be0f31 100755 --- a/views/elements/manageaccount_element.php +++ b/views/elements/manageaccount_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,8 +32,8 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Element responsible for displaying the user account features - * that someone can modify for their own SeekQuarry/Yioop account. + * Element responsible for displaying the user account features + * that someone can modify for their own SeekQuarry/Yioop account. * * @author Chris Pollett * @package seek_quarry @@ -42,11 +42,11 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class ManageaccountElement extends Element { /** - * Draws a view with a summary of a user's account together with - * a form for updating user info such as password as well as with - * useful links for groups, etc + * Draws a view with a summary of a user's account together with + * a form for updating user info such as password as well as with + * useful links for groups, etc * - * @param array $data anti-CSRF token + * @param array $data anti-CSRF token */ function render($data) { diff --git a/views/elements/manageclassifiers_element.php b/views/elements/manageclassifiers_element.php index a2553c78a..a8c0fee1c 100644 --- a/views/elements/manageclassifiers_element.php +++ b/views/elements/manageclassifiers_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -46,7 +46,7 @@ class ManageclassifiersElement extends Element * Draws the "new classifier" form and table of existing classifiesr * * @param array $data used to pass the list of existing classifier - * instances + * instances */ function render($data) { @@ -147,10 +147,10 @@ class ManageclassifiersElement extends Element } } /** - * Used to draw the form to create a new classifier + * Used to draw the form to create a new classifier * - * @param array $data data for the view in this case we just make - * use of the CSRF_TOKEN + * @param array $data data for the view in this case we just make + * use of the CSRF_TOKEN */ function renderClassifierForm($data) { @@ -174,9 +174,9 @@ class ManageclassifiersElement extends Element <?php } /** - * Used to draw the form to search and filter through existing classifiers + * Used to draw the form to search and filter through existing classifiers * - * @param array $data data for the view + * @param array $data data for the view */ function renderSearchForm($data) { diff --git a/views/elements/managecrawls_element.php b/views/elements/managecrawls_element.php index a34ee4a30..c6f88f70a 100755 --- a/views/elements/managecrawls_element.php +++ b/views/elements/managecrawls_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/elements/managegroups_element.php b/views/elements/managegroups_element.php index d6e45b342..fd71ba2fa 100755 --- a/views/elements/managegroups_element.php +++ b/views/elements/managegroups_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Mallika Perepa (Creator), Chris Pollett (rewrote) * @package seek_quarry @@ -46,7 +46,7 @@ class ManagegroupsElement extends Element * deleted * * @param array $data contains antiCSRF token, as well as data on - * available groups or which user is in what group + * available groups or which user is in what group */ function render($data) { @@ -262,10 +262,10 @@ class ManagegroupsElement extends Element <?php } /** - * Draws the add groups and edit groups forms + * Draws the add groups and edit groups forms * - * @param array $data consists of values of groups fields set - * so far as well as values of the drops downs on the form + * @param array $data consists of values of groups fields set + * so far as well as values of the drops downs on the form */ function renderGroupsForm($data) { @@ -475,10 +475,10 @@ class ManagegroupsElement extends Element <?php } /** - * Draws form used to invite users to the current group - * @param array $data from the admin controller with a - * 'CURRENT_GROUP' field providing information about the - * current group as well as info about the current CSRF_TOKEN + * Draws form used to invite users to the current group + * @param array $data from the admin controller with a + * 'CURRENT_GROUP' field providing information about the + * current group as well as info about the current CSRF_TOKEN */ function renderInviteUsersForm($data) { @@ -522,10 +522,10 @@ class ManagegroupsElement extends Element <?php } /** - * Draws the form used to change the owner of a group - * @param array $data from the admin controller with a - * 'CURRENT_GROUP' field providing information about the - * current group as well as info about the current CSRF_TOKEN + * Draws the form used to change the owner of a group + * @param array $data from the admin controller with a + * 'CURRENT_GROUP' field providing information about the + * current group as well as info about the current CSRF_TOKEN */ function renderChangeOwnerForm($data) { @@ -569,10 +569,10 @@ class ManagegroupsElement extends Element <?php } /** - * Draws the search for groups forms + * Draws the search for groups forms * - * @param array $data consists of values of role fields set - * so far as well as values of the drops downs on the form + * @param array $data consists of values of role fields set + * so far as well as values of the drops downs on the form */ function renderSearchForm($data) { diff --git a/views/elements/managelocales_element.php b/views/elements/managelocales_element.php index 2d1e28bf5..1981c3b5d 100644 --- a/views/elements/managelocales_element.php +++ b/views/elements/managelocales_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -48,7 +48,7 @@ class ManagelocalesElement extends Element * locales as well ass the screen for adding modifying translations * * @param array $data contains info about the available locales and what - * has been translated + * has been translated */ function render($data) { @@ -108,10 +108,10 @@ class ManagelocalesElement extends Element <?php } /** - * Draws the add locale and edit locale forms + * Draws the add locale and edit locale forms * - * @param array $data consists of values of locale fields set - * so far as well as values of the drops downs on the form + * @param array $data consists of values of locale fields set + * so far as well as values of the drops downs on the form */ function renderLocaleForm($data) { @@ -176,10 +176,10 @@ class ManagelocalesElement extends Element <?php } /** - * Draws the search for locales forms + * Draws the search for locales forms * - * @param array $data consists of values of locale fields set - * so far as well as values of the drops downs on the form + * @param array $data consists of values of locale fields set + * so far as well as values of the drops downs on the form */ function renderSearchForm($data) { diff --git a/views/elements/managemachines_element.php b/views/elements/managemachines_element.php index 643fa28ac..02cf6ee09 100644 --- a/views/elements/managemachines_element.php +++ b/views/elements/managemachines_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/elements/manageroles_element.php b/views/elements/manageroles_element.php index dc17c208c..e785c3277 100644 --- a/views/elements/manageroles_element.php +++ b/views/elements/manageroles_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -46,7 +46,7 @@ class ManagerolesElement extends Element * can be added to and deleted from a selected roles * * @param array $data contains antiCSRF token, as well as data on - * available roles or which activity has what role + * available roles or which activity has what role */ function render($data) { ?> @@ -116,10 +116,10 @@ class ManagerolesElement extends Element <?php } /** - * Draws the add role and edit role forms + * Draws the add role and edit role forms * - * @param array $data consists of values of role fields set - * so far as well as values of the drops downs on the form + * @param array $data consists of values of role fields set + * so far as well as values of the drops downs on the form */ function renderRoleForm($data) { @@ -200,10 +200,10 @@ class ManagerolesElement extends Element <?php } /** - * Draws the search for roles forms + * Draws the search for roles forms * - * @param array $data consists of values of role fields set - * so far as well as values of the drops downs on the form + * @param array $data consists of values of role fields set + * so far as well as values of the drops downs on the form */ function renderSearchForm($data) { diff --git a/views/elements/manageusers_element.php b/views/elements/manageusers_element.php index fdcbf2b74..ee26cde89 100644 --- a/views/elements/manageusers_element.php +++ b/views/elements/manageusers_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,8 +32,8 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Element responsible for drawing the activity screen for User manipulation - * in the AdminView. + * Element responsible for drawing the activity screen for User manipulation + * in the AdminView. * * @author Chris Pollett * @package seek_quarry @@ -169,10 +169,10 @@ class ManageusersElement extends Element <?php } /** - * Draws the add user and edit user forms + * Draws the add user and edit user forms * - * @param array $data consists of values of user fields set - * so far as well as values of the drops downs on the form + * @param array $data consists of values of user fields set + * so far as well as values of the drops downs on the form */ function renderUserForm($data) { @@ -466,10 +466,10 @@ class ManageusersElement extends Element <?php } /** - * Draws the search for users forms + * Draws the search for users forms * - * @param array $data consists of values of user fields set - * so far as well as values of the drops downs on the form + * @param array $data consists of values of user fields set + * so far as well as values of the drops downs on the form */ function renderSearchForm($data) { diff --git a/views/elements/mixcrawls_element.php b/views/elements/mixcrawls_element.php index 5dec1a1f0..db6ccceb3 100644 --- a/views/elements/mixcrawls_element.php +++ b/views/elements/mixcrawls_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -183,9 +183,9 @@ class MixcrawlsElement extends Element <?php } /** - * Draws the create mix form + * Draws the create mix form * - * @param array $data used for CSRF_TOKEN + * @param array $data used for CSRF_TOKEN */ function renderMixForm($data) { @@ -208,10 +208,10 @@ class MixcrawlsElement extends Element <?php } /** - * Draws the search for mixes forms + * Draws the search for mixes forms * - * @param array $data consists of values of mix fields set - * so far as well as values of the drops downs on the form + * @param array $data consists of values of mix fields set + * so far as well as values of the drops downs on the form */ function renderSearchForm($data) { diff --git a/views/elements/moreoptions_element.php b/views/elements/moreoptions_element.php index c0790ccda..cd6b63d07 100644 --- a/views/elements/moreoptions_element.php +++ b/views/elements/moreoptions_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -42,10 +42,10 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class MoreoptionsElement extends Element { /** - * Method responsible for drawing the page with more - * search option, account, and tool info + * Method responsible for drawing the page with more + * search option, account, and tool info * - * @param array $data to draw links on page + * @param array $data to draw links on page */ function render($data) { diff --git a/views/elements/pageoptions_element.php b/views/elements/pageoptions_element.php index 7ad744956..5a9be5df3 100644 --- a/views/elements/pageoptions_element.php +++ b/views/elements/pageoptions_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -46,7 +46,7 @@ class PageOptionsElement extends Element * Draws the page options element to the output buffer * * @param array $data used to keep track of page range, recrawl frequency, - * and file types of the page + * and file types of the page */ function render($data) { diff --git a/views/elements/resultseditor_element.php b/views/elements/resultseditor_element.php index 0684b6540..69bfc5c12 100644 --- a/views/elements/resultseditor_element.php +++ b/views/elements/resultseditor_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/elements/searchsources_element.php b/views/elements/searchsources_element.php index 81538c2b3..c39ab2b69 100644 --- a/views/elements/searchsources_element.php +++ b/views/elements/searchsources_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/elements/security_element.php b/views/elements/security_element.php index a011b7cec..a573a4428 100755 --- a/views/elements/security_element.php +++ b/views/elements/security_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Sreenidhi Muralidharan * @package seek_quarry @@ -46,7 +46,7 @@ class SecurityElement extends Element * graphical captcha * * @param array $data holds data on the profile elements which have been - * filled in as well as data about which form fields to display + * filled in as well as data about which form fields to display */ function render($data) { diff --git a/views/elements/serversettings_element.php b/views/elements/serversettings_element.php index 438db230d..70d9c1f3a 100644 --- a/views/elements/serversettings_element.php +++ b/views/elements/serversettings_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -42,11 +42,11 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class ServersettingsElement extends Element { /** - * Method that draw forms to set up the various external servers + * Method that draw forms to set up the various external servers * that might be connected with a Yioop installation * * @param array $data holds data on the profile elements which have been - * filled in as well as data about which form fields to display + * filled in as well as data about which form fields to display */ function render($data) { diff --git a/views/elements/signin_element.php b/views/elements/signin_element.php index 7e86ae8f1..2345d32ff 100755 --- a/views/elements/signin_element.php +++ b/views/elements/signin_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -41,9 +41,9 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class SigninElement extends Element { /** - * Method responsible for drawing links to settings and login panels + * Method responsible for drawing links to settings and login panels * - * @param array $data makes use of the CSRF_TOKEN for anti CSRF attacks + * @param array $data makes use of the CSRF_TOKEN for anti CSRF attacks */ function render($data) { diff --git a/views/elements/subsearch_element.php b/views/elements/subsearch_element.php index fd69dcb2c..93c611bac 100644 --- a/views/elements/subsearch_element.php +++ b/views/elements/subsearch_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -41,9 +41,9 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class SubsearchElement extends Element { /** - * Method responsible for drawing links to common subsearches + * Method responsible for drawing links to common subsearches * - * @param array $data makes use of the CSRF token for anti CSRF attacks + * @param array $data makes use of the CSRF token for anti CSRF attacks */ function render($data) { diff --git a/views/elements/wiki_element.php b/views/elements/wiki_element.php index 0994e6eb0..bdc302ee8 100644 --- a/views/elements/wiki_element.php +++ b/views/elements/wiki_element.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -45,12 +45,12 @@ require_once BASE_DIR."/lib/crawl_constants.php"; class WikiElement extends Element implements CrawlConstants { /** - * Draw a wiki page for group, or, depending on $data['MODE'] a listing - * of all pages for a group, or the history of revisions of a given page - * or the edit page form + * Draw a wiki page for group, or, depending on $data['MODE'] a listing + * of all pages for a group, or the history of revisions of a given page + * or the edit page form * * @param array $data fields contain data about the page being - * displayeed or edited, or the list of pages being displayed. + * displayeed or edited, or the list of pages being displayed. */ function render($data) { @@ -154,7 +154,7 @@ class WikiElement extends Element implements CrawlConstants * * @param array $data fields PAGE used for page contents * @param bool $can_edit whether the current user has permissions to - * edit or create this page + * edit or create this page * @param bool $logged_in whethe current user is logged in or not */ function renderReadPage($data, $can_edit, $logged_in) @@ -200,7 +200,7 @@ class WikiElement extends Element implements CrawlConstants * Used to drawn the form that let's someone edit a wiki page * * @param array $data fields contain data about the page being - * edited. In particular, PAGE contains the raw page data + * edited. In particular, PAGE contains the raw page data */ function renderEditPageForm($data) { @@ -268,9 +268,9 @@ class WikiElement extends Element implements CrawlConstants * draws a search form and can be used to create pages * * @param array $data fields for the current controller, CSRF_TOKEN - * ect needed to render the search for and paging queries + * ect needed to render the search for and paging queries * @param bool $can_edit whether the current user has permissions to - * edit or create this page + * edit or create this page * @param bool $logged_in whethe current user is logged in or not */ function renderPages($data, $can_edit, $logged_in) diff --git a/views/feedstatus_view.php b/views/feedstatus_view.php index 4d43975ff..b6ac03d58 100644 --- a/views/feedstatus_view.php +++ b/views/feedstatus_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry diff --git a/views/fetch_view.php b/views/fetch_view.php index 016800db3..cfd8e3d89 100755 --- a/views/fetch_view.php +++ b/views/fetch_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -43,14 +43,14 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class FetchView extends View { /** No layout is used for this view - * @var string + * @var string */ var $layout = ""; /** - * Draws message to be used by a fetcher. It might for example - * contains a schedule of sites to crawl + * Draws message to be used by a fetcher. It might for example + * contains a schedule of sites to crawl * - * @param array $data message sent by fetch_controller.php + * @param array $data message sent by fetch_controller.php */ function renderView($data) { diff --git a/views/group_view.php b/views/group_view.php index 6dd1c29a2..60d0f38c4 100644 --- a/views/group_view.php +++ b/views/group_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -43,7 +43,7 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class GroupView extends View implements CrawlConstants { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** diff --git a/views/helpers/displayresults_helper.php b/views/helpers/displayresults_helper.php index 8e310b03c..38718aff6 100644 --- a/views/helpers/displayresults_helper.php +++ b/views/helpers/displayresults_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Priya Gangaraju priya.gangaraju@gmail.com * @package seek_quarry @@ -32,12 +32,12 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** * This is a helper class used to handle - * displaying description. If it has recipe data + * displaying a web page summary. If the summary has recipe data * each ingredient is displayed in seperate line. * otherwise display the data. * @@ -47,9 +47,16 @@ require_once BASE_DIR."/views/helpers/helper.php"; */ class DisplayresultsHelper extends Helper { - function render($data) + /** + * Used to draw a web page summary/snippets in a search engine result. + * If the summary has recipe data each ingredient is displayed in + * seperate line. + * + * @param string $summary summary/snippet to draw + */ + function render($summary) { - $recipe_parts = explode("||", $data); + $recipe_parts = explode("||", $summary); $count = count($recipe_parts); if($count > 1){ foreach($recipe_parts as $value){ @@ -59,7 +66,7 @@ class DisplayresultsHelper extends Helper } } else { - echo $data; + echo $summary; } } } diff --git a/views/helpers/feeds_helper.php b/views/helpers/feeds_helper.php index ee81e6c79..6da7aaadf 100644 --- a/views/helpers/feeds_helper.php +++ b/views/helpers/feeds_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** @@ -46,16 +46,16 @@ class FeedsHelper extends Helper implements CrawlConstants { /** - * Takes page summaries for RSS pages and the current query - * and draws list of news links and a link to the news link subsearch - * page if applicable. + * Takes page summaries for RSS pages and the current query + * and draws list of news links and a link to the news link subsearch + * page if applicable. * - * @param array $feed_pages page data from news feeds - * @param string $base_query the query_string prefix - * @param string $query the current search query - * @param string $subsearch name of subsearch page this image group on - * @param boolean $open_in_tabs whether new links should be opened in - * tabs + * @param array $feed_pages page data from news feeds + * @param string $base_query the query_string prefix + * @param string $query the current search query + * @param string $subsearch name of subsearch page this image group on + * @param boolean $open_in_tabs whether new links should be opened in + * tabs */ function render($feed_pages, $base_query, $query, $subsearch, $open_in_tabs = false) @@ -138,12 +138,12 @@ class FeedsHelper extends Helper implements CrawlConstants <?php } /** - * Write as an string in the current locale the difference between the - * publication date of a post and the current time + * Write as an string in the current locale the difference between the + * publication date of a post and the current time * - * @param int $time timestamp for current time - * @param int $pub_date timestamp for feed_item publication - * @return string in the current locale the time difference + * @param int $time timestamp for current time + * @param int $pub_date timestamp for feed_item publication + * @return string in the current locale the time difference */ function getPubdateString($time, $pub_date) { diff --git a/views/helpers/filetype_helper.php b/views/helpers/filetype_helper.php index 2a7a0b3c1..f4158955a 100644 --- a/views/helpers/filetype_helper.php +++ b/views/helpers/filetype_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** @@ -54,11 +54,11 @@ require_once BASE_DIR."/views/helpers/helper.php"; class FiletypeHelper extends Helper { /** - * Outputs the filetype corresponding to the supplied - * mime type. + * Outputs the filetype corresponding to the supplied + * mime type. * - * @param string $mime_type the mime type that should - * be output as a file extention + * @param string $mime_type the mime type that should + * be output as a file extention */ function render($mime_type) { diff --git a/views/helpers/helper.php b/views/helpers/helper.php index 91553d768..4e168d2b3 100755 --- a/views/helpers/helper.php +++ b/views/helpers/helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -44,7 +44,7 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class Helper { /** - * The constructor at this point does nothing + * The constructor at this point does nothing */ function __construct() { diff --git a/views/helpers/images_helper.php b/views/helpers/images_helper.php index c9b280a80..3b31c5094 100644 --- a/views/helpers/images_helper.php +++ b/views/helpers/images_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** @@ -45,13 +45,13 @@ require_once BASE_DIR."/views/helpers/helper.php"; class ImagesHelper extends Helper implements CrawlConstants { /** - * Takes page summaries for image pages and the current query - * and draw a thumbnail strip so that clicking on an image goes to - * the cache of that image. + * Takes page summaries for image pages and the current query + * and draw a thumbnail strip so that clicking on an image goes to + * the cache of that image. * - * @param array $image_pages page data and thumbnails for images - * @param string $query the current search query - * @param string $subsearch name of subsearch page this image group on + * @param array $image_pages page data and thumbnails for images + * @param string $query the current search query + * @param string $subsearch name of subsearch page this image group on */ function render($image_pages, $query, $subsearch) { diff --git a/views/helpers/options_helper.php b/views/helpers/options_helper.php index 726138d07..35bad2bef 100755 --- a/views/helpers/options_helper.php +++ b/views/helpers/options_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** @@ -47,17 +47,17 @@ class OptionsHelper extends Helper { /** - * Draws an HTML select tag according to the supplied parameters + * Draws an HTML select tag according to the supplied parameters * - * @param string $id the id attribute the select tag should have - * @param string $name the name this form element should use - * @param array $options an array of key value pairs for the options - * tags of this select element - * @param string $selected which option (note singular -- no support - * for selecting more than one) should be set as selected - * in the select tag - * @param bool $onchange_submit whether to submit the parent form if - * this drop down is changed + * @param string $id the id attribute the select tag should have + * @param string $name the name this form element should use + * @param array $options an array of key value pairs for the options + * tags of this select element + * @param string $selected which option (note singular -- no support + * for selecting more than one) should be set as selected + * in the select tag + * @param bool $onchange_submit whether to submit the parent form if + * this drop down is changed */ function render($id, $name, $options, $selected, $onchange_submit = false) { diff --git a/views/helpers/pagination_helper.php b/views/helpers/pagination_helper.php index 6aebaa67d..41fea9e9b 100755 --- a/views/helpers/pagination_helper.php +++ b/views/helpers/pagination_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** @@ -48,7 +48,7 @@ class PaginationHelper extends Helper /** * The maximum numbered links to pages to show besides the next and * previous links - * @var int + * @var int */ const MAX_PAGES_TO_SHOW = 10; @@ -59,13 +59,13 @@ class PaginationHelper extends Helper * by a next set of pages link. * * @param string $base_url the url together with base query that the - * search was done on + * search was done on * @param int $limit the number of the first link to display in the - * set of search results. + * set of search results. * @param int $results_per_page how many links are displayed on a given - * page of search results + * page of search results * @param int $total_results the total number of search results for the - * current search term + * current search term */ function render($base_url, $limit, $results_per_page, $total_results) { diff --git a/views/helpers/pagingtable_helper.php b/views/helpers/pagingtable_helper.php index 1e5fb95c1..e5d7225cb 100644 --- a/views/helpers/pagingtable_helper.php +++ b/views/helpers/pagingtable_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** @@ -50,16 +50,20 @@ require_once BASE_DIR."/views/helpers/helper.php"; class PagingtableHelper extends Helper { /** - * The choices for how many rows out of the database table to display - * @var array + * The choices for how many rows out of the database table to display + * @var array */ var $show_choices = array( 10 => 10, 20 => 20, 50 => 50, 100 => 100, 200=> 200 ); /** - * Used to render the links to go - * backwards and forwards through a databse table. We have two separate - * functions for the mobile and desktop drawers. + * Used to render the links to go + * backwards and forwards through a databse table. We have two separate + * functions for the mobile and desktop drawers. + * + * @param array $data fields of this contain values from teh controller + * for the CSRF_TOKEN; NUM_TOTAL of rows; NUM_SHOW, the number to show; + * etc. */ function render($data) { @@ -73,11 +77,11 @@ class PagingtableHelper extends Helper } } /** - * Draws the heading before a paging table as well as the controls - * for what rows to see (mobile phone case). + * Draws the heading before a paging table as well as the controls + * for what rows to see (mobile phone case). * - * @param array $data needed for dropdown values for number of groups to - * display + * @param array $data needed for dropdown values for number of groups to + * display */ function mobileTableControls($data) { @@ -151,11 +155,11 @@ class PagingtableHelper extends Helper <?php } /** - * Draws the heading before the user table as well as the controls - * for what user to see (desktop, laptop, tablet case). + * Draws the heading before the user table as well as the controls + * for what user to see (desktop, laptop, tablet case). * - * @param array $data needed for dropdown values for number of groups to - * display + * @param array $data needed for dropdown values for number of groups to + * display */ function desktopTableControls($data) { diff --git a/views/helpers/searchform_helper.php b/views/helpers/searchform_helper.php index 139250a46..640190c4d 100644 --- a/views/helpers/searchform_helper.php +++ b/views/helpers/searchform_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** @@ -46,22 +46,22 @@ require_once BASE_DIR."/views/helpers/helper.php"; class SearchformHelper extends Helper { /** - * Draw the form for advanced search for any HTML table drawn based on - * using a model's getRow function + * Draw the form for advanced search for any HTML table drawn based on + * using a model's getRow function * - * @param array $data from the controller with info of what fields might - * already be filled. - * @param object $controller what controller is being used to handle logic - * @param string $activity what activity the controller was executing - * (for return link) - * @param object $view which view is responsible for calling this helper - * @param string $title what to display as the header of this form - * @param string $return_form_name string to use for return link to previous - * page - * @param array $fields a list of searchable fields - * @param array $dropdowns which fields should be rendered as dropdowns - * @param string $postfix string to tack on to form variables (might use - * to make var names unique on page) + * @param array $data from the controller with info of what fields might + * already be filled. + * @param object $controller what controller is being used to handle logic + * @param string $activity what activity the controller was executing + * (for return link) + * @param object $view which view is responsible for calling this helper + * @param string $title what to display as the header of this form + * @param string $return_form_name string to use for return link to previous + * page + * @param array $fields a list of searchable fields + * @param array $dropdowns which fields should be rendered as dropdowns + * @param string $postfix string to tack on to form variables (might use + * to make var names unique on page) */ function render($data, $controller, $activity, $view, $title, $return_form_name, $fields, $dropdowns = array(), $postfix = "") diff --git a/views/helpers/toggle_helper.php b/views/helpers/toggle_helper.php index e6d6c29e2..f4a298239 100644 --- a/views/helpers/toggle_helper.php +++ b/views/helpers/toggle_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** @@ -46,12 +46,15 @@ require_once BASE_DIR."/views/helpers/helper.php"; class ToggleHelper extends Helper { /** - * Draws an On Off switch in HTML where to toggle state one - * clicks a link + * Draws an On Off switch in HTML where to toggle state one + * clicks a link * - * @param bool $state whether the switch is on or off - * @param string $on_url - url that is sent when one clicks on - * @param string $off_url - url that is sent when one clicks off + * @param bool $state whether the switch is on or off + * @param string $on_url url that is sent when one clicks on + * @param string $off_url url that is sent when one clicks off + * @param bool $caution is set to true if on in the database but the + * status received from testing the state of the toggle some other + * way is off (causes things to draw in yellow rather than green) */ function render($state, $on_url, $off_url, $caution = false) { diff --git a/views/helpers/videourl_helper.php b/views/helpers/videourl_helper.php index 27fb8f9a7..bda8c82eb 100644 --- a/views/helpers/videourl_helper.php +++ b/views/helpers/videourl_helper.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -32,7 +32,7 @@ */ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} /** - * Load base helper class if needed + * Load base helper class if needed */ require_once BASE_DIR."/views/helpers/helper.php"; /** @@ -45,12 +45,12 @@ require_once BASE_DIR."/views/helpers/helper.php"; class VideourlHelper extends Helper { /** - * Used to check if a url is the url of a video site and if so - * draw a link with a thumbnail from the video. - * @param string $url to check if of a video site - * @param array $video_sources video sites url info to check $url against - * @param boolean $open_in_tabs whether new links should be opened in - * tabs + * Used to check if a url is the url of a video site and if so + * draw a link with a thumbnail from the video. + * @param string $url to check if of a video site + * @param array $video_sources video sites url info to check $url against + * @param boolean $open_in_tabs whether new links should be opened in + * tabs */ function render($url, $video_sources, $open_in_tabs = false) { diff --git a/views/layouts/layout.php b/views/layouts/layout.php index 96f4e4f04..0857f0089 100755 --- a/views/layouts/layout.php +++ b/views/layouts/layout.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -51,6 +51,7 @@ class Layout * The constructor sets the view that will be drawn inside the * Layout. * + * @param object $v the View object that uses this layout */ function __construct($v) { diff --git a/views/layouts/rss_layout.php b/views/layouts/rss_layout.php index 56ff21f9a..4d433c722 100644 --- a/views/layouts/rss_layout.php +++ b/views/layouts/rss_layout.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -50,8 +50,8 @@ class RssLayout extends Layout * is set, it output statistics about each query run on the database. * Finally, it draws the footer of the document. * - * @param array $data an array of data set up by the controller to be - * be used in drawing the WebLayout and its View. + * @param array $data an array of data set up by the controller to be + * be used in drawing the WebLayout and its View. */ function render($data) { diff --git a/views/layouts/web_layout.php b/views/layouts/web_layout.php index 50263f125..bd0a7f657 100755 --- a/views/layouts/web_layout.php +++ b/views/layouts/web_layout.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -49,8 +49,8 @@ class WebLayout extends Layout * is set, it output statistics about each query run on the database. * Finally, it draws the footer of the document. * - * @param array $data an array of data set up by the controller to be - * be used in drawing the WebLayout and its View. + * @param array $data an array of data set up by the controller to be + * be used in drawing the WebLayout and its View. */ function render($data) { diff --git a/views/machinestatus_view.php b/views/machinestatus_view.php index 3bff2d625..014f9de44 100644 --- a/views/machinestatus_view.php +++ b/views/machinestatus_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -46,7 +46,7 @@ class MachinestatusView extends View * Draws the ManagestatusView to the output buffer * * @param array $data contains on/off status info for each of the machines - * managed by this Yioop instance. + * managed by this Yioop instance. */ function renderView($data) { diff --git a/views/nocache_view.php b/views/nocache_view.php index dd5303329..8b88c7255 100755 --- a/views/nocache_view.php +++ b/views/nocache_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -43,15 +43,15 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class NocacheView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** - * Draws a simple message saying no cache available of - * the requested page + * Draws a simple message saying no cache available of + * the requested page * - * @param array $data at this point this view does not make - * use of the $data info passed to it. + * @param array $data at this point this view does not make + * use of the $data info passed to it. */ function renderView($data) { ?> diff --git a/views/recover_view.php b/views/recover_view.php index 8d0edb9a8..e15c1339f 100644 --- a/views/recover_view.php +++ b/views/recover_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry @@ -42,15 +42,15 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class RecoverView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** - * Draws the recover password web page and the page one get after - * following the recover password email + * Draws the recover password web page and the page one get after + * following the recover password email * - * @param array $data contains the anti CSRF token - * the view, data for captcha and recover dropdowns + * @param array $data contains the anti CSRF token + * the view, data for captcha and recover dropdowns */ function renderView($data) { diff --git a/views/register_view.php b/views/register_view.php index 41cf0d893..75edf48c1 100755 --- a/views/register_view.php +++ b/views/register_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry @@ -41,7 +41,7 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class RegisterView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** @@ -66,11 +66,11 @@ class RegisterView extends View */ var $recovery_qa; /** - * Besides setting calling the constructor for the base class this - * constructor also sets up the captchas_qa and recovery_qa arrays - * so they can be localized. The reason for putting these arrays in a - * view is so that multiple controllers/components can see and manipulate - * them + * Besides setting calling the constructor for the base class this + * constructor also sets up the captchas_qa and recovery_qa arrays + * so they can be localized. The reason for putting these arrays in a + * view is so that multiple controllers/components can see and manipulate + * them */ function __construct() { @@ -129,10 +129,10 @@ class RegisterView extends View parent::__construct(); } /** - * Draws the create account web page. + * Draws the create account web page. * - * @param array $data contains the anti CSRF token - * the view, data for captcha and recover dropdowns + * @param array $data contains the anti CSRF token + * the view, data for captcha and recover dropdowns */ function renderView($data) { diff --git a/views/rss_view.php b/views/rss_view.php index afce61a25..ae6670873 100644 --- a/views/rss_view.php +++ b/views/rss_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -45,16 +45,16 @@ require_once BASE_DIR."/lib/crawl_constants.php"; class RssView extends View implements CrawlConstants { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "rss"; /** - * Draws the main landing pages as well as search result pages + * Draws the main landing pages as well as search result pages * - * @param array $data PAGES contains all the summaries of web pages - * returned by the current query, $data also contains information - * about how the the query took to process and the total number - * of results, how to fetch the next results, etc. + * @param array $data PAGES contains all the summaries of web pages + * returned by the current query, $data also contains information + * about how the the query took to process and the total number + * of results, how to fetch the next results, etc. * */ function renderView($data) diff --git a/views/search_view.php b/views/search_view.php index 78190993e..8c44f285b 100755 --- a/views/search_view.php +++ b/views/search_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -45,7 +45,7 @@ require_once BASE_DIR."/lib/crawl_constants.php"; class SearchView extends View implements CrawlConstants { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** @@ -53,12 +53,12 @@ class SearchView extends View implements CrawlConstants */ const GIT_EXTENSION = ".git"; /** - * Draws the main landing pages as well as search result pages + * Draws the main landing pages as well as search result pages * - * @param array $data PAGES contains all the summaries of web pages - * returned by the current query, $data also contains information - * about how the the query took to process and the total number - * of results, how to fetch the next results, etc. + * @param array $data PAGES contains all the summaries of web pages + * returned by the current query, $data also contains information + * about how the the query took to process and the total number + * of results, how to fetch the next results, etc. * */ function renderView($data) @@ -166,10 +166,10 @@ class SearchView extends View implements CrawlConstants } } /** - * Used to draw the results of a query to the Yioop Search Engine + * Used to draw the results of a query to the Yioop Search Engine * - * @param array $data an associative array containing a PAGES field needed - * to render search result + * @param array $data an associative array containing a PAGES field needed + * to render search result */ function renderSearchResults($data) { ?> diff --git a/views/settings_view.php b/views/settings_view.php index c8ec1198f..c20c7971e 100755 --- a/views/settings_view.php +++ b/views/settings_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -44,14 +44,14 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class SettingsView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** * sDraws the web page on which users can control their search settings. * * @param array $data contains anti CSRF token as well - * the language info and the current and possible per page settings + * the language info and the current and possible per page settings */ function renderView($data) { $logo = "resources/yioop.png"; diff --git a/views/signin_view.php b/views/signin_view.php index b37b15e7c..d99a6dc19 100755 --- a/views/signin_view.php +++ b/views/signin_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -42,14 +42,14 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class SigninView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** - * Draws the login web page. + * Draws the login web page. * - * @param array $data contains the anti CSRF token - * the view + * @param array $data contains the anti CSRF token + * the view */ function renderView($data) { diff --git a/views/static_view.php b/views/static_view.php index 71604aa8a..52beea01e 100644 --- a/views/static_view.php +++ b/views/static_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -42,14 +42,14 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class StaticView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** - * Draws wiki page in a more static fashion. + * Draws wiki page in a more static fashion. * - * @param array $data contains the static page contents - * the view + * @param array $data contains the static page contents + * the view */ function renderView($data) { diff --git a/views/statistics_view.php b/views/statistics_view.php index 640e53c69..2eee45b22 100644 --- a/views/statistics_view.php +++ b/views/statistics_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -43,14 +43,14 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class StatisticsView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** * Draws the web page used to display statistics about the default crawl * * @param array $data contains anti CSRF token as well - * statistics info about a web crawl + * statistics info about a web crawl */ function renderView($data) { $logo = "resources/yioop.png"; diff --git a/views/suggest_view.php b/views/suggest_view.php index bf720ec68..b696bef72 100644 --- a/views/suggest_view.php +++ b/views/suggest_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett * @package seek_quarry @@ -41,14 +41,14 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class SuggestView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; /** - * Draws the form where a user can suggest a url + * Draws the form where a user can suggest a url * - * @param array $data contains the anti CSRF token - * the view, data for captcha and recover dropdowns + * @param array $data contains the anti CSRF token + * the view, data for captcha and recover dropdowns */ function renderView($data) { diff --git a/views/view.php b/views/view.php index 6add21bf1..75c643c77 100644 --- a/views/view.php +++ b/views/view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -51,17 +51,17 @@ require_once BASE_DIR."/views/layouts/layout.php"; abstract class View { /** The name of the type of layout object that the view is drawn on - * @var string + * @var string */ var $layout = ""; /** The reference to the layout object that the view is drawn on - * @var object + * @var object */ var $layout_object; /** - * The constructor reads in any Element and Helper subclasses which are - * needed to draw the view. It also reads in the Layout subclass on which - * the View will be drawn. + * The constructor reads in any Element and Helper subclasses which are + * needed to draw the view. It also reads in the Layout subclass on which + * the View will be drawn. * */ function __construct() @@ -104,7 +104,7 @@ abstract class View * Dynamic loader for Helper objects which might live on the current * View * - * @param $string element name of Helper to return + * @param string $helper name of Helper to return */ function helper($helper) { @@ -125,7 +125,7 @@ abstract class View * implement renderView. * * @param array $data an array of values set up by a controller to be used - * in rendering the view + * in rendering the view */ function render($data) { $this->layout_object->render($data); @@ -135,8 +135,8 @@ abstract class View * actually draws the view. The current layouts render method calls this * function. * - * @param array $data an array of values set up by a controller to be used - * in rendering the view + * @param array $data an array of values set up by a controller to be used + * in rendering the view */ abstract function renderView($data); } diff --git a/views/wiki_view.php b/views/wiki_view.php index ac0940872..73ff9f8f0 100644 --- a/views/wiki_view.php +++ b/views/wiki_view.php @@ -1,26 +1,26 @@ <?php /** - * SeekQuarry/Yioop -- - * Open Source Pure PHP Search Engine, Crawler, and Indexer + * SeekQuarry/Yioop -- + * Open Source Pure PHP Search Engine, Crawler, and Indexer * - * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org + * Copyright (C) 2009 - 2014 Chris Pollett chris@pollett.org * - * LICENSE: + * LICENSE: * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * END LICENSE + * END LICENSE * * @author Chris Pollett chris@pollett.org * @package seek_quarry @@ -43,7 +43,7 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();} class WikiView extends View { /** This view is drawn on a web layout - * @var string + * @var string */ var $layout = "web"; @@ -53,7 +53,7 @@ class WikiView extends View * * @param array $data with fields used for drawing the container and page */ - function renderView($data) + function renderView($data) { $logo = "resources/yioop.png"; $logged_in = isset($data["ADMIN"]) && $data["ADMIN"]; @@ -143,7 +143,12 @@ class WikiView extends View } } /** - * @param array $data + * Draws a HTML-parsed wiki page in the browser for reading + * + * @param array $data fields containing data about the wiki page being + * displayed. In particular, PAGE contains the raw page data + * @param bool $can_edit whether this page could be edited by the user + * @param bool $logged_in whether the viewing user is currently logged in */ function renderReadPage($data, $can_edit, $logged_in) { @@ -189,8 +194,8 @@ class WikiView extends View /** * Used to drawn the form that let's someone edit a wiki page * - * @param array $data fields contain data about the page being - * edited. In particular, PAGE contains the raw page data + * @param array $data fields containing data about the page being + * edited. In particular, PAGE contains the raw page data */ function renderEditPageForm($data) { @@ -249,7 +254,15 @@ class WikiView extends View } /** - * @param array $data + * Draw a list of wiki pages that are present in the current group + * + * @param array $data fields containing data about the group and + * page list being displayed. In particular, PAGES contains info about + * the pages in the current group, and GROUP contains info about the + * group + * @param bool $can_edit whether the user can edit wiki pages for the + * current group + * @param bool $logged_in whether the viewing user is currently logged in */ function renderPages($data, $can_edit, $logged_in) {