Setting alias

This commit is contained in:
Daniil Gentili 2019-07-01 10:04:34 +02:00
parent 37a9133a6f
commit c451471f78
3 changed files with 8 additions and 9 deletions

View File

@ -101,7 +101,9 @@ class Logger
Exception::$rollbar = false;
RPCErrorException::$rollbar = false;
}
if (!isset($settings['logger']['logger_param']) && isset($settings['logger']['param'])) {
$settings['logger']['logger_param'] = $settings['logger']['param'];
}
if (php_sapi_name() !== 'cli') {
if (isset($settings['logger']['logger_param']) && basename($settings['logger']['logger_param']) === 'MadelineProto.log') {
$settings['logger']['logger_param'] = Magic::$script_cwd.'/MadelineProto.log';

View File

@ -213,6 +213,7 @@ class PasswordCalculator
$gForHash = $this->current_algo['gForHash'];
$p = $this->current_algo['p'];
$pForHash = $this->current_algo['pForHash'];
$B = $this->srp_B;
$BForHash = $this->srp_BForHash;
$id = $this->srp_id;

View File

@ -1,7 +1,5 @@
#!/usr/bin/env php
<?php
use danog\MadelineProto\RPCErrorException;
/*
Copyright 2016-2019 Daniil Gentili
(https://daniil.it)
@ -45,7 +43,6 @@ if (getenv('TEST_SECRET_CHAT') == '') {
echo 'Loading settings...'.PHP_EOL;
$settings = json_decode(getenv('MTPROTO_SETTINGS'), true) ?: [];
/*
* Load MadelineProto
*/
@ -61,7 +58,6 @@ try {
$MadelineProto->accept_tos();
}
}
//var_dump(count($MadelineProto->get_pwr_chat('@madelineproto')['participants']));
/*
@ -82,7 +78,7 @@ $message = (getenv('TRAVIS_COMMIT') == '') ? 'I iz works always (io laborare sem
/*
* Try making a phone call
*/
if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to make a call? (y/n): '), 'y') !== false) {
if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to make a call? (y/n): '), 'y') !== false) {
$controller = $MadelineProto->request_call(getenv('TEST_SECRET_CHAT'))->play('input.raw')->then('input.raw')->playOnHold(['input.raw'])->setOutputFile('output.raw');
while ($controller->getCallState() < \danog\MadelineProto\VoIP::CALL_STATE_READY) {
$MadelineProto->get_updates();
@ -96,8 +92,8 @@ if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to make a call? (y
/*
* Try receiving a phone call
*/
if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to handle incoming calls? (y/n): '), 'y') !== false) {
$howmany = readline('How many calls would you like me to handle? ');
if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to handle incoming calls? (y/n): '), 'y') !== false) {
$howmany = $MadelineProto->readline('How many calls would you like me to handle? ');
$offset = 0;
while ($howmany > 0) {
$updates = $MadelineProto->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout
@ -118,7 +114,7 @@ if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to handle incoming
/*
* Secret chat usage
*/
if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to make the secret chat tests? (y/n): '), 'y') !== false) {
if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to make the secret chat tests? (y/n): '), 'y') !== false) {
/**
* Request a secret chat.
*/