Let's not break stuff

This commit is contained in:
Daniil Gentili 2017-01-26 16:16:31 +01:00
parent 6e3e9e5d12
commit b25d926acd
3 changed files with 3 additions and 6 deletions

View File

@ -179,7 +179,7 @@ class Connection
throw new Exception("Connection: couldn't connect to socket."); throw new Exception("Connection: couldn't connect to socket.");
} }
$packet = stream_get_contents($this->sock, $length); $packet = stream_get_contents($this->sock, $length);
if ($packet === false || strlen($packet) != $length) { if (strlen($packet) != $length) {
throw new \danog\MadelineProto\Exception("WARNING: Wrong length was read (should've read ".($length).', read '.strlen($packet).')!'); throw new \danog\MadelineProto\Exception("WARNING: Wrong length was read (should've read ".($length).', read '.strlen($packet).')!');
} }

View File

@ -225,10 +225,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
public function setup_logger() public function setup_logger()
{ {
//if (!\danog\MadelineProto\Logger::$constructed) { \danog\MadelineProto\Logger::constructor($this->settings['logger']['logger'], $this->settings['logger']['logger_param'], isset($this->datacenter->authorization['user']) ? (isset($this->datacenter->authorization['user']['username']) ? $this->datacenter->authorization['user']['username'] : $this->datacenter->authorization['user']['id']) : '', isset($this->settings['logger']['logger_level']) ? $this->settings['logger']['logger_level'] : Logger::VERBOSE);
// Set up logger class
\danog\MadelineProto\Logger::constructor($this->settings['logger']['logger'], $this->settings['logger']['logger_param'], isset($this->datacenter->authorization['user']) ? (isset($this->datacenter->authorization['user']['username']) ? $this->datacenter->authorization['user']['username'] : $this->datacenter->authorization['user']['id']) : '', $this->settings['logger']['logger_level']);
//}
} }
public function reset_session($de = true) public function reset_session($de = true)

View File

@ -17,7 +17,7 @@ if (file_exists('web_data.php')) {
} }
echo 'Deserializing MadelineProto from session.madeline...'.PHP_EOL; echo 'Deserializing MadelineProto from session.madeline...'.PHP_EOL;
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('session.madeline'); $MadelineProto = \danog\MadelineProto\Serialization::deserialize('/tmp/pwr.madeline');
if (file_exists('.env')) { if (file_exists('.env')) {
echo 'Loading .env...'.PHP_EOL; echo 'Loading .env...'.PHP_EOL;