Merge pull request #11746 from annando/warn

Check for GMP module
This commit is contained in:
Hypolite Petovan 2022-07-18 08:49:50 -04:00 committed by GitHub
commit 2e9d1a9046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 396 additions and 368 deletions

View File

@ -30,7 +30,7 @@ Due to the large variety of operating systems and PHP platforms in existence we
* Apache with mod-rewrite enabled and "Options All" so you can use a local `.htaccess` file
* PHP 7.3+ (PHP8 is not fully supported yet)
* PHP *command line* access with register_argc_argv set to true in the php.ini file
* Curl, GD, PDO, mbstrings, MySQLi, hash, xml, zip and OpenSSL extensions
* Curl, GD, GMP, PDO, mbstrings, MySQLi, hash, xml, zip and OpenSSL extensions
* The POSIX module of PHP needs to be activated (e.g. [RHEL, CentOS](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) have disabled it)
* Some form of email server or email gateway such that PHP mail() works.
If you cannot set up your own email server, you can use the [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) addon and use a remote SMTP server.

View File

@ -27,7 +27,7 @@ Requirements
* Apache mit einer aktiverten mod-rewrite-Funktion und dem Eintrag "Options All", so dass du die lokale .htaccess-Datei nutzen kannst
* PHP 7.3+ (PHP 8 wird noch nicht komplett unterstützt)
* PHP *Kommandozeilen*-Zugang mit register_argc_argv auf "true" gesetzt in der php.ini-Datei
* Curl, GD, PDO, MySQLi, xml, zip und OpenSSL-Erweiterung
* Curl, GD, GMP, PDO, MySQLi, xml, zip und OpenSSL-Erweiterung
* Das POSIX Modul muss aktiviert sein ([CentOS, RHEL](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) haben dies z.B. deaktiviert)
* Einen E-Mail Server, so dass PHP `mail()` funktioniert.
Wenn kein eigener E-Mail Server zur Verfügung steht, kann alternativ das [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) Addon mit einem externen SMTP Account verwendet werden.

View File

@ -263,7 +263,7 @@ class Avatar
{
$localFile = self::getCacheFile($avatar);
if (!empty($localFile)) {
unlink($localFile);
@unlink($localFile);
Logger::debug('Unlink avatar', ['avatar' => $avatar]);
}
}

View File

@ -486,6 +486,13 @@ class Installer
);
$returnVal = $returnVal ? $status : false;
$status = $this->checkFunction('gmp_strval',
DI::l10n()->t('GNU Multiple Precision PHP module'),
DI::l10n()->t('Error: GNU Multiple Precision PHP module required but not installed.'),
true
);
$returnVal = $returnVal ? $status : false;
return $returnVal;
}

View File

@ -102,7 +102,6 @@ class PushSubscription
],
]);
// @todo Only used for logging?
$payload = [
'access_token' => $application_token['access_token'],
'preferred_locale' => $user['language'],

View File

@ -104,6 +104,8 @@ class InstallerTest extends MockedTest
$this->mockL10nT('Error: JSON PHP module required but not installed.', 1);
$this->mockL10nT('File Information PHP module', 1);
$this->mockL10nT('Error: File Information PHP module required but not installed.', 1);
$this->mockL10nT('GNU Multiple Precision PHP module', 1);
$this->mockL10nT('Error: GNU Multiple Precision PHP module required but not installed.', 1);
$this->mockL10nT('Program execution functions', 1);
$this->mockL10nT('Error: Program execution functions (proc_open) required but not enabled.', 1);
}
@ -276,6 +278,17 @@ class InstallerTest extends MockedTest
true,
$install->getChecks());
$this->mockFunctionL10TCalls();
$this->setFunctions(['gmp_strval' => false]);
$install = new Installer();
self::assertFalse($install->checkFunctions());
self::assertCheckExist(12,
'GNU Multiple Precision PHP module',
'Error: GNU Multiple Precision PHP module required but not installed.',
false,
true,
$install->getChecks());
$this->mockFunctionL10TCalls();
$this->setFunctions([
'curl_init' => true,
@ -286,6 +299,7 @@ class InstallerTest extends MockedTest
'posix_kill' => true,
'json_encode' => true,
'finfo_open' => true,
'gmp_strval' => true,
]);
$install = new Installer();
self::assertTrue($install->checkFunctions());

File diff suppressed because it is too large Load Diff