From 282d0b1655710f41601e0e7006cdb0039fee7c89 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 18 Jun 2019 19:35:13 +0200 Subject: [PATCH] Load by default only manually tagged releases --- phar.php | 17 ++++++++++++----- tests/makephar.sh | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/phar.php b/phar.php index 57bfcbce..11b83040 100644 --- a/phar.php +++ b/phar.php @@ -49,15 +49,22 @@ function ___install_madeline() $phar_template = 'https://phar.madelineproto.xyz/madeline%s.phar?v=new'; // Version definition - $release_branch = defined('MADELINE_BRANCH') ? '-'.MADELINE_BRANCH : ''; + $custom_branch = defined('MADELINE_BRANCH') ? MADELINE_BRANCH : null; + if ($custom_branch === '') { // If the constant is an empty string, default to the latest alpha build + $custom_branch = 'master'; + } else if ($custom_branch === null) { // If the constant is not defined, default to the latest stable build + $custom_branch = ''; + } + + $release_branch = "-$custom_branch"; if ($release_branch === '-') { $release_branch = ''; } $release_fallback_branch = ''; - if (isset($_SERVER['SERVER_ADMIN']) && strpos($_SERVER['SERVER_ADMIN'], '000webhost.io')) { - $release_branch = '-deprecated'; - $release_fallback_branch = '-deprecated'; - } + /*if (isset($_SERVER['SERVER_ADMIN']) && strpos($_SERVER['SERVER_ADMIN'], '000webhost.io')) { + $release_branch = '-deprecated'; + $release_fallback_branch = '-deprecated'; + }*/ if (PHP_MAJOR_VERSION <= 5) { $release_branch = '5'.$release_branch; diff --git a/tests/makephar.sh b/tests/makephar.sh index dfb668bf..6268f822 100755 --- a/tests/makephar.sh +++ b/tests/makephar.sh @@ -88,7 +88,8 @@ cd .. find phar5 -type f -exec sed 's/\w* \.\.\./.../' -i {} + -[ "$TRAVIS_BRANCH" != "master" ] && branch="-$TRAVIS_BRANCH" || branch="" +#[ "$TRAVIS_BRANCH" != "master" ] && branch="-$TRAVIS_BRANCH" || branch="" +branch="-$TRAVIS_BRANCH" cd $madelinePath php makephar.php $HOME/phar5 "madeline$php$branch.phar" $TRAVIS_COMMIT