release 0.5

This commit is contained in:
Jean-Christian Denis 2023-07-27 21:16:58 +02:00
parent 9f3108761c
commit ff58c0ba47
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
4 changed files with 11 additions and 13 deletions

View file

@ -14,7 +14,7 @@ $this->registerModule(
'Dotclear Watch', 'Dotclear Watch',
'Send report about your Dotclear', 'Send report about your Dotclear',
'Jean-Christian Denis and contributors', 'Jean-Christian Denis and contributors',
'0.4', '0.5',
[ [
'requires' => [ 'requires' => [
['php', '7.4'], ['php', '7.4'],

View file

@ -2,10 +2,10 @@
<modules xmlns:da="http://dotaddict.org/da/"> <modules xmlns:da="http://dotaddict.org/da/">
<module id="DotclearWatch"> <module id="DotclearWatch">
<name>Dotclear Watch</name> <name>Dotclear Watch</name>
<version>0.4</version> <version>0.5</version>
<author>Jean-Christian Denis and contributors</author> <author>Jean-Christian Denis and contributors</author>
<desc>Send report about your Dotclear</desc> <desc>Send report about your Dotclear</desc>
<file>https://github.com/JcDenis/DotclearWatch/releases/download/v0.4/plugin-DotclearWatch.zip</file> <file>https://github.com/JcDenis/DotclearWatch/releases/download/v0.5/plugin-DotclearWatch.zip</file>
<da:dcmin>2.27</da:dcmin> <da:dcmin>2.27</da:dcmin>
<da:details>http://plugins.dotaddict.org/dc2/details/DotclearWatch</da:details> <da:details>http://plugins.dotaddict.org/dc2/details/DotclearWatch</da:details>
<da:support>https://github.com/JcDenis/DotclearWatch/issues</da:support> <da:support>https://github.com/JcDenis/DotclearWatch/issues</da:support>

View file

@ -18,9 +18,9 @@ L10n::$locales['Settings are globals. Reports are by blog.']
L10n::$locales['Hidden modules:'] = 'Modules cachés :'; 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['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['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['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['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['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 :'; L10n::$locales['Report that will be sent for this blog:'] = 'Rapport qui sera envoyé pour ce blog :';

View file

@ -20,8 +20,6 @@ use dcModuleDefine;
use dcThemes; use dcThemes;
use Dotclear\Helper\Crypt; use Dotclear\Helper\Crypt;
use Dotclear\Helper\Date; use Dotclear\Helper\Date;
use Dotclear\Helper\File\Files;
use Dotclear\Helper\File\Path;
use Dotclear\Helper\Network\HttpClient; use Dotclear\Helper\Network\HttpClient;
use Exception; use Exception;
@ -186,7 +184,7 @@ class Utils
$status = 500; $status = 500;
$response = ''; $response = '';
$url = sprintf(self::url(), 'report'); $url = sprintf(self::url(), 'report');
$path = ''; $path = '';
if ($client = HttpClient::initClient($url, $path)) { if ($client = HttpClient::initClient($url, $path)) {
try { try {
@ -262,8 +260,8 @@ class Utils
} }
$logs = []; $logs = [];
while($rs->fetch()) { while ($rs->fetch()) {
$logs[] = (int )$rs->f('log_id'); $logs[] = (int) $rs->f('log_id');
} }
dcCore::app()->log->delLogs($logs); dcCore::app()->log->delLogs($logs);
} }
@ -293,7 +291,7 @@ class Utils
private static function read(): string private static function read(): string
{ {
$rs = dcCore::app()->log->getLogs([ $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'); return $rs->isEmpty() || !is_string($rs->f('log_msg')) ? '' : $rs->f('log_msg');
@ -302,10 +300,10 @@ class Utils
private static function expired(): bool private static function expired(): bool
{ {
$rs = dcCore::app()->log->getLogs([ $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 private static function contents(): string