225 Commits

Author SHA1 Message Date
Paul Holden
c1c000aa15
MDL-71421 core: deprecate openssl fallbacks in encryption library.
Since c66dc591 the PHP Sodium library is required, negating the need
for the OpenSSL equivalent. Remove fallbacks where possible, leaving
only the ability to decrypt legacy OpenSSL-encrypted content (with
debugging).
2023-08-01 12:10:36 +01:00
raortegar
b914f01316 MDL-75195 core: Added supportemail option to install_database.php 2023-07-11 11:13:03 +02:00
Ilya Tregubov
cfbb0ea4d5 Merge branch 'MDL-70975-adhoc-carneval' of https://github.com/catalyst/moodle 2023-04-13 09:07:58 +08:00
Andrew Nicols
eb1b172397 Merge branch 'MDL-65471-outageless' of https://github.com/Peterburnett/moodle 2023-04-06 08:36:25 +02:00
Peter Burnett
027c770eab
MDL-65471 upgrade: framework to reduce maintenance mode 2023-04-06 11:38:26 +10:00
Srdjan
6d9aaa8412 MDL-70975 task: Support for running only failed ad hoc tasks
* CLI adhoc_task.php: new option --failed
2023-04-05 11:05:23 +10:00
Srdjan
fa61fce08d MDL-70975 task: Support for limiting the number of adhoc tasks to run
* CLI adhoc_task.php: new option --taskslimit
* CLI adhoc_task.php: --execute option is implied when other options are given
* core\task\manager::get_next_adhoc_task(): new param $number
  for limiting number of tasks to run
2023-04-05 11:05:18 +10:00
Srdjan
3491ea1650 MDL-70975 task: Support for running adhoc tasks filtered by class
* CLI adhoc_task.php: new option --classname
* core\task\manager::get_next_adhoc_task(): new param $classname
  for filtering tasks
2023-04-05 11:00:46 +10:00
Srdjan
9405b5aa6d MDL-70975 task: Support for running adhoc tasks by id
* CLI adhoc_task.php: new option --id
* cron::run_adhoc_task($taskid) for running tasks by id
* core\task\manager::get_adhoc_task($taskid) for retreival/locking
2023-04-05 10:55:18 +10:00
Stephan Robotta
b86719f9d0 MDL-77385 cli: CLI script to modify emailstop flag for users 2023-03-28 20:23:23 +02:00
Andrew Nicols
9ec46c232d MDL-77186 core: Move all uses of cronlib to new class 2023-03-13 21:21:13 +08:00
Andrew Nicols
1b59967d71 MDL-77186 core: Add a new keepalive setting to cron 2023-03-13 21:19:55 +08:00
Andrew Nicols
fbeb9f8952 MDL-77186 core: Improve coding style for cron.php 2023-03-13 21:19:36 +08:00
Mikhail Golenkov
04e2e00976 MDL-74991 CLI: Add a script to delete courses 2022-10-10 14:40:23 +11:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Eric Merrill
5d7509392d MDL-74182 core_task: Obey CFG debug settings 2022-03-13 23:57:13 -04:00
Simey Lameze
f88bcdb041 MDL-72984 cli: add support email option to cli install 2021-12-20 13:24:38 +08:00
Sara Arjona
42895003e4 MDL-73145 install: Apply site preset if defined in config
A new setting, $CFG->setsitepresetduringinstall, has been added to
config file, to let admins define the site admin preset to be applied
during the Moodle installation.

Besides, a new parameter, "--sitepreset" has been also added
to admin/cli/install.php, to let define it too when running the
upgrade process using CLI.
2021-12-09 09:48:44 +01:00
cperves
a457b85eb2 MDL-71778 admin: patch for hard-set check filter 2021-08-31 12:32:14 +08:00
Leon Stringer
267aa870d3 MDL-71476 core_cli: Remove MyISAM migration
Remove support for migrating MySQL databases using the old MyISAM storage
engine to the InnoDB storage engine.  MyISAM was supported up to Moodle
2.8 (dropped in 2.9: MDL-46064).  Beyond Moodle 3.3 -- the highest version
that can upgrade from 2.8 -- this functionality was no longer applicable.
2021-05-19 08:27:19 +01:00
abgreeve
d30c967159 Merge branch 'MDL-70181' of https://github.com/stronk7/moodle 2021-05-07 10:21:46 +08:00
Eloy Lafuente (stronk7)
d676a8114e MDL-71420 environment: Add some strategic comments and todos.
This isn't really a deprecations where something is replaced
by another and all uses must adapt to. Instead it's just a
fallback functionality that will stop working in Moodle 4.2.

