From ff58c0ba47c5cbbc6fb9ee718e243978c6ea3777 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Thu, 27 Jul 2023 21:16:58 +0200 Subject: [PATCH] release 0.5 --- _define.php | 2 +- dcstore.xml | 4 ++-- locales/fr/main.lang.php | 4 ++-- src/Utils.php | 14 ++++++-------- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/_define.php b/_define.php index 1e1bacf..b42b538 100644 --- a/_define.php +++ b/_define.php @@ -14,7 +14,7 @@ $this->registerModule( 'Dotclear Watch', 'Send report about your Dotclear', 'Jean-Christian Denis and contributors', - '0.4', + '0.5', [ 'requires' => [ ['php', '7.4'], diff --git a/dcstore.xml b/dcstore.xml index 6a342d0..0d286bd 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ Dotclear Watch - 0.4 + 0.5 Jean-Christian Denis and contributors Send report about your Dotclear - https://github.com/JcDenis/DotclearWatch/releases/download/v0.4/plugin-DotclearWatch.zip + https://github.com/JcDenis/DotclearWatch/releases/download/v0.5/plugin-DotclearWatch.zip 2.27 http://plugins.dotaddict.org/dc2/details/DotclearWatch https://github.com/JcDenis/DotclearWatch/issues diff --git a/locales/fr/main.lang.php b/locales/fr/main.lang.php index bcfd5dd..fe90a0e 100644 --- a/locales/fr/main.lang.php +++ b/locales/fr/main.lang.php @@ -18,9 +18,9 @@ L10n::$locales['Settings are globals. Reports are by blog.'] L10n::$locales['Hidden modules:'] = 'Modules cachés :'; L10n::$locales['This is the comma separated list of plugins IDs and themes IDs to ignore in report.'] = 'C\'est la liste des modules cachés séparés par une virgule.'; L10n::$locales['Distant API URL:'] = 'URL de l\'API distante :'; -L10n::$locales['This is the URL of the API to send report. Leave empty to reset value.'] = 'C\'est L\'URL de l\'API où sera envoyer le rapport. Laisser vide pour remettre par défaut.'; +L10n::$locales['This is the URL of the API to send report. Leave empty to reset value.'] = 'C\'est L\'URL de l\'API où sera envoyé le rapport. Laisser vide pour remettre par défaut.'; L10n::$locales['Clear reports cache directory'] = 'Nettoyer le répertoire de cache des rapports.'; L10n::$locales['This deletes all blogs reports in cache.'] = 'Ceci efface tous les rapports des blogs en cache.'; L10n::$locales['Send report now'] = 'Envoyer le rapport maintenant'; -L10n::$locales['This sent report for current blog even if report exists in cache.'] = 'Ceci envoie le rapport pou r le blog courant même si un rapport existe en cache.'; +L10n::$locales['This sent report for current blog even if report exists in cache.'] = 'Ceci envoie le rapport pour le blog courant même si un rapport existe en cache.'; L10n::$locales['Report that will be sent for this blog:'] = 'Rapport qui sera envoyé pour ce blog :'; diff --git a/src/Utils.php b/src/Utils.php index 77948ad..51ac528 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -20,8 +20,6 @@ use dcModuleDefine; use dcThemes; use Dotclear\Helper\Crypt; use Dotclear\Helper\Date; -use Dotclear\Helper\File\Files; -use Dotclear\Helper\File\Path; use Dotclear\Helper\Network\HttpClient; use Exception; @@ -186,7 +184,7 @@ class Utils $status = 500; $response = ''; - $url = sprintf(self::url(), 'report'); + $url = sprintf(self::url(), 'report'); $path = ''; if ($client = HttpClient::initClient($url, $path)) { try { @@ -262,8 +260,8 @@ class Utils } $logs = []; - while($rs->fetch()) { - $logs[] = (int )$rs->f('log_id'); + while ($rs->fetch()) { + $logs[] = (int) $rs->f('log_id'); } dcCore::app()->log->delLogs($logs); } @@ -293,7 +291,7 @@ class Utils private static function read(): string { $rs = dcCore::app()->log->getLogs([ - 'log_table' => My::id() . '_report' + 'log_table' => My::id() . '_report', ]); return $rs->isEmpty() || !is_string($rs->f('log_msg')) ? '' : $rs->f('log_msg'); @@ -302,10 +300,10 @@ class Utils private static function expired(): bool { $rs = dcCore::app()->log->getLogs([ - 'log_table' => My::id() . '_report' + 'log_table' => My::id() . '_report', ]); - return $rs->isEmpty() || !is_string($rs->f('log_dt')) || (int) Date::str('%s',$rs->f('log_dt')) + self::EXPIRED_DELAY < time(); + return $rs->isEmpty() || !is_string($rs->f('log_dt')) || (int) Date::str('%s', $rs->f('log_dt')) + self::EXPIRED_DELAY < time(); } private static function contents(): string