mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 10:38:59 +01:00
Load alpha build on PHP 7.2+
This commit is contained in:
parent
05a2c682e1
commit
609d1906e7
2
docs
2
docs
@ -1 +1 @@
|
||||
Subproject commit dd3bf63ab7decab40ae506a611ccbe1b95ba9ac2
|
||||
Subproject commit 03833e278142e2b6bec5850fa647d341115403b1
|
21
phar.php
21
phar.php
@ -39,20 +39,27 @@ function ___install_madeline()
|
||||
$release_template = 'https://phar.madelineproto.xyz/release%s?v=new';
|
||||
$phar_template = 'https://phar.madelineproto.xyz/madeline%s.phar?v=new';
|
||||
|
||||
$release_branch = defined('MADELINE_BRANCH') ? '-'.MADELINE_BRANCH : '-old';
|
||||
if ($release_branch === '-') $release_branch = '';
|
||||
$release_default = '';
|
||||
|
||||
if (PHP_MAJOR_VERSION === 5) {
|
||||
// Version definition
|
||||
$release_branch = defined('MADELINE_BRANCH') ? '-'.MADELINE_BRANCH : '-old';
|
||||
if ($release_branch === '-') {
|
||||
$release_branch = '';
|
||||
}
|
||||
$release_default_branch = '';
|
||||
|
||||
if (PHP_MAJOR_VERSION <= 5) {
|
||||
$release_branch = '5'.$release_branch;
|
||||
$release_default = '5';
|
||||
$release_default_branch = '5';
|
||||
} else if (PHP_MINOR_VERSION >= 2) {
|
||||
$release_branch = '';
|
||||
}
|
||||
|
||||
// Checking if defined branch/default branch builds can be downloaded
|
||||
if (!($release = @file_get_contents(sprintf($release_template, $release_branch)))) {
|
||||
if (!($release = @file_get_contents(sprintf($release_template, $release_default)))) {
|
||||
if (!($release = @file_get_contents(sprintf($release_template, $release_default_branch)))) {
|
||||
return;
|
||||
}
|
||||
$release_branch = $release_default;
|
||||
$release_branch = $release_default_branch;
|
||||
}
|
||||
|
||||
if (!file_exists('madeline.phar') || !file_exists('madeline.phar.version') || file_get_contents('madeline.phar.version') !== $release) {
|
||||
|
Loading…
Reference in New Issue
Block a user