Remove rollbar dependency

This commit is contained in:
Daniil Gentili 2019-06-12 18:32:15 +02:00
parent 8b03c63a9e
commit caccecd999
4 changed files with 7 additions and 8 deletions

View File

@ -15,17 +15,16 @@
"phpseclib/phpseclib": "dev-master#27370df as 2.0.15",
"vlucas/phpdotenv": "^3",
"erusev/parsedown": "^1.6",
"rollbar/rollbar": "dev-master",
"ext-mbstring": "*",
"ext-json": "*",
"ext-xml": "*",
"ext-fileinfo": "*",
"amphp/amp": "^2.0",
"amphp/websocket": "dev-master",
"amphp/websocket-client": "dev-master",
"amphp/websocket": "dev-master as 1",
"amphp/websocket-client": "dev-master as 1",
"amphp/socket": "^0.10",
"amphp/dns": "dev-master#aa1892bdf13b787d759df6f2523e8027a434d927 as v0.9.x-dev",
"amphp/artax": "dev-master",
"amphp/artax": "dev-master as 3.0.99",
"amphp/file": "^0.3",
"amphp/uri": "^0.1.4",
"amphp/byte-stream": "^1.6",

View File

@ -67,7 +67,7 @@ class Exception extends \Exception
if (strpos($message, 'pg_query') !== false || strpos($message, 'Undefined variable: ') !== false || strpos($message, 'socket_write') !== false || strpos($message, 'socket_read') !== false || strpos($message, 'Received request to switch to DC ') !== false || strpos($message, "Couldn't get response") !== false || strpos($message, 'Re-executing query...') !== false || strpos($message, "Couldn't find peer by provided") !== false || strpos($message, 'id.pwrtelegram.xyz') !== false || strpos($message, 'Please update ') !== false || strpos($message, 'posix_isatty') !== false) {
return;
}
if (self::$rollbar) {
if (self::$rollbar && class_exists('\\Rollbar\\Rollbar')) {
\Rollbar\Rollbar::log(\Rollbar\Payload\Level::error(), $this, debug_backtrace(0));
}
}

View File

@ -819,7 +819,7 @@ class MTProto extends AsyncConstruct implements TLCallback
public function setup_logger()
{
if (isset($this->settings['logger']['rollbar_token']) && $this->settings['logger']['rollbar_token'] !== '') {
if (isset($this->settings['logger']['rollbar_token']) && $this->settings['logger']['rollbar_token'] !== '' && class_exists('\\Rollbar\\Rollbar')) {
@\Rollbar\Rollbar::init(['environment' => 'production', 'root' => __DIR__, 'access_token' => isset($this->settings['logger']['rollbar_token']) && !in_array($this->settings['logger']['rollbar_token'], ['f9fff6689aea4905b58eec73f66c791d', '300afd7ccef346ea84d0c185ae831718', '11a8c2fe4c474328b40a28193f8d63f5', 'beef2d426496462ba34dcaad33d44a14']) || $this->settings['pwr']['pwr'] ? $this->settings['logger']['rollbar_token'] : 'c07d9b2f73c2461297b0beaef6c1662f'], false, false);
} else {
Exception::$rollbar = false;

View File

@ -191,7 +191,7 @@ class RPCErrorException extends \Exception
if ($this->rpc !== $message) {
$this->fetched = true;
}
if (!self::$rollbar) {
if (!self::$rollbar || !class_exists('\\Rollbar\\Rollbar')) {
return;
}
if (in_array($this->rpc, ['CHANNEL_PRIVATE', -404, -429, 'USERNAME_NOT_OCCUPIED', 'ACCESS_TOKEN_INVALID', 'AUTH_KEY_UNREGISTERED', 'SESSION_PASSWORD_NEEDED', 'PHONE_NUMBER_UNOCCUPIED', 'PEER_ID_INVALID', 'CHAT_ID_INVALID', 'USERNAME_INVALID', 'CHAT_WRITE_FORBIDDEN', 'CHAT_ADMIN_REQUIRED', 'PEER_FLOOD'])) {