Phar fixes
This commit is contained in:
parent
e83575ffdb
commit
8c59efbd96
@ -25,12 +25,15 @@ $p->addFromString('.git/refs/heads/master', $argv[3]);
|
|||||||
|
|
||||||
$p->setStub('<?php
|
$p->setStub('<?php
|
||||||
$backtrace = debug_backtrace();
|
$backtrace = debug_backtrace();
|
||||||
if ($backtrace && in_array(basename($backtrace[0]["file"]), ["madeline.php", "phar.php"]) && isset($backtrace[1]["file"]) && !defined("PHAR_DEBUG")) {
|
if (!isset($backtrace[0]["file"]) || !in_array(basename($backtrace[0]["file"]), ["madeline.php", "phar.php"])) {
|
||||||
|
die("madeline.phar cannot be required manually: use the automatic loader, instead: https://docs.madelineproto.xyz/docs/INSTALLATION.html#simple".PHP_EOL);
|
||||||
|
}
|
||||||
|
if (isset($backtrace[1]["file"])) {
|
||||||
chdir(dirname($backtrace[1]["file"]));
|
chdir(dirname($backtrace[1]["file"]));
|
||||||
|
}
|
||||||
if ($contents = file_get_contents("https://phar.madelineproto.xyz/phar.php?v=new")) {
|
if ($contents = file_get_contents("https://phar.madelineproto.xyz/phar.php?v=new")) {
|
||||||
file_put_contents($backtrace[0]["file"], $contents);
|
file_put_contents($backtrace[0]["file"], $contents);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Phar::interceptFileFuncs();
|
Phar::interceptFileFuncs();
|
||||||
Phar::mapPhar("'.$argv[2].'");
|
Phar::mapPhar("'.$argv[2].'");
|
||||||
|
Loading…
Reference in New Issue
Block a user