1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 06:34:41 +01:00

Load alpha build on PHP 7.2+

This commit is contained in:
Daniil Gentili 2019-03-18 15:24:08 +01:00
parent 05a2c682e1
commit 609d1906e7
2 changed files with 15 additions and 8 deletions

2
docs

@ -1 +1 @@
Subproject commit dd3bf63ab7decab40ae506a611ccbe1b95ba9ac2
Subproject commit 03833e278142e2b6bec5850fa647d341115403b1

View File

@ -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) {