From 2fcefc9dced9ac279549e1b57899b44f4c90866d Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Wed, 11 Dec 2024 09:36:21 -0600 Subject: [PATCH 1/3] Move BAD_DOI_ARRAY constant to global space --- expandFns.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/expandFns.php b/expandFns.php index f8c93002ce..4d3021a202 100644 --- a/expandFns.php +++ b/expandFns.php @@ -10,15 +10,6 @@ final class HandleCache { // Greatly speed-up by having one array of each kind and only look for hash keys, not values private const MAX_CACHE_SIZE = 100000; public const MAX_HDL_SIZE = 1024; - private const BAD_DOI_ARRAY = [ - '10.1126/science' => true, - '' => true, - '10.7556/jaoa' => true, - '10.1267/science.040579197' => true, - '10.0000/Rubbish_bot_failure_test' => true, - '10.0000/Rubbish_bot_failure_test2' => true, - '10.0000/Rubbish_bot_failure_test.x' => true, - ]; /** @var array $cache_active */ public static array $cache_active = []; // DOI is in CrossRef and works @@ -29,7 +20,7 @@ final class HandleCache { /** @var array $cache_hdl_loc */ public static array $cache_hdl_loc = []; // Final HDL location URL /** @var array $cache_hdl_bad */ - public static array $cache_hdl_bad = self::BAD_DOI_ARRAY; // HDL/DOI does not resolve to anything + public static array $cache_hdl_bad = BAD_DOI_ARRAY; // HDL/DOI does not resolve to anything /** @var array $cache_hdl_null */ public static array $cache_hdl_null = []; // HDL/DOI resolves to null From c87d0ed829a3b4beebd2e45a6182259dbb246c84 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Wed, 11 Dec 2024 09:37:27 -0600 Subject: [PATCH 2/3] Update bad_data.php --- constants/bad_data.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/constants/bad_data.php b/constants/bad_data.php index 07ef630bda..5c19d1021f 100644 --- a/constants/bad_data.php +++ b/constants/bad_data.php @@ -13040,3 +13040,13 @@ '10.7759/cureus.', '10.7766/', ]; + +const BAD_DOI_ARRAY = [ + '10.1126/science' => true, + '' => true, + '10.7556/jaoa' => true, + '10.1267/science.040579197' => true, + '10.0000/Rubbish_bot_failure_test' => true, + '10.0000/Rubbish_bot_failure_test2' => true, + '10.0000/Rubbish_bot_failure_test.x' => true, +]; From 0268e2e165ba435766c48bde90ff24df3e8cb9d7 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Wed, 11 Dec 2024 09:40:09 -0600 Subject: [PATCH 3/3] Update expandFns.php --- expandFns.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expandFns.php b/expandFns.php index 4d3021a202..9f927114ef 100644 --- a/expandFns.php +++ b/expandFns.php @@ -40,7 +40,7 @@ public static function free_memory(): void { self::$cache_inactive = []; self::$cache_good = []; self::$cache_hdl_loc = []; - self::$cache_hdl_bad = self::BAD_DOI_ARRAY; + self::$cache_hdl_bad = BAD_DOI_ARRAY; self::$cache_hdl_null = []; gc_collect_cycles(); }