Improve composer reporter

This commit is contained in:
Daniil Gentili 2020-02-05 23:11:29 +01:00
parent c0a0c693e3
commit 36495bffe9
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 10 additions and 6 deletions

View File

@ -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.

View File

@ -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 {

View File

@ -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);