Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ in this document are to be interpreted as described in

## Requirements

* PHP: [![Minimum PHP Version](https://img.shields.io/badge/Minimum_PHP-7.4.x-blue.svg)](https://php.net/) [![Maximum PHP Version](https://img.shields.io/badge/Maximum_PHP-8.0.x-blue.svg)](https://php.net/)
* ILIAS: [![Minimum ILIAS Version](https://img.shields.io/badge/Minimum_ILIAS-8.x-orange.svg)](https://ilias.de/) [![Maximum ILIAS Version](https://img.shields.io/badge/Maximum_ILIAS-8.x-orange.svg)](https://ilias.de/)
* PHP: [![Minimum PHP Version](https://img.shields.io/badge/Minimum_PHP-8.2.x-blue.svg)](https://php.net/) [![Maximum PHP Version](https://img.shields.io/badge/Maximum_PHP-8.3.x-blue.svg)](https://php.net/)
* ILIAS: [![Minimum ILIAS Version](https://img.shields.io/badge/Minimum_ILIAS-11.x-orange.svg)](https://ilias.de/) [![Maximum ILIAS Version](https://img.shields.io/badge/Maximum_ILIAS-8.x-orange.svg)](https://ilias.de/)

## Installation

Expand All @@ -28,7 +28,7 @@ This plugin MUST be installed as a

The files MUST be saved in the following directory:

<ILIAS>/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/TestCronInterface
<ILIAS>/components/TestCronInterface

Correct file and folder permissions MUST be
ensured by the responsible system administrator.
Expand Down
43 changes: 43 additions & 0 deletions TestCronInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

namespace ILIAS;

class TestCronInterface implements Component\Component
{
public function init(
array | \ArrayAccess &$define,
array | \ArrayAccess &$implement,
array | \ArrayAccess &$use,
array | \ArrayAccess &$contribute,
array | \ArrayAccess &$seek,
array | \ArrayAccess &$provide,
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
$contribute[\ILIAS\Cron\CronJob::class] = static fn() =>
new Plugin\TestCronInterface\Cron\TestCronInterfaceJob(
self::class,
$use[\ILIAS\Language\Language::class],
$use[\ILIAS\Logging\LoggerFactory::class],
);

}
}
21 changes: 7 additions & 14 deletions classes/Cron/TestCronInterfaceJob.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?php

declare(strict_types=1);
/* Copyright (c) 1998-2021 ILIAS open source, Extended GPL, see docs/LICENSE */

declare(strict_types=1);

namespace ILIAS\Plugin\TestCronInterface\Cron;

use ilCronJob;
use ilCronJobResult;
use ilLogger;
use ilTestCronInterfacePlugin;
use ILIAS\Cron\Schedule\CronJobScheduleType;
use ILIAS\Language\Language;
use ILIAS\Logging\LoggerFactory;

/**
* Class TestCronInterfaceJob
Expand All @@ -18,16 +20,6 @@
*/
class TestCronInterfaceJob extends ilCronJob
{
private ilTestCronInterfacePlugin $plugin;
private ilLogger $logger;

public function __construct(ilTestCronInterfacePlugin $plugin, ilLogger $logger)
{
$this->plugin = $plugin;
$this->logger = $logger;
}


/**
* @inheritDoc
*/
Expand Down Expand Up @@ -97,13 +89,14 @@ public function isManuallyExecutable(): bool
*/
public function run(): ilCronJobResult
{
$this->logger->info('Started job');
$logger = $this->logger_factory::getRootLogger();
$logger->info('Started job');

$result = new ilCronJobResult();
$result->setStatus(ilCronJobResult::STATUS_OK);
$result->setMessage('Successfully finished job');

$this->logger->info($result->getMessage());
$logger->info($result->getMessage());

return $result;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"php": ">=8.1 <8.3"
"php": ">=8.2 <8.4"
},
"autoload": {
"psr-4" : { "ILIAS\\Plugin\\TestCronInterface\\" : "./classes" },
Expand Down
13 changes: 0 additions & 13 deletions plugin.php

This file was deleted.