diff --git a/docs b/docs index dd3bf63a..03833e27 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit dd3bf63ab7decab40ae506a611ccbe1b95ba9ac2 +Subproject commit 03833e278142e2b6bec5850fa647d341115403b1 diff --git a/phar.php b/phar.php index 7dc9b177..9169f669 100644 --- a/phar.php +++ b/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) {