Skip to content
Code-Schnipsel Gruppen Projekte
Commit ef9159eb erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'main' into 'next-3.x'

Update 'next-3.x' with latest changes from 'main'

See merge request !22
Übergeordnete 3b8cfee0 54d21d18
No related branches found
No related tags found
1 Merge Request!22Update 'next-3.x' with latest changes from 'main'
Pipeline #14550 bestanden mit Phase
in 2 Minuten und 37 Sekunden
include:
- project: 'quiqqer/stabilization/semantic-release'
file: '/ci-templates/.gitlab-ci.yml'
- component: dev.quiqqer.com/quiqqer/stabilization/ci-cd-components/quiqqer-package-bundle/quiqqer-package-bundle@2
# Remove the entire phpunit-php8.1 block, to allow PHPUnit to run on PHP 8.1 in your pipeline
phpunit-php8.1:
rules:
- when: never
# Remove the entire phpunit-php8.2 block, to allow PHPUnit to run on PHP 8.2 in your pipeline
phpunit-php8.2:
rules:
- when: never
# Remove the entire phpunit-php8.3 block, to allow PHPUnit to run on PHP 8.3 in your pipeline
phpunit-php8.3:
rules:
- when: never
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="^1.10.67" installed="1.10.67" location="./tools/phpstan" copy="false"/>
<phar name="phpstan" version="1.11.8" installed="1.11.8" location="./tools/phpstan" copy="false"/>
<phar name="phpunit" version="^10.5.20" installed="10.5.20" location="./tools/phpunit" copy="false"/>
<phar name="phpcs" version="^3.9.2" installed="3.9.2" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.9.2" installed="3.9.2" location="./tools/phpcbf" copy="false"/>
<phar name="captainhook" version="^5.23.0" installed="5.23.0" location="./tools/captainhook" copy="false"/>
<phar name="captainhook" version="^5.23.3" installed="5.23.3" location="./tools/captainhook" copy="false"/>
</phive>
......@@ -18,8 +18,6 @@ QUI::$Ajax->registerFunction(
$params = json_decode($params, true);
$Manager = new QUI\Cron\Manager();
$Manager->add($cron, $min, $hour, $day, $month, $dayOfWeek, $params);
},
['cron', 'min', 'hour', 'day', 'month', 'dayOfWeek', 'params'],
......
......@@ -12,7 +12,7 @@ QUI::$Ajax->registerFunction(
'package_quiqqer_cron_ajax_cron_toggle',
function ($cronId) {
$Manager = new QUI\Cron\Manager();
$data = $Manager->getCronById($cronId);
$data = $Manager->getCronById($cronId);
if (!$data) {
throw new QUI\Exception('Cron not exists', 404);
......
......@@ -9,7 +9,7 @@
QUI::$Ajax->registerFunction(
'package_quiqqer_cron_ajax_delete',
function ($ids) {
$ids = json_decode($ids, true);
$ids = json_decode($ids, true);
$Manager = new QUI\Cron\Manager();
$Manager->deleteCronIds($ids);
......
......@@ -14,6 +14,13 @@ QUI::$Ajax->registerFunction(
return;
}
// not execute at the first log in
if (QUI::getPackage('quiqqer/cron')->getConfig()->get('update', 'logged_in_before') === false) {
QUI::getPackage('quiqqer/cron')->getConfig()->set('update', 'logged_in_before', 1);
QUI::getPackage('quiqqer/cron')->getConfig()->save();
return;
}
try {
$Manager = new QUI\Cron\Manager();
$Manager->execute();
......
......@@ -13,8 +13,8 @@ QUI::$Ajax->registerFunction(
$list = $CronManager->getList();
$Locale = QUI::getLocale();
$Formatter = $Locale->getDateFormatter(
\IntlDateFormatter::SHORT,
\IntlDateFormatter::SHORT
IntlDateFormatter::SHORT,
IntlDateFormatter::SHORT
);
foreach ($list as $key => $cron) {
......@@ -23,7 +23,11 @@ QUI::$Ajax->registerFunction(
$list[$key]['title'] = $Locale->get($locale[0], $locale[1]);
}
$list[$key]['lastexec'] = $Formatter->format(\strtotime($list[$key]['lastexec']));
if (!empty($list[$key]['lastexec'])) {
$list[$key]['lastexec'] = $Formatter->format(strtotime($list[$key]['lastexec']));
} else {
$list[$key]['lastexec'] = '';
}
}
return $list;
......
......@@ -11,11 +11,11 @@ QUI::$Ajax->registerFunction(
'package_quiqqer_cron_ajax_history_get',
function ($params) {
$CronManager = new QUI\Cron\Manager();
$params = json_decode($params, true);
$params = json_decode($params, true);
return [
'page' => (int)$params['page'],
'data' => $CronManager->getHistoryList($params),
'page' => (int)$params['page'],
'data' => $CronManager->getHistoryList($params),
'total' => $CronManager->getHistoryCount()
];
},
......
window.addEvent('quiqqerLoaded', function() {
require(['Ajax', 'Locale'], function(QUIAjax, QUILocale) {
const RunningInfo = new Element('div', {
html: '' +
'<span style="padding-right: 10px; font-size: 20px">' +
' <span class="fa fa-circle-o-notch fa-spin"></span>' +
'</span>' +
'<span>' + QUILocale.get('quiqqer/cron', 'message.admin.cron.execution') + '</span>',
styles: {
background: '#fff',
bottom: 20,
boxShadow: 'rgba(35, 46, 60, .04) 0 2px 4px 0',
border: '1px solid rgba(101, 109, 119, .16)',
borderLeft: '.25rem solid #4299e1',
borderRadius: 4,
display: 'flex',
maxWidth: '90%',
padding: 20,
position: 'fixed',
right: 20,
width: 500,
zIndex: 10000
}
}).inject(document.body);
QUIAjax.post('package_quiqqer_cron_ajax_execute', function() {
moofx(RunningInfo).animate({
bottom: 10,
opacity: 0
}, {
callback: () => {
RunningInfo.destroy();
}
});
}, {
'package': 'quiqqer/cron'
});
});
});
{
"config": {
"bootstrap": "tests/captainhook-bootstrap.php"
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting"
},
{
"action": "composer test"
}
]
}
}
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting"
},
{
"action": "composer test"
}
]
}
}
\ No newline at end of file
......@@ -470,7 +470,7 @@
<de><![CDATA[Führt ein automatisches Security Update durch.]]></de>
<en><![CDATA[Performs an automatic security update.]]></en>
</locale>
</groups>
<groups name="quiqqer/cron" datatype="js">
<locale name="cron.id">
......@@ -913,6 +913,17 @@ This is realized with an external server on which QUIQQER systems can register t
<de><![CDATA[Nicht jetzt]]></de>
<en><![CDATA[Not yet]]></en>
</locale>
<locale name="message.admin.cron.execution">
<de><![CDATA[
Zurzeit wird eine geplante Systemaufgabe (Cron-Job) ausgeführt.
Dadurch können andere Aktionen wie Anfragen oder das Laden von Dateien etwas langsamer sein.
Bitte haben Sie ein wenig Geduld. Vielen Dank für Ihr Verständnis.
]]></de>
<en><![CDATA[
A scheduled system task (cron job) is currently being executed.
As a result, other actions such as requests or loading files may be somewhat slower.
Please be patient. Thank you for your understanding.
]]></en>
</locale>
</groups>
</locales>
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$cronId of method QUI\\\\Cron\\\\Console\\\\ExecCrons\\:\\:runCron\\(\\) expects bool\\|int, string given\\.$#"
count: 1
path: src/QUI/Cron/Console/ExecCrons.php
-
message: "#^Access to an undefined property DOMNode\\:\\:\\$tagName\\.$#"
count: 1
path: src/QUI/Cron/Manager.php
-
message: "#^PHPDoc tag @return with type QUI\\\\Cron\\\\Manager is not subtype of native type static\\(QUI\\\\Cron\\\\Manager\\)\\.$#"
count: 1
path: src/QUI/Cron/Manager.php
-
message: "#^Call to an undefined method QUI\\\\Projects\\\\Site\\:\\:deactivate\\(\\)\\.$#"
count: 1
path: src/QUI/Cron/QuiqqerCrons.php
......@@ -2,10 +2,16 @@ includes:
- phpstan-baseline.neon
parameters:
level: 1
level: 5
paths:
- src
- ajax
bootstrapFiles:
- tests/phpstan-bootstrap.php
customRulesetUsed: true
services:
-
class: \PHPStan\Rules\Properties\TypesAssignedToPropertiesRule
tags:
- phpstan.rules.rule
......@@ -135,21 +135,7 @@ class EventHandler
// execute cron ?
if ($Config->get('settings', 'executeOnAdminLogin')) {
echo '
<script>
window.addEvent("load", function()
{
require(["Ajax"], function(QUIAjax)
{
QUIAjax.post("package_quiqqer_cron_ajax_execute", function()
{
}, {
"package" : "quiqqer/cron"
});
});
});
</script>';
echo '<script src="' . URL_OPT_DIR . 'quiqqer/cron/bin/executeCronViaAdmin.js"></script>';
}
if (self::$cronWarning) {
......
<?php
// This file is supposed to be empty, see https://github.com/captainhookphp/captainhook/issues/248
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren