1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 23:14:38 +01:00

Test proxies

This commit is contained in:
Daniil Gentili 2023-01-15 13:25:56 +01:00
parent 53b8919388
commit d79c254590
5 changed files with 6 additions and 16 deletions

View File

@ -4,6 +4,8 @@ Created by <a href="https://daniil.it" target="_blank" rel="noopener">Daniil Gen
`#StandWithUkraine 🇺🇦`
[![status-badge](https://ci.daniil.it/api/badges/danog/MadelineProto/status.svg)](https://ci.daniil.it/danog/MadelineProto)
Do join the official channel, [@MadelineProto](https://t.me/MadelineProto) and the [support groups](https://t.me/pwrtelegramgroup)!
<a href="https://telegram.org/apps" target="_blank" rel="noopener">Approved by Telegram!</a>

View File

@ -20,7 +20,7 @@ declare(strict_types=1);
namespace danog\MadelineProto;
abstract class APIFactory extends AbstractAPIFactory
class APIFactory extends AbstractAPIFactory
{
/**
* @internal this is a internal property generated by build_docs.php, don't change manually

View File

@ -675,9 +675,9 @@ trait PeerHandler
* InputUser?: {_: string, user_id?: int, access_hash?: int, min?: bool},
* InputChannel?: {_: string, channel_id: int, access_hash: int, min: bool},
* type: string
* }&array : array)
* }&array : array|int)
*/
private function genAll($constructor, $folder_id, int $type): array
private function genAll($constructor, $folder_id, int $type): array|int
{
if ($type === MTProto::INFO_TYPE_CONSTRUCTOR) {
if ($constructor['_'] === 'user') {

View File

@ -67,7 +67,7 @@ final class HttpProxy implements RawProxyStreamInterface, BufferedProxyStreamInt
$address = $uri->getHost();
$port = $uri->getPort();
try {
if (\strlen(\inet_pton($address)) === 16) {
if (\strlen(\inet_pton($address) ?: '') === 16) {
$address = '['.$address.']';
}
} catch (Exception) {

View File

@ -66,18 +66,6 @@ if ($loader) {
}
}
/*
* Load .env for settings
*/
if (file_exists('.env') && class_exists(Dotenv\Dotenv::class)) {
echo 'Loading .env...'.PHP_EOL;
$dotenv = Dotenv\Dotenv::create(getcwd());
$dotenv->load();
if (getenv('TEST_SECRET_CHAT') == '') {
echo('TEST_SECRET_CHAT is not defined in .env, please define it (copy .env.example).'.PHP_EOL);
die(1);
}
}
echo 'Loading settings...'.PHP_EOL;
$settings = json_decode(getenv('MTPROTO_SETTINGS'), true) ?: [];