Another bugfix

This commit is contained in:
Daniil Gentili 2018-05-08 12:35:05 +00:00
parent e13d28ecda
commit 95a9a0a07c
2 changed files with 9 additions and 9 deletions

View File

@ -1,9 +0,0 @@
<?php
require 'vendor/autoload.php';
$secret = 'pony';
$secret = md5('pony');
echo "Secret is $secret\n";
$handler = new \danog\MadelineProto\Server(['type' => AF_INET, 'protocol' => 0, 'address' => '0.0.0.0', 'port' => 7777, 'handler' => '\danog\MadelineProto\Server\Proxy', 'extra' => ['madeline' => new \danog\MadelineProto\API('proxy.madeline', ['app_info' => ['api_id' => 6, 'api_hash' => 'eb06d4abfb49dc3eeb1aeb98ae0f581e']]), 'secret' => hex2bin($secret), 'timeout' => 30]]);
$handler->start();

View File

@ -26,6 +26,15 @@ class Server
{
set_error_handler(['\\danog\\MadelineProto\\Exception', 'ExceptionErrorHandler']);
\danog\MadelineProto\Logger::constructor(3);
if (!extension_loaded('sockets')) {
throw new Exception(['extension', 'sockets']);
}
if (!extension_loaded('pcntl')) {
throw new Exception(['extension', 'pcntl']);
}
$this->settings = $settings;
$this->mypid = getmypid();
}