mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
Update php7/8 detection code.
This commit is contained in:
@@ -105,11 +105,18 @@ trait CreateStuff
|
||||
protected function createOAuthKeys(): void // create stuff
|
||||
{
|
||||
// switch on PHP version.
|
||||
if (7 === PHP_MAJOR_VERSION) {
|
||||
$result = version_compare(phpversion(), '8.0');
|
||||
Log::info(sprintf('PHP version is %s', $result));
|
||||
if (-1 === $result) {
|
||||
Log::info('Will run PHP7 code.');
|
||||
// PHP 7
|
||||
$rsa = new \phpseclib\Crypt\RSA;
|
||||
$keys = $rsa->createKey(4096);
|
||||
}
|
||||
if (8 === PHP_MAJOR_VERSION) {
|
||||
|
||||
if ($result >= 0) {
|
||||
Log::info('Will run PHP8 code.');
|
||||
// PHP 8
|
||||
$keys = \phpseclib3\Crypt\RSA::createKey(4096);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user