mirror of
https://github.com/friendica/friendica
synced 2025-02-07 06:18:50 +00:00
Replace Logger with $this->logger in Module BaseApi class
This commit is contained in:
parent
f817308080
commit
105c737609
2 changed files with 3 additions and 5 deletions
|
@ -12,7 +12,6 @@ use Friendica\Capabilities\ICanHandleRequests;
|
||||||
use Friendica\Capabilities\ICanCreateResponses;
|
use Friendica\Capabilities\ICanCreateResponses;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger;
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Module\Response;
|
use Friendica\Module\Response;
|
||||||
|
|
|
@ -14,7 +14,6 @@ use Friendica\App\Router;
|
||||||
use Friendica\AppHelper;
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger;
|
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -227,7 +226,7 @@ class BaseApi extends BaseModule
|
||||||
self::setBoundaries($post_item['uri-id']);
|
self::setBoundaries($post_item['uri-id']);
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Logger::debug('Error processing page boundary calculation, skipping', ['error' => $e]);
|
$this->logger->debug('Error processing page boundary calculation, skipping', ['error' => $e]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,7 +454,7 @@ class BaseApi extends BaseModule
|
||||||
$posts_week = Post::countThread($condition);
|
$posts_week = Post::countThread($condition);
|
||||||
|
|
||||||
if ($posts_week > $throttle_week) {
|
if ($posts_week > $throttle_week) {
|
||||||
Logger::notice('Weekly posting limit reached', ['uid' => $uid, 'posts' => $posts_week, 'limit' => $throttle_week]);
|
$this->logger->notice('Weekly posting limit reached', ['uid' => $uid, 'posts' => $posts_week, 'limit' => $throttle_week]);
|
||||||
$error = $this->t('Too Many Requests');
|
$error = $this->t('Too Many Requests');
|
||||||
$error_description = $this->tt("Weekly posting limit of %d post reached. The post was rejected.", "Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week);
|
$error_description = $this->tt("Weekly posting limit of %d post reached. The post was rejected.", "Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week);
|
||||||
$errorobj = new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
|
$errorobj = new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
|
||||||
|
@ -471,7 +470,7 @@ class BaseApi extends BaseModule
|
||||||
$posts_month = Post::countThread($condition);
|
$posts_month = Post::countThread($condition);
|
||||||
|
|
||||||
if ($posts_month > $throttle_month) {
|
if ($posts_month > $throttle_month) {
|
||||||
Logger::notice('Monthly posting limit reached', ['uid' => $uid, 'posts' => $posts_month, 'limit' => $throttle_month]);
|
$this->logger->notice('Monthly posting limit reached', ['uid' => $uid, 'posts' => $posts_month, 'limit' => $throttle_month]);
|
||||||
$error = $this->t('Too Many Requests');
|
$error = $this->t('Too Many Requests');
|
||||||
$error_description = $this->tt('Monthly posting limit of %d post reached. The post was rejected.', 'Monthly posting limit of %d posts reached. The post was rejected.', $throttle_month);
|
$error_description = $this->tt('Monthly posting limit of %d post reached. The post was rejected.', 'Monthly posting limit of %d posts reached. The post was rejected.', $throttle_month);
|
||||||
$errorobj = new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
|
$errorobj = new \Friendica\Object\Api\Mastodon\Error($error, $error_description);
|
||||||
|
|
Loading…
Add table
Reference in a new issue