1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 04:08:59 +01:00

Bump minimum versions

This commit is contained in:
Daniil Gentili 2024-01-08 19:26:40 +01:00
parent 126081a951
commit 11a7e8d9d3
7 changed files with 14 additions and 14 deletions

View File

@ -24,7 +24,7 @@
},
"minimum-stability": "beta",
"require": {
"php-64bit": ">=8.1",
"php-64bit": ">=8.2.4",
"danog/primemodule": "^1",
"symfony/polyfill-mbstring": "*",
"ext-mbstring": "*",
@ -57,7 +57,7 @@
"psr/log": "^3",
"webmozart/assert": "^1.11",
"bacon/bacon-qr-code": "^2.0",
"nikic/php-parser": "^4.16",
"nikic/php-parser": "^5",
"revolt/event-loop": "^1.0.5"
},
"require-dev": {

View File

@ -2,7 +2,7 @@
/**
* Example bot.
*
* PHP 8.1.15+ or 8.2.4+ is required.
* PHP 8.2.4+ is required.
*
* Copyright 2016-2020 Daniil Gentili
* (https://daniil.it)

View File

@ -1,7 +1,7 @@
<?php declare(strict_types=1);
// Simple example bot.
// PHP 8.1.15+ or 8.2.4+ is required.
// PHP 8.2.4+ is required.
// Run via CLI (recommended: `screen php bot.php`) or via web.

View File

@ -700,7 +700,7 @@ abstract class Tools extends AsyncTools
$plugin = is_subclass_of($class, PluginEventHandler::class);
$file = (new ReflectionClass($class))->getFileName();
$code = read($file);
$code = (new ParserFactory)->create(ParserFactory::ONLY_PHP7)->parse($code);
$code = (new ParserFactory)->createForNewestSupportedVersion()->parse($code);
Assert::notNull($code);
$traverser = new NodeTraverser;
$traverser->addVisitor(new NameResolver());

View File

@ -16,6 +16,6 @@ class_alias(RedisArray::class, '\\danog\\MadelineProto\\Db\\NullCache\\RedisArra
if ((PHP_MINOR_VERSION === 2 && PHP_VERSION_ID < 80204)
|| (PHP_MINOR_VERSION === 1 && PHP_VERSION_ID < 80117)
) {
echo('MadelineProto requires PHP 8.2.4+ (recommended) or 8.1.17+.'.PHP_EOL);
echo('MadelineProto requires PHP 8.3.1+ (recommended) or 8.2.14+.'.PHP_EOL);
die(1);
}

View File

@ -23,11 +23,11 @@ $p->buildFromDirectory(realpath($argv[1]), '/^((?!tests).)*(\.php|\.py|\.exe|\.t
$p->setStub('<?php
if ((PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 1) || PHP_MAJOR_VERSION <= 7) {
die("MadelineProto requires at least PHP 8.1.".PHP_EOL);
if ((PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 2) || PHP_MAJOR_VERSION <= 7) {
die("MadelineProto requires at least PHP 8.2.".PHP_EOL);
}
if (PHP_INT_SIZE < 8) {
die("A 64-bit build of PHP is required to run MadelineProto, PHP 8.1 is required.".PHP_EOL);
die("A 64-bit build of PHP is required to run MadelineProto, PHP 8.2 is required.".PHP_EOL);
}
if (\defined("MADELINE_PHAR")) {

View File

@ -40,11 +40,11 @@ class Installer
*/
public function __construct()
{
if ((PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 1) || PHP_MAJOR_VERSION <= 7) {
die('MadelineProto requires at least PHP 8.1.'.PHP_EOL);
if ((PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 2) || PHP_MAJOR_VERSION <= 7) {
die('MadelineProto requires at least PHP 8.2.'.PHP_EOL);
}
if (PHP_INT_SIZE < 8) {
die('A 64-bit build of PHP is required to run MadelineProto, PHP 8.1 is required.'.PHP_EOL);
die('A 64-bit build of PHP is required to run MadelineProto, PHP 8.2+ is required.'.PHP_EOL);
}
$backtrace = debug_backtrace(0);
if (\count($backtrace) === 1) {
@ -159,8 +159,8 @@ class Installer
private static function load(?string $release): mixed
{
if ($release === null) {
if ((PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 1) || PHP_MAJOR_VERSION <= 7) {
throw new \Exception('MadelineProto requires at least PHP 8.1.');
if ((PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 2) || PHP_MAJOR_VERSION <= 7) {
throw new \Exception('MadelineProto requires at least PHP 8.2.');
}
throw new \Exception('Could not download MadelineProto, please check your internet connection and PHP configuration!');
}