Compare commits
No commits in common. "master" and "v0.9.1" have entirely different histories.
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -1,18 +1,3 @@
|
||||||
DotclearWatch 0.9.3 - 2023.10.22
|
|
||||||
===========================================================
|
|
||||||
* Require dotclear 2.28
|
|
||||||
* Require php 8.1
|
|
||||||
* Add PHP minor version (using PHP constants)
|
|
||||||
* Add uninstall feature (plugin Uninstaller)
|
|
||||||
* Fix colored synthax
|
|
||||||
* Use Helper Form everywhere
|
|
||||||
|
|
||||||
DotclearWatch 0.9.2 - 2023.10.14
|
|
||||||
===========================================================
|
|
||||||
* Require dotclear 2.28
|
|
||||||
* Require php 8.1
|
|
||||||
* Fix last minute update from Dtoclear 2.28
|
|
||||||
|
|
||||||
DotclearWatch 0.9.1 - 2023.10.09
|
DotclearWatch 0.9.1 - 2023.10.09
|
||||||
===========================================================
|
===========================================================
|
||||||
* Require dotclear 2.28
|
* Require dotclear 2.28
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# README
|
# README
|
||||||
|
|
||||||
[![Release](https://img.shields.io/badge/release-0.9.3-a2cbe9.svg)](https://git.dotclear.watch/dw/DotclearWatch/releases)
|
[![Release](https://img.shields.io/badge/release-0.9-a2cbe9.svg)](https://git.dotclear.watch/dw/DotclearWatch/releases)
|
||||||
![Date](https://img.shields.io/badge/date-2023.10.22-c44d58.svg)
|
![Date](https://img.shields.io/badge/date-2023.10.07-c44d58.svg)
|
||||||
[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download)
|
[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download)
|
||||||
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/DotclearWatch)
|
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/DotclearWatch)
|
||||||
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/dw/DotclearWatch/src/branch/master/LICENSE)
|
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/dw/DotclearWatch/src/branch/master/LICENSE)
|
||||||
|
@ -29,9 +29,9 @@ in aboutConfig global parameters called DotclearWatch->hidden_modules
|
||||||
|
|
||||||
## REQUIREMENTS
|
## REQUIREMENTS
|
||||||
|
|
||||||
|
* super admin permission to intall it
|
||||||
* Dotclear 2.28
|
* Dotclear 2.28
|
||||||
* PHP 8.1+
|
* PHP 8.1+
|
||||||
* Dotclear super admin permission to intall it
|
|
||||||
|
|
||||||
## USAGE
|
## USAGE
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,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.9.3',
|
'0.9.1',
|
||||||
[
|
[
|
||||||
'requires' => [['core', '2.28']],
|
'requires' => [['core', '2.28']],
|
||||||
'permissions' => 'My',
|
'permissions' => 'My',
|
||||||
|
|
|
@ -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.9.3</version>
|
<version>0.9.1</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://git.dotclear.watch/dw/DotclearWatch/releases/download/v0.9.3/plugin-DotclearWatch.zip</file>
|
<file>https://git.dotclear.watch/dw/DotclearWatch/releases/download/v0.9.1/plugin-DotclearWatch.zip</file>
|
||||||
<da:dcmin>2.28</da:dcmin>
|
<da:dcmin>2.28</da:dcmin>
|
||||||
<da:details>https://git.dotclear.watch/dw/DotclearWatch/src/branch/master/README.md</da:details>
|
<da:details>https://git.dotclear.watch/dw/DotclearWatch/src/branch/master/README.md</da:details>
|
||||||
<da:support>https://git.dotclear.watch/dw/DotclearWatch/issues</da:support>
|
<da:support>https://git.dotclear.watch/dw/DotclearWatch/issues</da:support>
|
||||||
|
|
|
@ -6,18 +6,13 @@ namespace Dotclear\Plugin\DotclearWatch;
|
||||||
|
|
||||||
use Dotclear\App;
|
use Dotclear\App;
|
||||||
use Dotclear\Core\Process;
|
use Dotclear\Core\Process;
|
||||||
use Dotclear\Helper\Html\Form\{
|
|
||||||
Img,
|
|
||||||
Li,
|
|
||||||
Link,
|
|
||||||
Ul
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DotclearWatch backend class.
|
* @brief DotclearWatch backend class.
|
||||||
* @ingroup DotclearWatch
|
* @ingroup DotclearWatch
|
||||||
*
|
*
|
||||||
* @author Jean-Christian Denis
|
* @author Jean-Christian Denis
|
||||||
|
* @copyright Jean-Christian Denis
|
||||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*/
|
*/
|
||||||
class Backend extends Process
|
class Backend extends Process
|
||||||
|
@ -34,31 +29,23 @@ class Backend extends Process
|
||||||
}
|
}
|
||||||
|
|
||||||
App::behavior()->addBehaviors([
|
App::behavior()->addBehaviors([
|
||||||
// Add JS for asynchronous report sending
|
|
||||||
'adminDashboardHeaders' => function (): string {
|
'adminDashboardHeaders' => function (): string {
|
||||||
return My::jsLoad('service', App::version()->getVersion(My::id()));
|
return My::jsLoad('service', App::version()->getVersion(My::id()));
|
||||||
},
|
},
|
||||||
// Add icon on bottom of dashboard sidebar menu
|
|
||||||
'adminPageFooterV2' => function (): void {
|
'adminPageFooterV2' => function (): void {
|
||||||
if (My::settings()->getGlobal('distant_api_url')) {
|
if (My::settings()->getGlobal('distant_api_url')) {
|
||||||
echo (new Ul())->items([
|
echo sprintf(
|
||||||
(new li())->items([
|
'<ul><li><a href="%s" title="%s" class="outgoing">%s<img src="%s" /></a></ul></li>',
|
||||||
(new Link())
|
'https://stat.dotclear.watch',
|
||||||
->class('outgoing')
|
__('Uses DotclearWatch plugin statistics'),
|
||||||
->href('https://stat.dotclear.watch')
|
__('Shared statistics'),
|
||||||
->title(__('Uses DotclearWatch plugin statistics'))
|
My::fileURL('icon.svg')
|
||||||
->text(__('Shared statistics'))
|
);
|
||||||
->items([
|
|
||||||
(new Img(My::fileURL('icon.svg'))),
|
|
||||||
]),
|
|
||||||
]),
|
|
||||||
])->render();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
App::rest()->addFunction(
|
App::rest()->addFunction(
|
||||||
// Add REST service for asynchronous report sending
|
|
||||||
'adminDotclearWatchSendReport',
|
'adminDotclearWatchSendReport',
|
||||||
function (): array {
|
function (): array {
|
||||||
Utils::sendReport();
|
Utils::sendReport();
|
||||||
|
|
|
@ -23,26 +23,16 @@ use Dotclear\Helper\Html\Form\{
|
||||||
use Dotclear\Helper\Html\Html;
|
use Dotclear\Helper\Html\Html;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DotclearWatch configuration class.
|
* @brief DotclearWatch configuration class.
|
||||||
* @ingroup DotclearWatch
|
* @ingroup DotclearWatch
|
||||||
*
|
*
|
||||||
* @author Jean-Christian Denis
|
* @author Jean-Christian Denis
|
||||||
|
* @copyright Jean-Christian Denis
|
||||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*/
|
*/
|
||||||
class Config extends Process
|
class Config extends Process
|
||||||
{
|
{
|
||||||
/**
|
private static string $hidden_modules = '';
|
||||||
* List of hidden modules.
|
|
||||||
*
|
|
||||||
* @var string $hidden_modules
|
|
||||||
*/
|
|
||||||
private static string $hidden_modules = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Distant API URL.
|
|
||||||
*
|
|
||||||
* @var string $distant_api_url
|
|
||||||
*/
|
|
||||||
private static string $distant_api_url = '';
|
private static string $distant_api_url = '';
|
||||||
|
|
||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
|
@ -56,7 +46,7 @@ class Config extends Process
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (App::auth()->prefs()->get('interface')->get('colorsyntax')) {
|
if (self::useColorSynthax()) {
|
||||||
App::behavior()->addBehavior('pluginsToolsHeadersV2', fn (bool $plugin): string => Page::jsLoadCodeMirror(App::auth()->prefs()->get('interface')->get('colorsyntax_theme')));
|
App::behavior()->addBehavior('pluginsToolsHeadersV2', fn (bool $plugin): string => Page::jsLoadCodeMirror(App::auth()->prefs()->get('interface')->get('colorsyntax_theme')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,8 +62,7 @@ class Config extends Process
|
||||||
Notices::AddSuccessNotice(__('Cache directory sucessfully cleared.'));
|
Notices::AddSuccessNotice(__('Cache directory sucessfully cleared.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$distant_api_url = !empty($_POST['distant_api_url']) && is_string($_POST['distant_api_url']) ? $_POST['distant_api_url'] : Utils::DISTANT_API_URL;
|
self::$hidden_modules = '';
|
||||||
self::$hidden_modules = '';
|
|
||||||
foreach (explode(',', $_POST['hidden_modules']) as $hidden) {
|
foreach (explode(',', $_POST['hidden_modules']) as $hidden) {
|
||||||
$hidden = trim($hidden);
|
$hidden = trim($hidden);
|
||||||
if (!empty($hidden)) {
|
if (!empty($hidden)) {
|
||||||
|
@ -81,6 +70,8 @@ class Config extends Process
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self::$distant_api_url = !empty($_POST['distant_api_url']) && is_string($_POST['distant_api_url']) ? $_POST['distant_api_url'] : Utils::DISTANT_API_URL;
|
||||||
|
|
||||||
My::settings()->put('hidden_modules', self::$hidden_modules, 'string', 'Hidden modules from report', true, true);
|
My::settings()->put('hidden_modules', self::$hidden_modules, 'string', 'Hidden modules from report', true, true);
|
||||||
My::settings()->put('distant_api_url', self::$distant_api_url, 'string', 'Distant API report URL', true, true);
|
My::settings()->put('distant_api_url', self::$distant_api_url, 'string', 'Distant API report URL', true, true);
|
||||||
Notices::AddSuccessNotice(__('Settings successfully updated.'));
|
Notices::AddSuccessNotice(__('Settings successfully updated.'));
|
||||||
|
@ -95,7 +86,7 @@ class Config extends Process
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
App::backend()->url()->redirect('admin.plugins', ['module' => My::id(), 'conf' => '1']);
|
App::backend()->url->redirect('admin.plugins', ['module' => My::id(), 'conf' => '1']);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -115,12 +106,12 @@ class Config extends Process
|
||||||
]),
|
]),
|
||||||
(new Para())->items([
|
(new Para())->items([
|
||||||
(new Label(__('Hidden modules:')))->for('hidden_modules'),
|
(new Label(__('Hidden modules:')))->for('hidden_modules'),
|
||||||
(new Input('hidden_modules'))->class('maximal')->size(65)->maxlength(255)->value(self::$hidden_modules),
|
(new Input('hidden_modules'))->class('maximal')->size(65)->maxlenght(255)->value(self::$hidden_modules),
|
||||||
]),
|
]),
|
||||||
(new Note())->class('form-note')->text(__('This is the comma separated list of plugins IDs and themes IDs to ignore in report.')),
|
(new Note())->class('form-note')->text(__('This is the comma separated list of plugins IDs and themes IDs to ignore in report.')),
|
||||||
(new Para())->items([
|
(new Para())->items([
|
||||||
(new Label(__('Distant API URL:')))->for('distant_api_url'),
|
(new Label(__('Distant API URL:')))->for('distant_api_url'),
|
||||||
(new Input('distant_api_url'))->class('maximal')->size(65)->maxlength(255)->value(self::$distant_api_url),
|
(new Input('distant_api_url'))->class('maximal')->size(65)->maxlenght(255)->value(self::$distant_api_url),
|
||||||
]),
|
]),
|
||||||
(new Note())->class('form-note')->text(__('This is the URL of the API to send report. Leave empty to reset value.')),
|
(new Note())->class('form-note')->text(__('This is the URL of the API to send report. Leave empty to reset value.')),
|
||||||
(new Para())->items([
|
(new Para())->items([
|
||||||
|
@ -147,9 +138,14 @@ class Config extends Process
|
||||||
->class('maximal'),
|
->class('maximal'),
|
||||||
])->render() .
|
])->render() .
|
||||||
(
|
(
|
||||||
App::auth()->prefs()->get('interface')->get('colorsyntax') ?
|
self::useColorSynthax() ?
|
||||||
Page::jsRunCodeMirror(My::id() . 'editor', 'report_contents', 'json', App::auth()->prefs()->get('interface')->get('colorsyntax_theme')) : ''
|
Page::jsRunCodeMirror(My::id() . 'editor', 'report_contents', 'json', App::auth()->prefs()->get('interface')->get('colorsyntax_theme')) : ''
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function useColorSynthax(): bool
|
||||||
|
{
|
||||||
|
return App::auth()->prefs()->get('interface')->get('colorsyntax') && '' != App::auth()->prefs()->get('interface')->get('colorsyntax_theme');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,11 @@ namespace Dotclear\Plugin\DotclearWatch;
|
||||||
use Dotclear\Core\Process;
|
use Dotclear\Core\Process;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DotclearWatch install class.
|
* @brief DotclearWatch install class.
|
||||||
* @ingroup DotclearWatch
|
* @ingroup DotclearWatch
|
||||||
*
|
*
|
||||||
* @author Jean-Christian Denis
|
* @author Jean-Christian Denis
|
||||||
|
* @copyright Jean-Christian Denis
|
||||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*/
|
*/
|
||||||
class Install extends Process
|
class Install extends Process
|
||||||
|
@ -22,8 +23,8 @@ class Install extends Process
|
||||||
|
|
||||||
public static function process(): bool
|
public static function process(): bool
|
||||||
{
|
{
|
||||||
if (self::status()) {
|
if (self::status() && ($s = My::settings()) !== null) {
|
||||||
My::settings()->put(
|
$s->put(
|
||||||
'hidden_modules',
|
'hidden_modules',
|
||||||
'DotclearWatch',
|
'DotclearWatch',
|
||||||
'string',
|
'string',
|
||||||
|
@ -31,7 +32,7 @@ class Install extends Process
|
||||||
false,
|
false,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
My::settings()->put(
|
$s->put(
|
||||||
'distant_api_url',
|
'distant_api_url',
|
||||||
'https://dotclear.watch/api',
|
'https://dotclear.watch/api',
|
||||||
'string',
|
'string',
|
||||||
|
|
|
@ -7,10 +7,11 @@ namespace Dotclear\Plugin\DotclearWatch;
|
||||||
use Dotclear\Module\MyPlugin;
|
use Dotclear\Module\MyPlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DotclearWatch My helper.
|
* @brief DotclearWatch My helper.
|
||||||
* @ingroup DotclearWatch
|
* @ingroup DotclearWatch
|
||||||
*
|
*
|
||||||
* @author Jean-Christian Denis
|
* @author Jean-Christian Denis
|
||||||
|
* @copyright Jean-Christian Denis
|
||||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*/
|
*/
|
||||||
class My extends MyPlugin
|
class My extends MyPlugin
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Dotclear\Plugin\DotclearWatch;
|
|
||||||
|
|
||||||
use Dotclear\Core\Process;
|
|
||||||
use Dotclear\Plugin\Uninstaller\Uninstaller;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief DotclearWatch uninstall class.
|
|
||||||
* @ingroup DotclearWatch
|
|
||||||
*
|
|
||||||
* @author Jean-Christian Denis
|
|
||||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
||||||
*/
|
|
||||||
class Uninstall extends Process
|
|
||||||
{
|
|
||||||
public static function init(): bool
|
|
||||||
{
|
|
||||||
return self::status(My::checkContext(My::UNINSTALL));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function process(): bool
|
|
||||||
{
|
|
||||||
if (!self::status()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Uninstaller::instance()
|
|
||||||
->addUserAction(
|
|
||||||
'settings',
|
|
||||||
'delete_all',
|
|
||||||
My::id()
|
|
||||||
)
|
|
||||||
->addUserAction(
|
|
||||||
'plugins',
|
|
||||||
'delete',
|
|
||||||
My::id()
|
|
||||||
)
|
|
||||||
->addUserAction(
|
|
||||||
'versions',
|
|
||||||
'delete',
|
|
||||||
My::id()
|
|
||||||
)
|
|
||||||
->addDirectAction(
|
|
||||||
'settings',
|
|
||||||
'delete_all',
|
|
||||||
My::id()
|
|
||||||
)
|
|
||||||
->addDirectAction(
|
|
||||||
'plugins',
|
|
||||||
'delete',
|
|
||||||
My::id()
|
|
||||||
)
|
|
||||||
->addDirectAction(
|
|
||||||
'versions',
|
|
||||||
'delete',
|
|
||||||
My::id()
|
|
||||||
)
|
|
||||||
;
|
|
||||||
|
|
||||||
// no custom action
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -11,10 +11,11 @@ use Dotclear\Module\ModuleDefine;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DotclearWatch utils class.
|
* @brief DotclearWatch utils class.
|
||||||
* @ingroup DotclearWatch
|
* @ingroup DotclearWatch
|
||||||
*
|
*
|
||||||
* @author Jean-Christian Denis
|
* @author Jean-Christian Denis
|
||||||
|
* @copyright Jean-Christian Denis
|
||||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*/
|
*/
|
||||||
class Utils
|
class Utils
|
||||||
|
@ -255,21 +256,11 @@ class Utils
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if report can be done.
|
|
||||||
*
|
|
||||||
* @return bool True if it can
|
|
||||||
*/
|
|
||||||
private static function check(): bool
|
private static function check(): bool
|
||||||
{
|
{
|
||||||
return true; // not yet
|
return true; // not yet
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get report key.
|
|
||||||
*
|
|
||||||
* @return string The report key
|
|
||||||
*/
|
|
||||||
private static function key(): string
|
private static function key(): string
|
||||||
{
|
{
|
||||||
return Crypt::hmac(self::uid() . My::id(), App::config()->cryptAlgo());
|
return Crypt::hmac(self::uid() . My::id(), App::config()->cryptAlgo());
|
||||||
|
@ -288,21 +279,11 @@ class Utils
|
||||||
return self::$uid;
|
return self::$uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get blog report uid.
|
|
||||||
*
|
|
||||||
* @return string The blog report uid
|
|
||||||
*/
|
|
||||||
private static function buid(): string
|
private static function buid(): string
|
||||||
{
|
{
|
||||||
return md5(self::uid() . App::blog()->uid());
|
return md5(self::uid() . App::blog()->uid());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get query URL.
|
|
||||||
*
|
|
||||||
* @return string The URL
|
|
||||||
*/
|
|
||||||
private static function url(): string
|
private static function url(): string
|
||||||
{
|
{
|
||||||
$api_url = My::settings()->getGlobal('distant_api_url');
|
$api_url = My::settings()->getGlobal('distant_api_url');
|
||||||
|
@ -310,9 +291,6 @@ class Utils
|
||||||
return (is_string($api_url) ? $api_url : self::DISTANT_API_URL) . '/' . self::DISTANT_API_VERSION . '/%s/' . self::uid();
|
return (is_string($api_url) ? $api_url : self::DISTANT_API_URL) . '/' . self::DISTANT_API_VERSION . '/%s/' . self::uid();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear report logs.
|
|
||||||
*/
|
|
||||||
private static function clear(): void
|
private static function clear(): void
|
||||||
{
|
{
|
||||||
$rs = App::log()->getLogs([
|
$rs = App::log()->getLogs([
|
||||||
|
@ -333,9 +311,6 @@ class Utils
|
||||||
App::log()->delLogs($logs);
|
App::log()->delLogs($logs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Log error.
|
|
||||||
*/
|
|
||||||
private static function error(string $message): void
|
private static function error(string $message): void
|
||||||
{
|
{
|
||||||
self::clear();
|
self::clear();
|
||||||
|
@ -347,9 +322,6 @@ class Utils
|
||||||
App::log()->addLog($cur);
|
App::log()->addLog($cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Write report.
|
|
||||||
*/
|
|
||||||
private static function write(string $contents): void
|
private static function write(string $contents): void
|
||||||
{
|
{
|
||||||
self::clear();
|
self::clear();
|
||||||
|
@ -361,11 +333,6 @@ class Utils
|
||||||
App::log()->addLog($cur);
|
App::log()->addLog($cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if report is expired.
|
|
||||||
*
|
|
||||||
* @return bool True if expired
|
|
||||||
*/
|
|
||||||
private static function expired(): bool
|
private static function expired(): bool
|
||||||
{
|
{
|
||||||
$rs = App::log()->getLogs([
|
$rs = App::log()->getLogs([
|
||||||
|
@ -375,11 +342,6 @@ class Utils
|
||||||
return $rs->isEmpty() || !is_string($rs->f('log_dt')) || (int) strtotime($rs->f('log_dt')) + self::EXPIRED_DELAY < time();
|
return $rs->isEmpty() || !is_string($rs->f('log_dt')) || (int) strtotime($rs->f('log_dt')) + self::EXPIRED_DELAY < time();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get report content.
|
|
||||||
*
|
|
||||||
* @return string Teh report content
|
|
||||||
*/
|
|
||||||
private static function contents(): string
|
private static function contents(): string
|
||||||
{
|
{
|
||||||
// Build json response
|
// Build json response
|
||||||
|
@ -401,8 +363,7 @@ class Utils
|
||||||
'server' => self::getServer(),
|
'server' => self::getServer(),
|
||||||
'php' => [
|
'php' => [
|
||||||
'sapi' => php_sapi_name() ?: 'php',
|
'sapi' => php_sapi_name() ?: 'php',
|
||||||
'version' => PHP_VERSION,
|
'version' => phpversion(),
|
||||||
'minor' => PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,
|
|
||||||
],
|
],
|
||||||
'system' => [
|
'system' => [
|
||||||
'name' => php_uname('s'),
|
'name' => php_uname('s'),
|
||||||
|
|
Loading…
Reference in New Issue