From fe7d0a462d8cf7e7ae161dd2220ad94131b2d04e Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Sat, 3 Apr 2021 12:02:05 +0200 Subject: [PATCH] chg: [internal] Install random_compat by Composer --- .gitmodules | 4 ---- app/Lib/Tools/RandomTool.php | 10 ---------- app/Lib/random_compat | 1 - app/composer.json | 1 + 4 files changed, 1 insertion(+), 15 deletions(-) delete mode 160000 app/Lib/random_compat diff --git a/.gitmodules b/.gitmodules index 64b13d630..11d653a6c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,10 +7,6 @@ [submodule "app/files/warninglists"] path = app/files/warninglists url = https://github.com/MISP/misp-warninglists.git -[submodule "app/Lib/random_compat"] - path = app/Lib/random_compat - url = https://github.com/paragonie/random_compat - branch = master [submodule "app/files/misp-galaxy"] path = app/files/misp-galaxy url = https://github.com/MISP/misp-galaxy diff --git a/app/Lib/Tools/RandomTool.php b/app/Lib/Tools/RandomTool.php index 4d50b8a50..367ae45e3 100644 --- a/app/Lib/Tools/RandomTool.php +++ b/app/Lib/Tools/RandomTool.php @@ -2,16 +2,6 @@ class RandomTool { - public function __construct() - { - // import compatibility library for PHP < 7.0 - if (!function_exists('random_int')) { - if (file_exists(APP . 'Lib' . DS . 'random_compat' . DS . 'lib' . DS . 'random.php')) { - require_once(APP . 'Lib' . DS . 'random_compat' . DS . 'lib' . DS . 'random.php'); - } - } - } - /** * Generate a random string * diff --git a/app/Lib/random_compat b/app/Lib/random_compat deleted file mode 160000 index 088c04e2f..000000000 --- a/app/Lib/random_compat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 088c04e2f261c33bed6ca5245491cfca69195ccf diff --git a/app/composer.json b/app/composer.json index 61a55a667..edb940c69 100644 --- a/app/composer.json +++ b/app/composer.json @@ -10,6 +10,7 @@ "ext-simplexml": "*", "ext-pcre": "*", "cakephp/cakephp": "2.10.24", + "paragonie/random_compat": ">=2", "kamisama/cake-resque": "4.1.2", "pear/crypt_gpg": "1.6.3", "monolog/monolog": "1.24.0"