mirror of
https://github.com/danog/MadelineProtoPhar.git
synced 2024-11-30 08:09:00 +01:00
Release stable - Remove some hacks
This commit is contained in:
parent
d5e3792c1e
commit
13c3569c5d
18
phar.php
18
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();
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
be335276e108d3064a8492f4ea4c131bf434c091-71
|
||||
3742edd8d52bb24683774c29bfa52a1242760080-71
|
@ -1 +1 @@
|
||||
be335276e108d3064a8492f4ea4c131bf434c091-72
|
||||
3742edd8d52bb24683774c29bfa52a1242760080-72
|
@ -1 +1 @@
|
||||
be335276e108d3064a8492f4ea4c131bf434c091-73
|
||||
3742edd8d52bb24683774c29bfa52a1242760080-73
|
@ -1 +1 @@
|
||||
be335276e108d3064a8492f4ea4c131bf434c091-74
|
||||
3742edd8d52bb24683774c29bfa52a1242760080-74
|
@ -1 +1 @@
|
||||
be335276e108d3064a8492f4ea4c131bf434c091-80
|
||||
3742edd8d52bb24683774c29bfa52a1242760080-80
|
Loading…
Reference in New Issue
Block a user