-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[5.4] Automated Core Update Client #45143
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
Merged
muhme
merged 176 commits into
joomla:5.4-dev
from
SniperSister:automated-updates/client
May 20, 2025
Merged
Changes from all commits
Commits
Show all changes
176 commits
Select commit
Hold shift + click to select a range
5ff9d13
Add extension class to joomlaupdater
bembelimen d73c89a
Allow components to change config form
bembelimen 4168ed1
Add extension class for joomlaupdater
bembelimen 6f72404
Add needed config fields for automated updates
bembelimen 0c30401
Add initial joomlaupdate webservice plugin
bembelimen 6f1fc7c
Implement healthcheck API
bembelimen 39d91f2
Move token check to header
bembelimen a8c8a3b
Update last health check date in extension table
bembelimen fe935e5
Implement token generation on config save
bembelimen 102f6a5
Add deploy version
bembelimen 5842280
Add joomlaupdate webservice plugin as core extension
bembelimen 24c7e06
Add missing comment
bembelimen e0685ec
Fix comment
bembelimen 63dc17e
Add type hint for model
bembelimen c3fca3e
Return error in health check when auto update is disabled
bembelimen 4674f23
Move primary method to top in health check
bembelimen c782085
Implement getUpdate webservice call
bembelimen 2a351f9
Make view call more generic
bembelimen 59786d3
Remove unused code
bembelimen 3183cfa
Rename parameter
bembelimen b3366c4
Update joomlaupdate config
bembelimen 4810a62
Reimplement token generation
bembelimen dd3374e
Take care of minimum stability
bembelimen 15079a2
Add restricter rule when auto updater is disabled
bembelimen b14e52e
Fix yntax error
bembelimen 3c54684
Update getUpdate to use core functionality
bembelimen 3755e78
Improve update disable information
bembelimen 83d77b2
Fix notice
bembelimen 2de0b41
Fix notice
bembelimen b25bba3
Correct ID
bembelimen e7f9938
Add prepareUpdate
bembelimen 427c9b3
Add update finalization
bembelimen 81158e4
Convert prepareUpdate and finalizeUpdate to POST
bembelimen a3f4f18
Fix code style
bembelimen 6841fb9
Code style fix
bembelimen 175423f
Implement update server registration.
1d04d45
Merge remote-tracking branch 'au/automated-updates/client' into autom…
344cce0
Update components/com_config/src/Service/Router.php
HLeithner 529178e
Update libraries/src/Version.php
HLeithner e43fc86
Update libraries/src/Updater/ConstraintChecker.php
HLeithner dc84606
Update installation/src/Helper/DatabaseHelper.php
HLeithner 5924f40
Update components/com_config/src/Service/Router.php
HLeithner 5076bcf
Merge branch '5.3-dev' into automated-updates/client
bembelimen 58dfbc9
Merge branch 'automated-updates/client' into automated-updates/register
bembelimen bb3be61
Implement quickicon
bembelimen e94ea6a
Merge pull request #3 from joomla-projects/automated-updates/dashboar…
SniperSister 1a7ca04
Merge pull request #2 from joomla-projects/automated-updates/register
SniperSister a6e12e8
use correct site url
SniperSister 7878039
fix input
SniperSister 38df8cb
Merge remote-tracking branch 'upstream/5.3-dev' into automated-update…
2a9d4f0
Merge pull request #7 from joomla-projects/automated-updates/sync
HLeithner a05e1e3
Rework register
259ec81
Merge pull request #8 from joomla-projects/automated-updates/register…
SniperSister f2cbfc3
Add entry-point if-case for autoupdate extraction process
SniperSister 2688ae9
Merge remote-tracking branch 'upstream/5.3-dev' into automated-update…
SniperSister 5707f64
Update JoomlaupdateComponent.php
brianteeman 210945d
Merge pull request #10 from brianteeman/patch-1
SniperSister 206a28f
Added joomlaupdate webservice plugin to install and update SQL
SniperSister d05cad2
Merge branch 'automated-updates/client' of github.com:joomla-projects…
SniperSister 022a3ac
Enhance guided tours for Joomla 5.3 with new automated updates featur…
bembelimen 2b5517f
Refactor registration logic; move to model
SniperSister 689454d
Merge pull request #11 from joomla-projects/automated-updates/client-…
SniperSister afff807
fix result
SniperSister 7fd056b
Added acl check for autoupdate registration
SniperSister f1e6ae2
fix cast
SniperSister 6372390
Fix acl check
SniperSister a262181
Merge pull request #12 from joomla-projects/feature/refactored-regist…
bembelimen 6fca691
Add Postinstallation Message
dfe8c2c
Merge pull request #13 from joomla-projects/automated-updates/postmes…
SniperSister 1ca5668
Update Postinstallation action
6106942
Merge pull request #14 from joomla-projects/automated-updates/postmes…
HLeithner 3e6ef4e
fix copyright an subpackage
brianteeman 7064fd0
Merge pull request #15 from brianteeman/patch-1
SniperSister a6cbb3f
Update com_joomlaupdate.ini
brianteeman 1c3a28f
Merge pull request #16 from brianteeman/patch-2
SniperSister caa07f3
remove unused variable
SniperSister 578d43e
fix default value for minimum_stability
SniperSister 69eac5a
cs fix
SniperSister d3ab596
Prevent update notification emails when auto updater is active
bembelimen 8cc4343
Merge pull request #20 from joomla-projects/automated-updates/disable…
SniperSister b9e3597
Call cleanup method and trigger actionlog
SniperSister 3d04988
Merge pull request #21 from joomla-projects/feature/trigger-aciton-lo…
HLeithner 809ce63
Adjust actionlog item for automated updates
SniperSister 2623378
added tempaltes to initial dataset
SniperSister d1ce9e1
added update sqls
SniperSister 07fd78c
Update administrator/language/en-GB/plg_actionlog_joomla.ini
SniperSister a1e339c
added mailtemplate texts
SniperSister 20701fb
remove irrelevant change
SniperSister 2ab51cd
cs fixes
SniperSister 7f67288
re-add defines path
SniperSister 741798a
Merge pull request #22 from joomla-projects/feature/actionlog-item-fixes
SniperSister 2dba4e8
added quickicon to extension helper
SniperSister 4d7faba
remove unused check
SniperSister 9e1a412
cs fix
SniperSister 8bd2e3c
Merge branch 'automated-updates/client' of github.com:joomla-projects…
SniperSister 542b97c
fix js codestyles
SniperSister 1b1af9d
Apply suggestions from code review
bembelimen 991cf2c
Update administrator/components/com_joomlaupdate/config.xml
bembelimen f7454b4
Update notification
d2c48fc
Merge branch 'automated-updates/client' into feature/info-mails
HLeithner 582016d
Rename auto update => automated update
bembelimen d13e362
Automated update => automated updates
bembelimen 730b0ae
Fixed notification
5a7de0d
Fixed notification
5e963e1
Merge branch '5.4-dev' into automated-updates/client
richard67 ecc2814
Rename update SQL scripts
richard67 892fef3
Revert guided tours update SQL changes
richard67 101735b
Move image for guided tours to 5.4
richard67 92017a7
Revert guided tours 5.3 language file changes
richard67 7c80d91
Change postinstall message condition to 5.4.0
richard67 f2da310
Change postinstall message to 5.4
richard67 afe3853
Add guided tours what's new in 5.4
richard67 299386e
Merge pull request #3 from richard67/5.4-dev-automated-updates-client…
SniperSister 04c27fd
Apply suggestions from code review
richard67 291970e
Merge pull request #23 from joomla-projects/feature/info-mails
SniperSister a5c05ea
Merge remote-tracking branch 'my-origin/automated-updates/client' int…
SniperSister 88a3093
implement code review suggestions
SniperSister a1ba665
Added CLI commands for registration and unregistraoitn
SniperSister d1274c9
Update libraries/src/Console/AutomatedUpdatesUnregisterCommand.php
SniperSister dcfd1ac
Update libraries/src/Console/AutomatedUpdatesRegisterCommand.php
SniperSister 759d684
Update libraries/src/Console/AutomatedUpdatesUnregisterCommand.php
SniperSister 7b77717
Merge pull request #26 from joomla-projects/automated-updates/cli-com…
HLeithner 5ee6a48
cs fix
SniperSister 78d3bc1
cs fix
SniperSister 29c39af
Update administrator/language/en-GB/com_joomlaupdate.ini
HLeithner f15b477
Update api/components/com_joomlaupdate/src/View/Healthcheck/JsonapiVi…
HLeithner 69dc3c6
Update api/components/com_joomlaupdate/src/View/Notification/JsonapiV…
HLeithner d03134f
Combine sql update files
HLeithner d4925d8
Fix ordering of webservices plugins
richard67 ee5d8e7
Merge pull request #4 from richard67/5.4-dev-automated-updates-client…
SniperSister 7a9c27c
adjust string sorting
SniperSister 55b3464
Apply suggestions from code review
SniperSister c98594e
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister d207189
Merge branch '5.4-dev' into automated-updates/client
richard67 7646135
fix missing import
SniperSister 1fa7841
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister cf6b506
Merge branch '5.4-dev' into automated-updates/client
richard67 6451720
update i18n strings
SniperSister e01fdc3
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister fe3e930
fix notification subjects
SniperSister 91499d6
Quickicon Link
brianteeman 1c4f61c
Merge pull request #27 from brianteeman/patch-1
SniperSister 58c39e6
Update plg_quickicon_autoupdate.ini
brianteeman f455e3e
Merge pull request #28 from brianteeman/patch-2
SniperSister 03aa9fd
Added mail template i18n strings
SniperSister c32ae03
Update administrator/language/en-GB/com_joomlaupdate.ini
SniperSister ec9a66e
Apply suggestions from code review
SniperSister bf67c6f
Merge pull request #30 from joomla-projects/automated-updates/mailtem…
SniperSister 9bcf681
Merge branch '5.4-dev' into automated-updates/client
richard67 458a762
Apply suggestions from code review
SniperSister 8d50a2c
Fix docblock
SniperSister 43754f1
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister 75ed12b
fix site url
SniperSister d449d0c
Fix PHPCS
richard67 bce0f6d
automated_updates_email
brianteeman fd7f913
Update com_joomlaupdate.ini
brianteeman 11fd40a
Merge pull request #35 from brianteeman/patch-2
HLeithner 3c732b3
Update com_joomlaupdate.ini
brianteeman 121d6f9
Merge pull request #36 from brianteeman/patch-2
SniperSister 9f5f470
Merge pull request #33 from brianteeman/patch-1
SniperSister de1e671
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister ddff7f1
Check stability and channel in quickicon status output
SniperSister 557e7eb
respect user time in last_check-Date
SniperSister 17316d0
Update NotificationModel.php
brianteeman eb72e9b
Merge pull request #37 from brianteeman/patch-1
SniperSister b148bd9
Update guidedtours.joomla_whatsnew_5_4.ini
brianteeman 8a25b3f
Merge pull request #38 from brianteeman/patch-1
SniperSister 6ff5187
cs fix
SniperSister a339bc2
cs fix
SniperSister c04e654
check update requirements in healthcheck and get update endpoints
SniperSister 654e01d
add cache purger
SniperSister dac1d43
cs fix
SniperSister d169a35
fix email
SniperSister de781d9
fix default config state
SniperSister 933b70f
Merge branch '5.4-dev' into automated-updates/client
muhme e10528f
Merge branch '5.4-dev' into automated-updates/client
richard67 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
administrator/components/com_admin/sql/updates/mysql/5.4.0-2025-05-10.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) | ||
| SELECT 0, 'plg_quickicon_autoupdate', 'plugin', 'autoupdate', 'quickicon', 0, 1, 1, 0, 1, '', '', '', -1, 0 | ||
| WHERE NOT EXISTS (SELECT * FROM `#__extensions` e WHERE e.`type` = 'plugin' AND e.`element` = 'autoupdate' AND e.`folder` = 'quickicon' AND e.`client_id` = 0); | ||
|
|
||
| INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) | ||
| SELECT 0, 'plg_webservices_joomlaupdate', 'plugin', 'joomlaupdate', 'webservices', 0, 1, 1, 0, 1, '', '', '', -1, 0 | ||
| WHERE NOT EXISTS (SELECT * FROM `#__extensions` e WHERE e.`type` = 'plugin' AND e.`element` = 'joomlaupdate' AND e.`folder` = 'webservices' AND e.`client_id` = 0); | ||
|
|
||
| INSERT INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES | ||
| ('com_joomlaupdate.update.success', 'com_joomlaupdate', '', 'COM_JOOMLAUPDATE_UPDATE_SUCCESS_MAIL_SUBJECT', 'COM_JOOMLAUPDATE_UPDATE_SUCCESS_MAIL_BODY', '', '', '{"tags":["newversion","oldversion","sitename","url"]}'), | ||
| ('com_joomlaupdate.update.failed', 'com_joomlaupdate', '', 'COM_JOOMLAUPDATE_UPDATE_FAILED_MAIL_SUBJECT', 'COM_JOOMLAUPDATE_UPDATE_FAILED_MAIL_BODY', '', '', '{"tags":["newversion","oldversion","sitename","url"]}'); | ||
|
|
||
| -- add post-installation message for automated updates | ||
| INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`) | ||
| SELECT `extension_id`, 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_TITLE', 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_DESCRIPTION', 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_ACTION', 'com_joomlaupdate', 1, 'action', 'admin://components/com_joomlaupdate/postinstall/autoupdate.php', 'com_joomlaupdate_postinstall_autoupdate_action', 'admin://components/com_joomlaupdate/postinstall/autoupdate.php', 'com_joomlaupdate_postinstall_autoupdate_condition', '5.4.0', 1 FROM `#__extensions` WHERE `name` = 'files_joomla'; | ||
|
|
||
| -- disable autostart for the previous tour | ||
| UPDATE `#__guidedtours` SET `autostart` = 0 WHERE `uid` = 'joomla-whatsnew-5-3'; | ||
|
|
||
| INSERT INTO `#__guidedtours` (`title`, `description`, `extensions`, `url`, `published`, `language`, `note`, `access`, `uid`, `autostart`, `created`, `created_by`, `modified`, `modified_by`) VALUES | ||
| ('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_DESCRIPTION', '["com_cpanel"]', 'administrator/index.php', 1, '*', '', 1, 'joomla-whatsnew-5-4', 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0); | ||
|
|
||
| INSERT INTO `#__guidedtour_steps` (`title`, `description`, `position`, `target`, `type`, `interactive_type`, `url`, `published`, `language`, `note`, `params`, `tour_id`, `created`, `created_by`, `modified`, `modified_by`) | ||
| SELECT 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_STEP_0_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_STEP_0_DESCRIPTION', 'right', '#sidebarmenu nav > ul:first-of-type > li:last-child', 0, 1, '', 1, '*', '', '"{\"required\":1,\"requiredvalue\":\"\"}"', MAX(`id`), CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0 | ||
| FROM `#__guidedtours` | ||
| WHERE `uid` = 'joomla-whatsnew-5-4'; |
26 changes: 26 additions & 0 deletions
26
administrator/components/com_admin/sql/updates/postgresql/5.4.0-2025-05-10.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") | ||
| SELECT 0, 'plg_quickicon_autoupdate', 'plugin', 'autoupdate', 'quickicon', 0, 1, 1, 0, 1, '', '', '', -1, 0 | ||
| WHERE NOT EXISTS (SELECT * FROM "#__extensions" e WHERE e."type" = 'plugin' AND e."element" = 'autoupdate' AND e."folder" = 'quickicon' AND e."client_id" = 0); | ||
|
|
||
| INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") | ||
| SELECT 0, 'plg_webservices_joomlaupdate', 'plugin', 'joomlaupdate', 'webservices', 0, 1, 1, 0, 1, '', '', '', -1, 0 | ||
| WHERE NOT EXISTS (SELECT * FROM "#__extensions" e WHERE e."type" = 'plugin' AND e."element" = 'joomlaupdate' AND e."folder" = 'webservices' AND e."client_id" = 0); | ||
|
|
||
| INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES | ||
| ('com_joomlaupdate.update.success', 'com_joomlaupdate', '', 'COM_JOOMLAUPDATE_UPDATE_SUCCESS_MAIL_SUBJECT', 'COM_JOOMLAUPDATE_UPDATE_SUCCESS_MAIL_BODY', '', '', '{"tags":["newversion","oldversion","sitename","url"]}'), | ||
| ('com_joomlaupdate.update.failed', 'com_joomlaupdate', '', 'COM_JOOMLAUPDATE_UPDATE_FAILED_MAIL_SUBJECT', 'COM_JOOMLAUPDATE_UPDATE_FAILED_MAIL_BODY', '', '', '{"tags":["newversion","oldversion","sitename","url"]}'); | ||
|
|
||
| -- add post-installation message for automated updates | ||
| INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled") | ||
| SELECT "extension_id", 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_TITLE', 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_DESCRIPTION', 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_ACTION', 'com_joomlaupdate', 1, 'action', 'admin://components/com_joomlaupdate/postinstall/autoupdate.php', 'com_joomlaupdate_postinstall_autoupdate_action', 'admin://components/com_joomlaupdate/postinstall/autoupdate.php', 'com_joomlaupdate_postinstall_autoupdate_condition', '5.4.0', 1 FROM "#__extensions" WHERE "name" = 'files_joomla'; | ||
|
|
||
| -- disable autostart for the previous tour | ||
| UPDATE "#__guidedtours" SET "autostart" = 0 WHERE "uid" = 'joomla-whatsnew-5-3'; | ||
|
|
||
| INSERT INTO "#__guidedtours" ("title", "description", "extensions", "url", "published", "language", "note", "access", "uid", "autostart", "created", "created_by", "modified", "modified_by") VALUES | ||
| ('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_DESCRIPTION', '["com_cpanel"]', 'administrator/index.php', 1, '*', '', 1, 'joomla-whatsnew-5-4', 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0); | ||
|
|
||
| INSERT INTO "#__guidedtour_steps" ("title", "description", "position", "target", "type", "interactive_type", "url", "published", "language", "note", "params", "tour_id", "created", "created_by", "modified", "modified_by") | ||
| SELECT 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_STEP_0_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_STEP_0_DESCRIPTION', 'right', '#sidebarmenu nav > ul:first-of-type > li:last-child', 0, 1, '', 1, '*', '', '"{\"required\":1,\"requiredvalue\":\"\"}"', MAX("id"), CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0 | ||
| FROM "#__guidedtours" | ||
| WHERE "uid" = 'joomla-whatsnew-5-4'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
administrator/components/com_joomlaupdate/postinstall/autoupdate.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * @package Joomla.Administrator | ||
| * @subpackage com_joomlaupdate | ||
| * | ||
| * @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| use Joomla\CMS\Component\ComponentHelper; | ||
| use Joomla\CMS\Factory; | ||
| use Joomla\CMS\Table\Extension; | ||
| use Joomla\Component\Joomlaupdate\Administrator\Enum\AutoupdateRegisterState; | ||
| use Joomla\Component\Joomlaupdate\Administrator\Enum\AutoupdateState; | ||
| use Joomla\Database\DatabaseInterface; | ||
| use Joomla\Registry\Registry; | ||
|
|
||
| // phpcs:disable PSR1.Files.SideEffects | ||
| \defined('_JEXEC') or die; | ||
| // phpcs:enable PSR1.Files.SideEffects | ||
|
|
||
| /** | ||
| * Post-installation message about the new Automated Update: condition check. | ||
| * | ||
| * Returns true it is disabled. | ||
| * | ||
| * @return bool | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| function com_joomlaupdate_postinstall_autoupdate_condition(): bool | ||
| { | ||
| return AutoupdateState::tryFrom(ComponentHelper::getParams('com_joomlaupdate')->get('autoupdate', '0')) === AutoupdateState::Disabled; | ||
| } | ||
|
|
||
| /** | ||
| * Post-installation message about the new Automated Update: action. | ||
| * | ||
| * Enables the Automated Update. | ||
| * | ||
| * @return void | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| function com_joomlaupdate_postinstall_autoupdate_action(): void | ||
| { | ||
| $db = Factory::getContainer()->get(DatabaseInterface::class); | ||
|
|
||
| // Get extension row | ||
| $extension = new Extension($db); | ||
| $extensionId = $extension->find(['element' => 'com_joomlaupdate']); | ||
| $extension->load($extensionId); | ||
|
|
||
| // Set new update registration state | ||
| $params = new Registry($extension->params); | ||
| $params->set('autoupdate', AutoupdateState::Enabled); | ||
| $params->set('autoupdate_status', AutoupdateRegisterState::Subscribe); | ||
|
|
||
| $extension->params = $params->toString(); | ||
|
|
||
| if (!$extension->store()) { | ||
| throw new \RuntimeException($extension->getError()); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
administrator/components/com_joomlaupdate/src/Enum/AutoupdateRegisterState.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * @package Joomla.Administrator | ||
| * @subpackage com_joomlaupdate | ||
| * | ||
| * @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| namespace Joomla\Component\Joomlaupdate\Administrator\Enum; | ||
|
|
||
| // phpcs:disable PSR1.Files.SideEffects | ||
| \defined('_JEXEC') or die; | ||
| // phpcs:enable PSR1.Files.SideEffects | ||
|
|
||
| /** | ||
| * Autoupdate State Enum | ||
| */ | ||
| enum AutoupdateRegisterState: int | ||
| { | ||
| case Unsubscribe = -1; | ||
| case Unsubscribed = 0; | ||
| case Subscribe = 1; | ||
| case Subscribed = 2; | ||
| } |
24 changes: 24 additions & 0 deletions
24
administrator/components/com_joomlaupdate/src/Enum/AutoupdateState.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * @package Joomla.Administrator | ||
| * @subpackage com_joomlaupdate | ||
| * | ||
| * @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| namespace Joomla\Component\Joomlaupdate\Administrator\Enum; | ||
|
|
||
| // phpcs:disable PSR1.Files.SideEffects | ||
| \defined('_JEXEC') or die; | ||
| // phpcs:enable PSR1.Files.SideEffects | ||
|
|
||
| /** | ||
| * Autoupdate State Enum | ||
| */ | ||
| enum AutoupdateState: int | ||
| { | ||
| case Disabled = 0; | ||
| case Enabled = 1; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.