update to Dotclear 2.28-dev
This commit is contained in:
parent
1a13ca2405
commit
332930aab9
8 changed files with 49 additions and 46 deletions
|
@ -1,3 +1,9 @@
|
|||
DotclearWatch 0.9 - 2023.10.07
|
||||
===========================================================
|
||||
* Require dotclear 2.28
|
||||
* Require php 8.1
|
||||
* Update to Dotclear 2.28-dev
|
||||
|
||||
DotclearWatch 0.8 - 2023.08.27
|
||||
===========================================================
|
||||
* Require dotclear 2.27
|
||||
|
|
10
README.md
10
README.md
|
@ -1,8 +1,8 @@
|
|||
# README
|
||||
|
||||
[![Release](https://img.shields.io/badge/release-0.8-a2cbe9.svg)](https://git.dotclear.watch/dw/DotclearWatch/releases)
|
||||
![Date](https://img.shields.io/badge/date-2023.08.27-c44d58.svg)]
|
||||
[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-137bbb.svg)](https://fr.dotclear.org/download)
|
||||
[![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.07-c44d58.svg)]
|
||||
[![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)
|
||||
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/dw/DotclearWatch/src/branch/master/LICENSE)
|
||||
|
||||
|
@ -30,8 +30,8 @@ in aboutConfig global parameters called DotclearWatch->hidden_modules
|
|||
## REQUIREMENTS
|
||||
|
||||
* super admin permission to intall it
|
||||
* Dotclear 2.27
|
||||
* PHP 7.4+
|
||||
* Dotclear 2.28
|
||||
* PHP 8.1+
|
||||
|
||||
## USAGE
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@ $this->registerModule(
|
|||
'Dotclear Watch',
|
||||
'Send report about your Dotclear',
|
||||
'Jean-Christian Denis and contributors',
|
||||
'0.8',
|
||||
'0.9',
|
||||
[
|
||||
'requires' => [
|
||||
['php', '7.4'],
|
||||
['core', '2.27'],
|
||||
['php', '8.1'],
|
||||
['core', '2.28'],
|
||||
],
|
||||
'type' => 'plugin',
|
||||
'support' => 'https://git.dotclear.watch/dw/' . basename(__DIR__) . '/issues',
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<modules xmlns:da="http://dotaddict.org/da/">
|
||||
<module id="DotclearWatch">
|
||||
<name>Dotclear Watch</name>
|
||||
<version>0.8</version>
|
||||
<version>0.9</version>
|
||||
<author>Jean-Christian Denis and contributors</author>
|
||||
<desc>Send report about your Dotclear</desc>
|
||||
<file>https://git.dotclear.watch/dw/DotclearWatch/releases/download/v0.8/plugin-DotclearWatch.zip</file>
|
||||
<da:dcmin>2.27</da:dcmin>
|
||||
<file>https://git.dotclear.watch/dw/DotclearWatch/releases/download/v0.9/plugin-DotclearWatch.zip</file>
|
||||
<da:dcmin>2.28</da:dcmin>
|
||||
<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>
|
||||
</module>
|
||||
|
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\DotclearWatch;
|
||||
|
||||
use dcCore;
|
||||
use Dotclear\App;
|
||||
use Dotclear\Core\Process;
|
||||
|
||||
class Backend extends Process
|
||||
|
@ -30,9 +30,9 @@ class Backend extends Process
|
|||
return false;
|
||||
}
|
||||
|
||||
dcCore::app()->addBehaviors([
|
||||
App::behavior()->addBehaviors([
|
||||
'adminDashboardHeaders' => function (): string {
|
||||
return My::jsLoad('service', dcCore::app()->getVersion(My::id()));
|
||||
return My::jsLoad('service', App::version()->getVersion(My::id()));
|
||||
},
|
||||
'adminPageFooterV2' => function (): void {
|
||||
if (My::settings()->getGlobal('distant_api_url')) {
|
||||
|
@ -47,7 +47,7 @@ class Backend extends Process
|
|||
},
|
||||
]);
|
||||
|
||||
dcCore::app()->rest->addFunction(
|
||||
App::rest()->addFunction(
|
||||
'adminDotclearWatchSendReport',
|
||||
function (): array {
|
||||
Utils::sendReport();
|
||||
|
|
|
@ -12,7 +12,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\DotclearWatch;
|
||||
|
||||
use dcCore;
|
||||
use Dotclear\App;
|
||||
use Dotclear\Core\Backend\Notices;
|
||||
use Dotclear\Core\Backend\Page;
|
||||
use Dotclear\Core\Process;
|
||||
|
@ -47,7 +47,7 @@ class Config extends Process
|
|||
}
|
||||
|
||||
if (self::useColorSynthax()) {
|
||||
dcCore::app()->addBehavior('pluginsToolsHeadersV2', fn (bool $plugin): string => Page::jsLoadCodeMirror(dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax_theme')));
|
||||
App::behavior()->addBehavior('pluginsToolsHeadersV2', fn (bool $plugin): string => Page::jsLoadCodeMirror(App::auth()->prefs()->get('interface')->get('colorsyntax_theme')));
|
||||
}
|
||||
|
||||
self::$hidden_modules = (string) My::settings()->getGlobal('hidden_modules');
|
||||
|
@ -86,7 +86,7 @@ class Config extends Process
|
|||
}
|
||||
}
|
||||
|
||||
dcCore::app()->admin->url->redirect('admin.plugins', ['module' => My::id(), 'conf' => '1']);
|
||||
App::backend()->url->redirect('admin.plugins', ['module' => My::id(), 'conf' => '1']);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -139,13 +139,13 @@ class Config extends Process
|
|||
])->render() .
|
||||
(
|
||||
self::useColorSynthax() ?
|
||||
Page::jsRunCodeMirror(My::id() . 'editor', 'report_contents', 'json', dcCore::app()->auth->user_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 dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax') && '' != dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax_theme');
|
||||
return App::auth()->prefs()->get('interface')->get('colorsyntax') && '' != App::auth()->prefs()->get('interface')->get('colorsyntax_theme');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\DotclearWatch;
|
||||
|
||||
use dcCore;
|
||||
use Dotclear\App;
|
||||
use Dotclear\Module\MyPlugin;
|
||||
|
||||
class My extends MyPlugin
|
||||
|
@ -22,6 +22,6 @@ class My extends MyPlugin
|
|||
protected static function checkCustomContext(int $context): ?bool
|
||||
{
|
||||
return $context === My::INSTALL ? null :
|
||||
defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->isSuperAdmin();
|
||||
defined('DC_CONTEXT_ADMIN') && App::auth()->isSuperAdmin();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,12 +14,10 @@ declare(strict_types=1);
|
|||
|
||||
namespace Dotclear\Plugin\DotclearWatch;
|
||||
|
||||
use dcCore;
|
||||
use dcLog;
|
||||
use dcModuleDefine;
|
||||
use dcThemes;
|
||||
use Dotclear\App;
|
||||
use Dotclear\Helper\Crypt;
|
||||
use Dotclear\Helper\Network\HttpClient;
|
||||
use Dotclear\Module\ModuleDefine;
|
||||
use Exception;
|
||||
|
||||
class Utils
|
||||
|
@ -71,7 +69,7 @@ class Utils
|
|||
{
|
||||
$modules = [];
|
||||
$hiddens = self::getHiddens();
|
||||
$defines = dcCore::app()->plugins->getDefines($strict ? ['state' => dcModuleDefine::STATE_ENABLED] : []);
|
||||
$defines = App::plugins()->getDefines($strict ? ['state' => ModuleDefine::STATE_ENABLED] : []);
|
||||
foreach ($defines as $define) {
|
||||
if ($strict && in_array($define->getId(), $hiddens)) {
|
||||
continue;
|
||||
|
@ -91,14 +89,13 @@ class Utils
|
|||
*/
|
||||
public static function getThemes(bool $strict = true): array
|
||||
{
|
||||
if (!(dcCore::app()->themes instanceof dcThemes)) {
|
||||
dcCore::app()->themes = new dcThemes();
|
||||
dcCore::app()->themes->loadModules(dcCore::app()->blog->themes_path);
|
||||
if (App::themes()->isEmpty()) {
|
||||
App::themes()->loadModules(App::blog()->themesPath());
|
||||
}
|
||||
|
||||
$modules = [];
|
||||
$hiddens = self::getHiddens();
|
||||
$defines = dcCore::app()->themes->getDefines($strict ? ['state' => dcModuleDefine::STATE_ENABLED] : []);
|
||||
$defines = App::themes()->getDefines($strict ? ['state' => ModuleDefine::STATE_ENABLED] : []);
|
||||
foreach ($defines as $define) {
|
||||
if ($strict && in_array($define->getId(), $hiddens)) {
|
||||
continue;
|
||||
|
@ -157,7 +154,7 @@ class Utils
|
|||
*/
|
||||
public static function getError(): string
|
||||
{
|
||||
$rs = dcCore::app()->log->getLogs([
|
||||
App::log()->getLogs([
|
||||
'log_table' => My::id() . '_error',
|
||||
]);
|
||||
|
||||
|
@ -266,7 +263,7 @@ class Utils
|
|||
|
||||
private static function buid(): string
|
||||
{
|
||||
return md5(self::uid() . dcCore::app()->blog->uid);
|
||||
return md5(self::uid() . App::blog()->uid());
|
||||
}
|
||||
|
||||
private static function url(): string
|
||||
|
@ -278,7 +275,7 @@ class Utils
|
|||
|
||||
private static function clear(): void
|
||||
{
|
||||
$rs = dcCore::app()->log->getLogs([
|
||||
App::log()->getLogs([
|
||||
'log_table' => [
|
||||
My::id() . '_report',
|
||||
My::id() . '_error',
|
||||
|
@ -293,34 +290,34 @@ class Utils
|
|||
while ($rs->fetch()) {
|
||||
$logs[] = (int) $rs->f('log_id');
|
||||
}
|
||||
dcCore::app()->log->delLogs($logs);
|
||||
App::log()->delLogs($logs);
|
||||
}
|
||||
|
||||
private static function error(string $message): void
|
||||
{
|
||||
self::clear();
|
||||
|
||||
$cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcLog::LOG_TABLE_NAME);
|
||||
$cur = App::log()->openLogCursor();
|
||||
$cur->setField('log_table', My::id() . '_error');
|
||||
$cur->setField('log_msg', $message);
|
||||
|
||||
dcCore::app()->log->addLog($cur);
|
||||
App::log()->addLog($cur);
|
||||
}
|
||||
|
||||
private static function write(string $contents): void
|
||||
{
|
||||
self::clear();
|
||||
|
||||
$cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcLog::LOG_TABLE_NAME);
|
||||
$cur = App::log()->openLogCursor();
|
||||
$cur->setField('log_table', My::id() . '_report');
|
||||
$cur->setField('log_msg', $contents);
|
||||
|
||||
dcCore::app()->log->addLog($cur);
|
||||
App::log()->addLog($cur);
|
||||
}
|
||||
|
||||
private static function read(): string
|
||||
{
|
||||
$rs = dcCore::app()->log->getLogs([
|
||||
App::log()->getLogs([
|
||||
'log_table' => My::id() . '_report',
|
||||
]);
|
||||
|
||||
|
@ -329,7 +326,7 @@ class Utils
|
|||
|
||||
private static function expired(): bool
|
||||
{
|
||||
$rs = dcCore::app()->log->getLogs([
|
||||
App::log()->getLogs([
|
||||
'log_table' => My::id() . '_report',
|
||||
]);
|
||||
|
||||
|
@ -345,11 +342,11 @@ class Utils
|
|||
'plugins' => self::getPlugins(), // enabled plugins
|
||||
'themes' => self::getThemes(), // enabled themes
|
||||
'blog' => [
|
||||
'lang' => (string) dcCore::app()->blog->settings->get('system')->get('lang'),
|
||||
'theme' => (string) dcCore::app()->blog->settings->get('system')->get('theme'),
|
||||
'lang' => (string) App::blog()->settings()->get('system')->get('lang'),
|
||||
'theme' => (string) App::blog()->settings()->get('system')->get('theme'),
|
||||
],
|
||||
'blogs' => [
|
||||
'count' => (int) dcCore::app()->getBlogs([], true)->f(0),
|
||||
'count' => (int) App::blogs()->getBlogs([], true)->f(0),
|
||||
],
|
||||
'core' => [
|
||||
'version' => DC_VERSION,
|
||||
|
@ -364,8 +361,8 @@ class Utils
|
|||
'version' => php_uname('r'),
|
||||
],
|
||||
'database' => [
|
||||
'driver' => dcCore::app()->con->driver(),
|
||||
'version' => dcCore::app()->con->version(),
|
||||
'driver' => App::con()->driver(),
|
||||
'version' => App::con()->version(),
|
||||
],
|
||||
], JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue