Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5] add2scheduler-updatenotification #40788

Merged
merged 89 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
44f832c
updnft2task
alikon Jun 18, 2023
2ff3e4f
better name
alikon Jun 18, 2023
88fe7c4
Update administrator/components/com_admin/script.php
alikon Jun 18, 2023
8f4fcda
Update administrator/components/com_admin/script.php
alikon Jun 18, 2023
73da95a
cache_timeout
alikon Jun 19, 2023
fcb1192
lastrun
alikon Jun 21, 2023
1942166
cs
alikon Jun 21, 2023
4552456
Merge branch '5.0-dev' into updatenotfication2task
alikon Jun 21, 2023
370afe9
Merge branch '5.0-dev' into updatenotfication2task
alikon Jun 23, 2023
da7a409
Merge branch '5.0-dev' into updatenotfication2task
alikon Jun 25, 2023
7b7c047
Update administrator/components/com_admin/script.php
alikon Jun 25, 2023
196808d
Update installation/sql/mysql/base.sql
alikon Jun 25, 2023
083e8d5
Update installation/sql/postgresql/base.sql
alikon Jun 25, 2023
3fe4435
Update administrator/components/com_admin/script.php
alikon Jun 25, 2023
17a733e
Update administrator/components/com_admin/script.php
alikon Jun 25, 2023
9e8fe79
Update plugins/task/updatenotification/src/Extension/UpdateNotificati…
alikon Jun 25, 2023
632354a
Update plugins/task/updatenotification/src/Extension/UpdateNotificati…
alikon Jun 25, 2023
63ff70f
Update plugins/task/updatenotification/src/Extension/UpdateNotificati…
alikon Jun 25, 2023
8794b73
Merge branch '5.0-dev' into updatenotfication2task
alikon Jun 26, 2023
301a079
Merge branch '5.0-dev' into updatenotfication2task
alikon Jun 26, 2023
a6a88d8
delete system plugin
alikon Jun 26, 2023
db3e4e8
settingson install
alikon Jun 30, 2023
526f839
bettersyntax
alikon Jul 1, 2023
213efe2
Merge remote-tracking branch 'upstream/5.0-dev' into updatenotficatio…
richard67 Jul 2, 2023
dfcc617
Merge branch '5.0-dev' into updatenotfication2task
alikon Jul 3, 2023
eafd89a
hardcode-nestedset
alikon Jul 3, 2023
8bfc527
hardcode-nestedset
alikon Jul 3, 2023
21305b9
grr
alikon Jul 3, 2023
11c3136
hardcode-nestedset
alikon Jul 3, 2023
c3ff33a
hardcode-nestedset
alikon Jul 3, 2023
4a1ca8d
prefix
alikon Jul 3, 2023
a5c710d
fix pgsql
alikon Jul 4, 2023
7003f72
Merge branch '5.0-dev' into updatenotfication2task
alikon Jul 4, 2023
be5bbe4
Rename 5.0.0-2023-06-18.sql to 5.0.0-2023-08-04.sql
alikon Aug 1, 2023
f6a8a28
Rename 5.0.0-2023-06-18.sql to 5.0.0-2023-08-04.sql
alikon Aug 1, 2023
94c0090
Merge branch '5.0-dev' into updatenotfication2task
alikon Aug 1, 2023
523f494
Merge branch '5.0-dev' into updatenotfication2task
richard67 Aug 6, 2023
c9b795b
Update administrator/language/en-GB/plg_task_updatenotification.ini
alikon Aug 6, 2023
c5740a4
Update administrator/components/com_admin/script.php
alikon Aug 7, 2023
cb76cc4
Update administrator/language/en-GB/plg_task_updatenotification.ini
alikon Aug 7, 2023
8ad5ac3
Update plugins/task/updatenotification/services/provider.php
alikon Aug 7, 2023
5269e50
Update plugins/task/updatenotification/forms/sendForm.xml
alikon Aug 7, 2023
737e8b9
Update administrator/language/en-GB/plg_task_updatenotification.ini
alikon Aug 7, 2023
2500b2e
remove old language files
heelc29 Aug 7, 2023
4ba9f45
add mail template for new installations
heelc29 Aug 7, 2023
c67b05a
remove postinstall message
heelc29 Aug 7, 2023
43dfb68
alphasort
heelc29 Aug 7, 2023
35e486b
upper case
heelc29 Aug 7, 2023
485cd0e
class Text not imported
heelc29 Aug 7, 2023
09610f2
Merge pull request #24 from heelc29/5.0/40788-updatenotfication
alikon Aug 7, 2023
ed00600
feedback from session gc
alikon Aug 10, 2023
a5f9c11
remove old mail template on update
heelc29 Aug 11, 2023
354a74b
set created_by for new task
heelc29 Aug 11, 2023
9a51eca
cs
heelc29 Aug 11, 2023
02f0e49
Merge pull request #25 from heelc29/5.0/40788-updatenotfication
alikon Aug 12, 2023
b22576b
Merge branch '5.0-dev' into updatenotfication2task
alikon Aug 12, 2023
58dd800
exec-day
alikon Aug 12, 2023
682e7e2
Update administrator/components/com_admin/script.php
alikon Aug 13, 2023
e827a79
Merge branch '5.0-dev' into updatenotfication2task
richard67 Aug 25, 2023
ee577d7
Merge branch '5.0-dev' into updatenotfication2task
alikon Aug 26, 2023
6f4a333
Rename 5.0.0-2023-08-04.sql to 5.0.0-2023-08-24.sql
alikon Aug 26, 2023
553b06b
Rename 5.0.0-2023-08-04.sql to 5.0.0-2023-08-24.sql
alikon Aug 26, 2023
a629736
Merge branch '5.0-dev' into updatenotfication2task
richard67 Aug 26, 2023
b723e80
Merge branch '5.0-dev' into updatenotfication2task
alikon Aug 27, 2023
77de9e6
Merge branch '5.0-dev' into updatenotfication2task
alikon Aug 28, 2023
0313d90
Rename 5.0.0-2023-08-24.sql to 5.0.0-2023-08-30.sql
richard67 Sep 1, 2023
45d8cbe
Rename 5.0.0-2023-08-24.sql to 5.0.0-2023-08-30.sql
richard67 Sep 1, 2023
e92099f
Merge branch '5.0-dev' into updatenotfication2task
richard67 Sep 1, 2023
7ab7fcf
SQL CS
richard67 Sep 1, 2023
ee9c042
SQL CS
richard67 Sep 1, 2023
6458a2e
Fix plugin name in email body
richard67 Sep 1, 2023
c6f1cd8
Single quotes
richard67 Sep 2, 2023
825bd90
Revert text function for plugins
richard67 Sep 2, 2023
06c11a7
Remove extra reference assignment for dispatcher argument
richard67 Sep 2, 2023
122813e
Set last and next execution and locked of task on new installation
richard67 Sep 2, 2023
27ba35c
SQL CS
richard67 Sep 2, 2023
e8d3476
Task should be enabled on a new installation
richard67 Sep 2, 2023
dd8d54c
Make sure to have UTC timestamps on PostgreSQL
richard67 Sep 2, 2023
94fde83
Rename 5.0.0-2023-08-30.sql to 5.0.0-2023-09-02.sql
richard67 Sep 2, 2023
b9d1794
Rename 5.0.0-2023-08-30.sql to 5.0.0-2023-09-02.sql
richard67 Sep 2, 2023
ba35fad
Merge branch '5.0-dev' into updatenotfication2task
richard67 Sep 2, 2023
ffdce58
Merge branch '5.0-dev' into updatenotfication2task
richard67 Sep 2, 2023
82087e2
Merge branch '5.0-dev' into updatenotfication2task
richard67 Sep 2, 2023
67a603e
Merge branch '5.0-dev' into updatenotfication2task
richard67 Sep 2, 2023
1d873fa
Merge branch '5.0-dev' into updatenotfication2task
richard67 Sep 2, 2023
0e850b8
Merge branch '5.0-dev' into updatenotfication2task
richard67 Sep 3, 2023
858f4d3
Fix lastrun default on update
richard67 Sep 3, 2023
9a0d63f
Add parameters to SQL insert of task
richard67 Sep 3, 2023
bd2ddd7
Merge branch 'updatenotfication2task' of https://github.com/alikon/jo…
richard67 Sep 3, 2023
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
40 changes: 40 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Joomla\CMS\Log\Log;
use Joomla\CMS\Table\Table;
use Joomla\Database\ParameterType;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -229,6 +230,7 @@ protected function uninstallExtensions()
* 'pre_function' => Name of an optional migration function to be called before
* uninstalling, `null` if not used.
*/
['type' => 'plugin', 'element' => 'updatenotification', 'folder' => 'system', 'client_id' => 0, 'pre_function' => 'migrate'],
alikon marked this conversation as resolved.
Show resolved Hide resolved
];

$db = Factory::getDbo();
Expand Down Expand Up @@ -281,6 +283,44 @@ protected function uninstallExtensions()
}
}

/**
* This method is just for testing.
*
* @param \stdClass $data Object with `extension_id` and `params` of the extension
alikon marked this conversation as resolved.
Show resolved Hide resolved
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
private function migrate($data)
{
if (!$data->enabled) {
return;
}

$params = new Registry($data->params);
/** @var SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);
$task = [
alikon marked this conversation as resolved.
Show resolved Hide resolved
'title' => 'UpdateNotification',
'type' => 'update.notification',
'execution_rules' => [
'rule-type' => 'interval-hours',
'interval-hours' => '24',
alikon marked this conversation as resolved.
Show resolved Hide resolved
'exec-time' => '08:26',
richard67 marked this conversation as resolved.
Show resolved Hide resolved
],
'state' => 1,
'params' => [
'email' => $params->get('email',''),
'language_override' => $params->get('language_override',''),
]
];
$model->save($task);
}

/**
* Update the manifest caches
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
('plg_task_updatenotification', 'plugin', 'updatenotification', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0);
INSERT INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES
('plg_task_updatenotification.mail', 'plg_task_updatenotification', '', 'PLG_TASK_UPDATENOTIFICATION_EMAIL_SUBJECT', 'PLG_TASK_UPDATENOTIFICATION_EMAIL_BODY', '', '', '{"tags":["newversion","curversion","sitename","url","link","releasenews"]}');
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
('plg_task_updatenotification', 'plugin', 'updatenotification', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0);
INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES
('plg_task_updatenotification.mail', 'plg_task_updatenotification', '', 'PLG_TASK_UPDATENOTIFICATION_EMAIL_SUBJECT', 'PLG_TASK_UPDATENOTIFICATION_EMAIL_BODY', '', '', '{"tags":["newversion","curversion","sitename","url","link","releasenews"]}');
19 changes: 19 additions & 0 deletions administrator/language/en-GB/plg_task_updatenotification.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
PLG_TASK_UPDATENOTIFICATION="Task - Joomla! Update Notification"
alikon marked this conversation as resolved.
Show resolved Hide resolved
PLG_TASK_UPDATENOTIFICATION_EMAIL_DESC="A comma separated list of the email addresses which will receive the update notification emails. The addresses in the list MUST belong to existing users of your site who have the Super User privilege. If none of the listed emails belongs to Super Users, or if it's left blank, all Super Users of this site will receive the update notification email."
PLG_TASK_UPDATENOTIFICATION_EMAIL_LBL="Super User Emails"
PLG_TASK_UPDATENOTIFICATION_SEND_TITLE="Joomla! Update Notification"
PLG_TASK_UPDATENOTIFICATION_SEND_DESC="This task periodically checks for the availability of new Joomla! versions. When one is found it will send you an email, reminding you to update. You can customise the email at System → Mail Templates."
PLG_TASK_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_DESC="Select a language for the update notification emails. Set to Auto to send them in the site language at the time."
PLG_TASK_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_LBL="Email Language"
PLG_TASK_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_NONE="Auto"
PLG_TASK_UPDATENOTIFICATION_EMAIL_BODY="This email IS NOT sent by the Joomla! project. It is sent automatically by your own site,\n{SITENAME} - {URL} \n\n================================================================================\nUPDATE INFORMATION\n================================================================================\n\nYour site has discovered that there is an updated version of Joomla! available for download.\n\nJoomla! version currently installed: {CURVERSION}\nJoomla! version available for installation: {NEWVERSION}\n\nThis email is sent to you by your site to remind you of this fact.\nThe Joomla! project will never contact you directly about available updates of Joomla! on your site.\n\n================================================================================\nUPDATE INSTRUCTIONS\n================================================================================\n\nTo install the update on {SITENAME} please select the following link. (If the URL is not a link, copy & paste it to your browser).\n\nUpdate link: {LINK}\n\nRelease News can be found here: {RELEASENEWS}\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by a plugin provided by Joomla!, the software which powers your site.\nThis plugin looks for updated versions of Joomla! and sends an email notification to its administrators.\nYou will receive several similar emails from your site until you either update the software or disable these emails.\n\nTo disable these emails, please unpublish the 'System - Joomla! Update Notification' plugin in the Plugin Manager on your site.\n\nIf you do not understand what Joomla! is and what you need to do please do not contact the Joomla! project.\nThey are NOT sending you this email and they cannot help you. Instead, please contact the person who built or manages your site.\n\nIf you are the person who built or manages your website, please note that this plugin may have been activated automatically when you installed or updated Joomla! on your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, {SITENAME}"
alikon marked this conversation as resolved.
Show resolved Hide resolved
; You can use the following merge codes:
; {NEWVERSION} New Joomla! version, e.g. 1.2.3
; {CURVERSION} Currently installed Joomla! version, e.g. 1.2.0
; {SITENAME} Site name, as set in Global Configuration.
; {URL} URL of the site's frontend page.
; {LINK} Update URL (link to com_joomlaupdate, will request login if the Super User isn't already logged in).
; {RELEASENEWS} URL to the release news on joomla.org
; \n Newline character. Use it to start a new line in the email.
PLG_TASK_UPDATENOTIFICATION_EMAIL_SUBJECT="Joomla! Update available for {SITENAME} – {URL}"
alikon marked this conversation as resolved.
Show resolved Hide resolved
PLG_TASK_UPDATENOTIFICATION_XML_DESCRIPTION="This task periodically checks for the availability of new Joomla! versions. When one is found it will send you an email, reminding you to update. You can customise the email at System → Mail Templates."
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; Joomla! Project
; (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8

PLG_TASK_UPDATENOTIFICATION="Task - Joomla! Update Notification"
PLG_TASK_UPDATENOTIFICATION_XML_DESCRIPTION="This task periodically checks for the availability of new Joomla! versions. When one is found it will send you an email, reminding you to update. You can customise the email at System &rarr; Mail Templates."
2 changes: 1 addition & 1 deletion installation/sql/mysql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,12 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`,
(0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, 1, '', '{}', '', 20, 0),
(0, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, 1, '', '', '', 21, 0),
(0, 'plg_system_tasknotification', 'plugin', 'tasknotification', 'system', 0, 1, 1, 0, 1, '', '', '', 22, 0),
(0, 'plg_system_updatenotification', 'plugin', 'updatenotification', 'system', 0, 1, 1, 0, 1, '', '', '', 23, 0),
(0, 'plg_system_webauthn', 'plugin', 'webauthn', 'system', 0, 1, 1, 0, 1, '', '{}', '', 24, 0),
(0, 'plg_task_checkfiles', 'plugin', 'checkfiles', 'task', 0, 1, 1, 0, 1, '', '{}', '', 1, 0),
(0, 'plg_task_demotasks', 'plugin', 'demotasks', 'task', 0, 1, 1, 0, 1, '', '{}', '', 2, 0),
(0, 'plg_task_requests', 'plugin', 'requests', 'task', 0, 1, 1, 0, 1, '', '{}', '', 3, 0),
(0, 'plg_task_sitestatus', 'plugin', 'sitestatus', 'task', 0, 1, 1, 0, 1, '', '{}', '', 4, 0),
(0, 'plg_task_updatenotification', 'plugin', 'updatenotification', 'task', 0, 1, 1, 0, 1, '', '{}', '', , 0),
alikon marked this conversation as resolved.
Show resolved Hide resolved
(0, 'plg_multifactorauth_totp', 'plugin', 'totp', 'multifactorauth', 0, 1, 1, 0, 1, '', '', '', 1, 0),
(0, 'plg_multifactorauth_yubikey', 'plugin', 'yubikey', 'multifactorauth', 0, 1, 1, 0, 1, '', '', '', 2, 0),
(0, 'plg_multifactorauth_webauthn', 'plugin', 'webauthn', 'multifactorauth', 0, 1, 1, 0, 1, '', '', '', 3, 0),
Expand Down
2 changes: 1 addition & 1 deletion installation/sql/postgresql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,12 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder",
(0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, 1, '', '{}', '', 20, 0),
(0, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, 1, '', '', '', 21, 0),
(0, 'plg_system_tasknotification', 'plugin', 'tasknotification', 'system', 0, 1, 1, 0, 1, '', '', '', 22, 0),
(0, 'plg_system_updatenotification', 'plugin', 'updatenotification', 'system', 0, 1, 1, 0, 1, '', '', '', 23, 0),
(0, 'plg_system_webauthn', 'plugin', 'webauthn', 'system', 0, 1, 1, 0, 1, '', '{}', '', 24, 0),
(0, 'plg_task_checkfiles', 'plugin', 'checkfiles', 'task', 0, 1, 1, 0, 1, '', '{}', '', 1, 0),
(0, 'plg_task_demotasks', 'plugin', 'demotasks', 'task', 0, 1, 1, 0, 1, '', '{}', '', 2, 0),
(0, 'plg_task_requests', 'plugin', 'requests', 'task', 0, 1, 1, 0, 1, '', '{}', '', 3, 0),
(0, 'plg_task_sitestatus', 'plugin', 'sitestatus', 'task', 0, 1, 1, 0, 1, '', '{}', '', 4, 0),
(0, 'plg_task_updatenotification', 'plugin', 'updatenotification', 'task', 0, 1, 1, 0, 1, '', '{}', '', , 0),
alikon marked this conversation as resolved.
Show resolved Hide resolved
(0, 'plg_multifactorauth_totp', 'plugin', 'totp', 'multifactorauth', 0, 1, 1, 0, 1, '', '', '', 1, 0),
(0, 'plg_multifactorauth_yubikey', 'plugin', 'yubikey', 'multifactorauth', 0, 1, 1, 0, 1, '', '', '', 2, 0),
(0, 'plg_multifactorauth_webauthn', 'plugin', 'webauthn', 'multifactorauth', 0, 1, 1, 0, 1, '', '', '', 3, 0),
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Extension/ExtensionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@ class ExtensionHelper
['plugin', 'skipto', 'system', 0],
['plugin', 'stats', 'system', 0],
['plugin', 'tasknotification', 'system', 0],
['plugin', 'updatenotification', 'system', 0],
['plugin', 'webauthn', 'system', 0],

// Core plugin extensions - task scheduler
['plugin', 'checkfiles', 'task', 0],
['plugin', 'demotasks', 'task', 0],
['plugin', 'requests', 'task', 0],
['plugin', 'sitestatus', 'task', 0],
['plugin', 'updatenotification', 'task', 0],

// Core plugin extensions - user
['plugin', 'contactcreator', 'user', 0],
Expand Down
24 changes: 24 additions & 0 deletions plugins/task/updatenotification/forms/sendForm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fields name="params">
<fieldset name="task_params">
<field
name="email"
type="text"
label="PLG_TASK_UPDATENOTIFICATION_EMAIL_LBL"
description="PLG_TASK_UPDATENOTIFICATION_EMAIL_DESC"
default=""
/>
<field
name="language_override"
type="language"
label="PLG_TASK_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_LBL"
description="PLG_TASK_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_DESC"
default=""
client="administrator"
>
<option value="">PLG_TASK_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_NONE</option>
</field>
alikon marked this conversation as resolved.
Show resolved Hide resolved
</fieldset>
</fields>
</form>
50 changes: 50 additions & 0 deletions plugins/task/updatenotification/services/provider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

/**
* @package Joomla.Plugin
* @subpackage Task.updatenotification
*
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Task\UpdateNotification\Extension\UpdateNotification;

return new class () implements ServiceProviderInterface {
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function register(Container $container)
alikon marked this conversation as resolved.
Show resolved Hide resolved
{
$container->set(
PluginInterface::class,
function (Container $container) {
$dispatcher = $container->get(DispatcherInterface::class);

$plugin = new UpdateNotification(
$dispatcher,
(array) PluginHelper::getPlugin('task', 'updatenotification')
richard67 marked this conversation as resolved.
Show resolved Hide resolved
);
$plugin->setApplication(Factory::getApplication());
$plugin->setDatabase($container->get(DatabaseInterface::class));

return $plugin;
}
);
}
};
Loading