diff --git a/composer.lock b/composer.lock
index 45b5ef029..60ee72aa7 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "1eb516c6c8d355f642e2c09da6402afe",
+ "content-hash": "2d55182aa203336953262fd8e2d8a59b",
"packages": [],
"packages-dev": [],
"aliases": [],
@@ -13,7 +13,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": ">=7.1.0",
+ "php": ">=7.4.0",
"ext-dom": "*",
"ext-gd": "*",
"ext-json": "*",
diff --git a/src/configs/Config.php b/src/configs/Config.php
index 2a3372549..e694573a6 100755
--- a/src/configs/Config.php
+++ b/src/configs/Config.php
@@ -411,11 +411,11 @@ if (file_exists(WORK_DIRECTORY . PROFILE_FILE_NAME)) {
require_once WORK_DIRECTORY . PROFILE_FILE_NAME;
nsdefine('PROFILE', true);
nsdefine('CRAWL_DIR', WORK_DIRECTORY);
- if (is_dir(APP_DIR."/locale")) {
+ if (is_dir(APP_DIR . "/locale")) {
nsdefine('LOCALE_DIR', WORK_DIRECTORY . "/app/locale");
} else if (is_dir(WORK_DIRECTORY . "/locale")) {
//old work directory location
- nsdefine('LOCALE_DIR', WORK_DIRECTORY."/locale");
+ nsdefine('LOCALE_DIR', WORK_DIRECTORY . "/locale");
} else {
/** @ignore */
nsdefine('LOCALE_DIR', FALLBACK_LOCALE_DIR);
diff --git a/src/library/FetchUrl.php b/src/library/FetchUrl.php
index d68a492d0..a75a1f7a3 100755
--- a/src/library/FetchUrl.php
+++ b/src/library/FetchUrl.php
@@ -139,7 +139,7 @@ class FetchUrl implements CrawlConstants
}
$web_site = $GLOBALS['web_site'];
$sites[$i][0] = "INTERNAL";
- $post_info = $post_data[$i] ?? null;
+ $post_info = $post_data[$i] ?? null;
$sites[$i][$value] = $web_site->processInternalRequest(
$sites[$i][$key], !$minimal, $post_info);
continue;
@@ -895,7 +895,8 @@ class FetchUrl implements CrawlConstants
of openssl. This seems to mainly affect posting data, so for
now we use HTTP/1.1 to post.
*/
- if ($post_data == null && $scheme == "https") {
+ if ($post_data == null && $scheme == "https" &&
+ defined("CURL_HTTP_VERSION_2_0")) {
curl_setopt($agents[$host], CURLOPT_HTTP_VERSION,
CURL_HTTP_VERSION_2_0);
}
diff --git a/src/library/PhraseParser.php b/src/library/PhraseParser.php
index 05aad7f56..bfee50b18 100755
--- a/src/library/PhraseParser.php
+++ b/src/library/PhraseParser.php
@@ -379,7 +379,7 @@ class PhraseParser
!preg_match('/\-|\(|\)|\[|\]|,|\./', $current_entity)) {
$current_entity = str_replace(" ", "-", $current_entity);
}
- $string = $out_string . " " . $current_entity;
+ return $out_string . " " . $current_entity;
}
/**
* Splits string according to punctuation and white space then
diff --git a/tests/LinearHashTableTest.php b/tests/LinearHashTableTest.php
index 89323cfaf..f443b2a26 100644
--- a/tests/LinearHashTableTest.php
+++ b/tests/LinearHashTableTest.php
@@ -22,8 +22,7 @@
*
* END LICENSE
*
- * This file contains unit tests of the BTree class used to keep track of
- * etags during a crawl
+ * This file contains unit tests of the LinearHashTable class
*
* @author Chris Pollett chris@pollett.org
* @license https://www.gnu.org/licenses/ GPL3
@@ -44,18 +43,24 @@ use seekquarry\yioop\library\UnitTest;
class LinearHashTableTest extends UnitTest
{
/**
- * Test directory to hold btree used for these unit tests
+ * Prefix of folders for linear hashing test
*/
const TEST_DIR = '/test_files/linear_test';
/**
- *
+ * Sets up an array to keep track of what linear hash tables we've made
+ * so that we can delete them when done a test.
*/
public function setUp()
{
$this->table_dirs = [];
}
/**
+ * Used to create a single hash table in the folder
+ * TEST_DIR . $max_items_per_file which allows at most
+ * $max_items_per_file to be stored in a bucket
*
+ * @param int $max_items_per_file number of items allowed to be stored in a
+ * bucket
*/
public function createTable($max_items_per_file)
{
@@ -65,7 +70,7 @@ use seekquarry\yioop\library\UnitTest;
$max_items_per_file);
}
/**
- *
+ * Deletes all the Linear Hash tables in $this->table_dirs
*/
public function tearDown()
{
@@ -137,11 +142,7 @@ use seekquarry\yioop\library\UnitTest;
}
}
/**
- * Function to check that keys are successfully deleted from the B-Tree
- * Random key-value pairs are firs inserted in the B-Tree. From the inserted
- * key-value pairs, key-value pairs are randomly selected and deleted from
- * the B-Tree. The deleted key-value pairs are then looked up using their
- * keys to check if they were successfully deleted.
+ *
*/
public function deleteKeyTestCase()
{