From 3bff3555a0373f6b82ab06db8d3c15c32b771d73 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Wed, 22 Nov 2023 12:47:14 +0100 Subject: [PATCH] Added a test due to `Failed loading libs.min.js` #358, #862, #890, #895, #1238, #1320 --- .../app/libraries/RainLoop/ServiceActions.php | 7 ++ .../app/libraries/snappymail/integrity.php | 107 ++++++++++++++++++ snappymail/v/0.0.0/setup.php | 55 ++------- 3 files changed, 122 insertions(+), 47 deletions(-) create mode 100644 snappymail/v/0.0.0/app/libraries/snappymail/integrity.php diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php index 85aaf1c95..edad11c62 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php @@ -528,6 +528,13 @@ class ServiceActions return 'Pong'; } + public function ServiceTest() : string + { + $this->oHttp->ServerNoCache(); + \SnappyMail\Integrity::test(); + return ''; + } + /** * Login with the \RainLoop\API::CreateUserSsoHash() generated hash */ diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/integrity.php b/snappymail/v/0.0.0/app/libraries/snappymail/integrity.php new file mode 100644 index 000000000..90ad4ce86 --- /dev/null +++ b/snappymail/v/0.0.0/app/libraries/snappymail/integrity.php @@ -0,0 +1,107 @@ +' . $result . '
'; + return; + } + + $result = static::phpExtensions(); + if ($result) { + echo 'The following PHP extensions are not available in your PHP configuration!
'; + echo '' . \print_r($response->headers, 1) . '
' . \print_r($response->headers, 1) . '
' . \print_r($response->headers, 1) . '
' . \print_r($response->headers, 1) . '
[301] ' . $result . '
'; exit(301); } -$aOptional = array( - 'cURL' => extension_loaded('curl'), - 'exif' => extension_loaded('exif'), - 'finfo' => class_exists('finfo'), - 'gd' => extension_loaded('gd'), - 'gnupg' => extension_loaded('gnupg'), - 'gmagick' => extension_loaded('gmagick'), - 'imagick' => extension_loaded('imagick'), - 'iconv' => function_exists('iconv'), - 'intl' => function_exists('idn_to_ascii'), - 'ldap' => extension_loaded('ldap'), - 'OpenSSL' => extension_loaded('openssl'), - 'mysql' => extension_loaded('pdo_mysql'), - 'pgsql' => extension_loaded('pdo_pgsql'), - 'redis' => extension_loaded('redis'), - 'Sodium' => extension_loaded('sodium'), - 'sqlite' => extension_loaded('pdo_sqlite'), - 'tidy' => extension_loaded('tidy'), - 'uuid' => extension_loaded('uuid'), - 'xxtea' => extension_loaded('xxtea'), - 'zip' => extension_loaded('zip') -); - -$aRequirements = array( - 'mbstring' => extension_loaded('mbstring'), - 'Zlib' => extension_loaded('zlib'), - // enabled by default: - 'ctype' => extension_loaded('ctype'), - 'json' => function_exists('json_decode'), - 'libxml' => function_exists('libxml_use_internal_errors'), - 'dom' => class_exists('DOMDocument') - // https://github.com/the-djmaze/snappymail/issues/392 -// 'phar' => class_exists('PharData') -); - -if (in_array(false, $aRequirements)) { +$result = \SnappyMail\Integrity::phpExtensions(); +if ($result) { echo '[302] The following PHP extensions are not available in your PHP configuration!
'; - echo '