Wait for packagist, first

This commit is contained in:
Daniil Gentili 2019-12-26 20:26:27 +01:00
parent 64928ccf7c
commit d2be65d4ad
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
6 changed files with 22 additions and 9 deletions

View File

@ -7,6 +7,7 @@ php:
before_install:
- echo "phar.readonly = 0" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- tests/waitPackagist.php
script:
- tests/makephar.sh

View File

@ -4,7 +4,7 @@
"type": "project",
"minimum-stability": "dev",
"license": "AGPL-3.0-only",
"homepage": "https://daniil.it/MadelineProto",
"homepage": "https://docs.madelineproto.xyz",
"keywords": ["telegram", "mtproto", "protocol", "bytes", "messenger", "client", "PHP", "video", "stickers", "audio", "files", "GB"],
"conflict": {
"krakjoe/pthreads-polyfill": "*"
@ -83,4 +83,4 @@
"docs": "php tools/build_docs.php",
"test": "@php -dzend.assertions=1 -dassert.exception=1 ./vendor/bin/phpunit --coverage-text"
}
}
}

View File

@ -19,7 +19,7 @@
namespace phpseclib\Math;
if (PHP_MAJOR_VERSION < 7 && !((\class_exists(\Phar::class) && \Phar::running()) || defined('TESTING_VERSIONS'))) {
if (PHP_MAJOR_VERSION < 7 && !((\class_exists(\Phar::class) && \Phar::running()) || \defined('TESTING_VERSIONS'))) {
throw new \Exception('MadelineProto requires php 7 to run natively, use phar.madelineproto.xyz to run on PHP 5.6');
}
if (\defined('HHVM_VERSION')) {

View File

@ -637,9 +637,9 @@ class TL
} elseif ($method === 'messages.sendEncryptedFile') {
if (isset($arguments['file'])) {
if ((
!\is_array($arguments['file']) ||
!\is_array($arguments['file']) ||
!(isset($arguments['file']['_']) && $this->constructors->findByPredicate($arguments['file']['_']) === 'InputEncryptedFile')
) &&
) &&
$this->API->settings['upload']['allow_automatic_upload']
) {
$arguments['file'] = yield $this->API->uploadEncrypted($arguments['file']);

View File

@ -8,16 +8,18 @@ function returnMe($res)
{
return $res;
}
function __coalesce($ifNotNull, $then) {
function __coalesce($ifNotNull, $then)
{
return $ifNotNull ? $ifNotNull : $then;
}
function __destructure($list, $value) {
function __destructure($list, $value)
{
$res = [];
foreach ($list as $key) {
if (is_string($key)) {
if (\is_string($key)) {
$res []= $value[$key];
} else {
$res = array_merge($res, __destructure($key, $value[$key]));
$res = \array_merge($res, __destructure($key, $value[$key]));
}
}
return $res;

10
tests/waitPackagist.php Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env php
<?php
while (true) {
$json = \json_decode(\file_get_contents('https://repo.packagist.org/p/danog/madelineproto.json'), true);
if ($json["packages"]["danog/madelineproto"]["dev-".\getenv("TRAVIS_BRANCH")]["source"]["reference"] === \getenv('TRAVIS_COMMIT')) {
return;
}
\sleep(1);
}