Because of that, I've tried to add TODO/@todo comments to
the places that will need to modified, always pointing to
MDL-71421 that is where the removal will happen.

Also, haven't added any debugging() output, after thinking
a lot about it, because this isn't anything that developers
can be using but a internal implementation detail (a fallback)
that we want to remove in some versions.
2021-05-06 14:29:33 +02:00
Leon Stringer
37ae249dfa MDL-70181 database: Quote database object names
Table names and database name now enclosed in backticks.
admin/cli/mysql_collation.php failed if $CFG->prefix was blank with
MySQL 8.0 because table 'groups' conflicted with a new reserved word.

Note that this quotes both mysql_collation.php and mysql_compressed_rows.php
but only the former was mal-functioning.

The case of mysql_compressed_rows.php is a little bit special because
not all tables are processed, only those having big rows. And the groups
table is not one of them. In any case, better add the quotes there for
any future case.

Also, when testing this patch https://tracker.moodle.org/browse/MDL-71512
was discovered and will need to be fixed to make core 100% compliant
with MySQL 8.0 and MariaDB 10.6 and up.
2021-05-05 10:16:45 +02:00
Jun Pataleta
e853e6b7db Merge branch 'MDL-71156-master' of git://github.com/lameze/moodle 2021-04-22 11:51:59 +08:00
Simey Lameze
5b0282847e MDL-71156 core: machinery to recover orphaned calendar events
The machinery to fix orphaned calendar events that were broken by MDL-67494.

The solution consists of:

1) Upgrade step that checks if this site has executed the problematic upgrade steps and
   if positive, it will schedule a new run for calendar_fix_orphaned_events adhoc task.

2) Adhoc task that will self-spawn calling the recovery machinery, running until
   all the orphaned calendar events are fixed. It also sets the maximum runtime of
   60 seconds. It is also possible to override that number by specifing the desired
   number setting the ->calendareventsmaxseconds in your config.php

3) CLI script that will look for all the calendar events which userids
   where broken by a wrong upgrade step, affecting to Moodle 3.9.5
   and up.

   It performs checks to both:
     a) Detect if the site was affected (ran the wrong upgrade step).
     b) Look for orphaned calendar events, categorising them as:
       - standard: site / category / course / group / user events
       - subscription: events created via subscriptions.
       - action: normal action events, created to show common important dates.
       - override: user and group override events, particular, that some activities support.
       - custom: other events, not being any of the above, common or particular.

   By specifying it (--fix) try to recover as many broken events (missing userid) as
   possible. Standard, subscription, action, override events in core are fully supported but
   override or custom events should be fixed by each plugin as far as there isn't any standard
   API (plugin-wise) to launch a rebuild of the calendar events.

4) Unit tests and helper functions to generate calendar events. We have decided to
   keep the tests simple, testing only true and false and not using data generators because
   the code is purely to recover the calendar events and won't turn into an API or something
   and also due to the urgency of this issue.
   The helpers have been created in calendar/tests/helpers.php since there are no data generators
   for calendar.
