Improve composer reporter
This commit is contained in:
parent
c0a0c693e3
commit
36495bffe9
@ -24,7 +24,6 @@ use Amp\Promise;
|
||||
use danog\MadelineProto\Async\AsyncParameters;
|
||||
use danog\MadelineProto\TL\Exception;
|
||||
use danog\MadelineProto\Tools;
|
||||
use function Amp\Promise\all;
|
||||
|
||||
/**
|
||||
* Manages method and object calls.
|
||||
|
@ -74,7 +74,7 @@ final class DataCenterTest extends TestCase
|
||||
|
||||
$API->getLogger()->logger("Testing protocol $protocol using transport $transport, ".($obfuscated ? 'obfuscated ' : 'not obfuscated ').($test_mode ? 'test DC ' : 'main DC ').($ipv6 ? 'IPv6' : 'IPv4'));
|
||||
|
||||
sleep(1);
|
||||
\sleep(1);
|
||||
try {
|
||||
Tools::wait($datacenter->dcConnect(2));
|
||||
} finally {
|
||||
|
@ -82,18 +82,23 @@ function ___install_madeline()
|
||||
$phar = \file_get_contents(\sprintf($phar_template, $release_branch));
|
||||
|
||||
if ($phar) {
|
||||
$extractVersions = static function () {
|
||||
if (!\file_exists('phar://madeline.phar/vendor/composer/installed.json')) {
|
||||
$extractVersions = static function ($ext = '') {
|
||||
if (!\file_exists("phar://madeline.phar$ext/vendor/composer/installed.json")) {
|
||||
return [];
|
||||
}
|
||||
$composer = \json_decode(\file_get_contents('phar://madeline.phar/vendor/composer/installed.json'), true);
|
||||
$composer = \json_decode(\file_get_contents("phar://madeline.phar$ext/vendor/composer/installed.json"), true) ?: [];
|
||||
$packages = [];
|
||||
foreach ($composer as $dep) {
|
||||
$packages[$dep['name']] = $dep['version_normalized'];
|
||||
}
|
||||
return $packages;
|
||||
};
|
||||
$previous = $extractVersions();
|
||||
$previous = [];
|
||||
if (\file_exists('madeline.phar')) {
|
||||
\copy('madeline.phar', 'madeline.phar.old');
|
||||
$previous = $extractVersions('.old');
|
||||
\unlink('madeline.phar.old');
|
||||
}
|
||||
$previous['danog/madelineproto'] = 'old';
|
||||
|
||||
\file_put_contents('madeline.phar', $phar);
|
||||
|
Loading…
Reference in New Issue
Block a user