diff --git a/phar.php b/phar.php index a54f77b..cb957f0 100644 --- a/phar.php +++ b/phar.php @@ -65,6 +65,7 @@ class Installer } $this->version = (string) \min(81, (int) (PHP_MAJOR_VERSION.PHP_MINOR_VERSION)); \define('MADELINE_PHAR_GLOB', \getcwd().DIRECTORY_SEPARATOR."madeline*-{$this->version}.phar"); + \define('MADELINE_PHAR_VERSION', \getcwd().DIRECTORY_SEPARATOR."madeline.version"); \define('MADELINE_RELEASE_URL', \sprintf(self::RELEASE_TEMPLATE, $this->version)); } @@ -201,23 +202,22 @@ class Installer */ public function install() { - $remote_release = \file_get_contents(MADELINE_RELEASE_URL) ?: null; - $madeline_phar = "madeline-$remote_release.phar"; - $madeline_version = "madeline-{$this->version}.phar.version"; - - if (\file_exists($madeline_version)) { - $local_release = \file_get_contents($madeline_version) ?: null; + if (\file_exists(MADELINE_PHAR_VERSION)) { + $local_release = \file_get_contents(MADELINE_PHAR_VERSION) ?: null; } else { - \touch($madeline_version); + \touch(MADELINE_PHAR_VERSION); $local_release = null; } \define('HAD_MADELINE_PHAR', !!$local_release); - if (($remote_release === $local_release && \file_exists($madeline_phar)) || $remote_release === null) { + if ($local_release !== null) { return self::load($local_release); } - if (!$this->lock($madeline_version)) { + $remote_release = \file_get_contents(MADELINE_RELEASE_URL) ?: null; + $madeline_phar = "madeline-$remote_release.phar"; + + if (!$this->lock(MADELINE_PHAR_VERSION)) { \flock($this->lockInstaller, LOCK_EX); return $this->install(); } diff --git a/release71 b/release71 index 11b6b86..6e84ed7 100644 --- a/release71 +++ b/release71 @@ -1 +1 @@ -be335276e108d3064a8492f4ea4c131bf434c091-71 \ No newline at end of file +3742edd8d52bb24683774c29bfa52a1242760080-71 \ No newline at end of file diff --git a/release72 b/release72 index adb7129..2749cb7 100644 --- a/release72 +++ b/release72 @@ -1 +1 @@ -be335276e108d3064a8492f4ea4c131bf434c091-72 \ No newline at end of file +3742edd8d52bb24683774c29bfa52a1242760080-72 \ No newline at end of file diff --git a/release73 b/release73 index 6d8e5df..250cca9 100644 --- a/release73 +++ b/release73 @@ -1 +1 @@ -be335276e108d3064a8492f4ea4c131bf434c091-73 \ No newline at end of file +3742edd8d52bb24683774c29bfa52a1242760080-73 \ No newline at end of file diff --git a/release74 b/release74 index c23fe98..dc1949c 100644 --- a/release74 +++ b/release74 @@ -1 +1 @@ -be335276e108d3064a8492f4ea4c131bf434c091-74 \ No newline at end of file +3742edd8d52bb24683774c29bfa52a1242760080-74 \ No newline at end of file diff --git a/release80 b/release80 index 931faeb..f158a0d 100644 --- a/release80 +++ b/release80 @@ -1 +1 @@ -be335276e108d3064a8492f4ea4c131bf434c091-80 \ No newline at end of file +3742edd8d52bb24683774c29bfa52a1242760080-80 \ No newline at end of file diff --git a/release81 b/release81 index 007a286..42c73e2 100644 --- a/release81 +++ b/release81 @@ -1 +1 @@ -be335276e108d3064a8492f4ea4c131bf434c091-81 \ No newline at end of file +3742edd8d52bb24683774c29bfa52a1242760080-81 \ No newline at end of file