2021-04-22 10:28:52 +08:00
Paul Holden
5163f1e6bd MDL-69460 admin: prevent CLI upgrade when stale files present. 2021-04-19 09:03:39 +01:00
Víctor Déniz
4e26c93473 Merge branch 'MDL-70536-reset-page-cli' of https://github.com/brendanheywood/moodle 2021-02-18 00:31:39 +00:00
Brendan Heywood
a87ddbd685 MDL-70536 cli: Fixed cli progress bar when 100% more than once 2021-02-07 00:36:01 +11:00
Brendan Heywood
67fb670cc6 MDL-70536 cli: Add cli for resetting all dashboards 2021-02-06 15:36:12 +11:00
Paul Holden
e0d3b4505e MDL-70643 admin: add summary argument to install database CLI.
Show warning for any unrecognised arguments.
2021-02-01 12:33:11 +00:00
Mikhail Golenkov
5d7941c893 MDL-70362 admin_cli: Add showdebugging and showsql to uninstall_plugins 2020-12-18 12:15:51 +11:00
sam marshall
ddbafce0e0 MDL-65818 Security: Encryption API and admin setting for secure data 2020-12-04 14:41:21 +00:00
David Mudrák
7a079a890b MDL-69050 lang: Fix the variable name in the admin/cli/svgtool.php 2020-09-24 19:41:58 +02:00
Andrew Nicols
068de8fb79 Merge branch 'master-MDL-69307_v4' of https://github.com/golenkovm/moodle 2020-08-26 14:48:36 +08:00
Mikhail Golenkov
39b65190e2 MDL-69307 restore: Add CLI script to restore a course.
Co-authored-by: Matt Porritt <mattp@catalyst-au.net>
2020-08-26 14:35:21 +10:00
Mikhail Golenkov
d7342dc239 MDL-67211 Tasks: Add cron_enabled setting.
Co-authored-by: Sam Marshall <s.marshall@open.ac.uk>
2020-08-25 17:08:57 +10:00
Mikhail Golenkov
b465a541ae MDL-67211 Tasks: Record when a task is running.
Co-authored-by: Sam Marshall <s.marshall@open.ac.uk>
2020-08-25 17:08:03 +10:00
Jun Pataleta
fcc5307e64 Merge branch 'MDL-65453-master' of git://github.com/lameze/moodle 2020-07-28 11:42:47 +08:00
Simey Lameze
d208ffb0e2 MDL-65453 core: fix behaviour of --skip-database option on install 2020-07-28 11:21:35 +08:00
adpe
d4dc94ec8d MDL-69260 admin_cli: show only contributed plugins in uninstall plugins 2020-07-13 20:19:35 +02:00
Charles Fulton
66ba391e82 MDL-58931 dml: add support for aurora mysql 2020-07-01 22:56:20 +02:00
Jun Pataleta
51939f6feb Merge branch 'MDL-68261-cli-config-log' of https://github.com/brendanheywood/moodle 2020-05-13 10:36:54 +08:00
cescobedo
079736ccb3 MDL-63580 core_task: Deprecation CLI scripts from admin/tool/task/cli
Copy the CLI scripts from admin/tool/task/cli to admin/cli (schedule_task.php and adhoc_task.php)
and rename to scheduled_task.php and to improve in order to use cron_run_inner_scheduled_task.
2020-05-11 10:53:17 +02:00
Brendan Heywood
76de190c25 MDL-68261 report_configlog: Log changes from admin/cli/cfg.php 2020-05-05 17:52:27 +10:00
Brendan Heywood
20167daf89 MDL-47271 report_status: Added System status report 2020-04-08 14:35:31 +10:00
Adrian Greeve
c282319a35 Merge branch 'MDL-59594-SIGINT' of https://github.com/brendanheywood/moodle 2020-01-20 10:39:20 +08:00
[Peter Burnett]
147a895ad0 MDL-59562 upgrade: Plugins can declare supported moodle versions
* Plugins can now explicitly declare supported and incompatible Moodle
  versions in version.php
  - $plugin->supported[37,39];
    supported takes an array of ascending numbers, that correspond to a
    range of branch numbers of supported versions, inclusive. Moodle
    versions that are outside of this range will produce a message
    notifying at install time, but will allow for installation.

  - $plugin->incompatible = 36;
    incompatible takes a single int corresponding to the first incompatible
    branch. Any Moodle versions including and below this will be prevented
    from installing the plugin, and a message will be given when
    attempting installation.
2020-01-15 14:38:27 +10:00
Brendan Heywood
b15c53f4fa MDL-59594 cron: Allow graceful exit of cron and adhoc task cli's 2020-01-12 01:24:03 +11:00
Brendan Heywood
0bcc273f63 MDL-65229 cron: Add cli option --stop to notify all cron to stop 2019-12-03 17:51:56 +11:00
David Mudrák
469d4b7f35 MDL-67250 setup: Revert removal of the httpswwwroot setting
It is still used widely in the plugins that would stop working suddenly
without being warned via a debugging message. We must keep it forever as
an alias for the wwwroot.
2019-11-13 19:58:10 +01:00