565 Commits

Author SHA1 Message Date
Paul Holden
0dda0c91e1
Merge branch 'MDL-82974-main' of https://github.com/ilyatregubov/moodle into main 2024-09-04 10:32:06 +01:00
Jun Pataleta
ea2d3558d9
NOBUG: Add upgrade notes 2024-09-03 20:05:49 +08:00
Trisha Milan
e52fbd2f84 MDL-66151 Performance: Session Manager modularisation
Storage of session metadata has moved into the session handler class.
This allows for other classes to fully control session handling and
removes the dependancy on the core sessions database table.

Previously, the standard method of interaction with the
session metadata was direct DB calls; this may break other plugins as there
are now proper APIs available through the session manager.

Co-authored-by: Darren Cocco <moodle@darren.cocco.id.au>
Co-authored-by: Trisha Milan <trishamilan@catalyst-au.net>
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2024-09-03 13:04:04 +10:00
Ilya Tregubov
f23472345c MDL-82974 core_cache: Fix typo. 2024-09-02 12:57:13 +08:00
Huong Nguyen
7aef6e21cb
NOBUG: Add upgrade notes 2024-08-29 18:09:49 +07:00
Huong Nguyen
4f25ac1044
Merge branch 'MDL-82158-main' of https://github.com/andrewnicols/moodle 2024-08-27 10:01:38 +07:00
Andrew Nicols
c21aeeb380
MDL-82158 core: Update most uses of cache_ classes 2024-08-20 20:44:28 +08:00
Andrew Nicols
b92008c92c
MDL-82158 core_cache: Coding style fixes 2024-08-20 20:44:28 +08:00
Andrew Nicols
f31d9ebc8c
MDL-82158 core: Remove uses of cache/lib.php 2024-08-20 15:47:14 +08:00
Andrew Nicols
24a9c64cb3
MDL-82158 core_cache: Move cache forms 2024-08-20 15:27:06 +08:00
Andrew Nicols
cd6501c017
MDL-82158 core_cache: Moved disabled cache infrastructure 2024-08-20 15:27:06 +08:00
Andrew Nicols
7a9f55694f
MDL-82158 core_cache: Move cache_config_writer 2024-08-20 15:27:05 +08:00
Andrew Nicols
a63e81bfa5
MDL-82158 core_cache: Move cache definition 2024-08-20 15:27:05 +08:00
Andrew Nicols
c5ff1b053f
MDL-82158 core_cache: Move cache stores 2024-08-20 15:27:05 +08:00
Andrew Nicols
4038c52928
MDL-82158 core_cache: Move interfaces 2024-08-20 15:27:04 +08:00
Andrew Nicols
024e36be17
MDL-81634 core: Fix all implicitly defined nullables
Note: This does not impact third-party libraries.
2024-08-02 14:11:12 +08:00
Jun Pataleta
5b68ba9eee
Merge branch 'MDL-75864-main' of https://github.com/meirzamoodle/moodle 2024-07-18 12:48:03 +08:00
Eloy Lafuente (stronk7)
ad5fe71868
MDL-82207 phpunit: fix various @covers annotations (take#1)
This fixes various (not all) wrong @covers annotations that
are reported as warnings by PHPUnit when it's run with
code-coverage enabled.

When possible, the preferred solution is to change to
@covers at class level, that is the recommended way.

If multiple classes are involved, then a mix of @coversDefaultClass
and @covers at method level are used (always trying to use the
minimum needed patch).

This is the first of a series of issues created as sub-tasks
of MDL-82142.
2024-06-24 12:07:39 +02:00
Meirza
4fbf34b73d MDL-75864 cache: Change key prefix in cache_cron_task
Currently, the cache_cron_task is set to look for 'sess_' as a key prefix,
which is not used in any code. As a result, sessions that have exceeded the timeout are never deleted.

The proposed patch involves changing the prefix to the LASTACCESS key prefix and
fixing the return value of get_many in the Redis cache so that it can return the required keys.

Co-authored-by: Renaud Lemaire <rlemaire@cblue.be>
2024-06-19 13:41:37 +07:00
Eloy Lafuente (stronk7)
674497a12c
MDL-81523 phpunit: Add all missing setUp/tearDown parent calls
All setUp(), tearDown(), setUpBeforeClass() and tearDownAfterClass()
must, always, call to parent, to ensure that everything is properly
set and cleaned.

While in a lot of situations this is not needed (parents may not
have anything to run), with PHPUnit >= 10 this can become more
important because we are going to move the reset code from current
placement @ runBare() to setUp()/tearDown().

Note that all the changes performed in this commit have been detected
and fixed by moodle-cs (ParentSetUpTearDownSniffTest).
2024-06-14 16:04:57 +02:00
Eloy Lafuente (stronk7)
4f7631113c
MDL-81522 phpunit: Add missing void return type to all tests #2
This commit includes more changes, all them also adding the :void
return type to unit tests missing them.

The difference is that all these changes, while also detected
perfectly by the moodle.PHPUnit.TestReturnType sniff, were not
auto-fixed (like the previous commit ones), because all them
do include some "return" statement and, for safety, we don't
fix them.

All the cases have been visually inspected and confirmed that
the existing "return" statements always belong to anon
functions within the test body and not the test own return statement.
2024-06-11 11:55:08 +02:00
Eloy Lafuente (stronk7)
01148a0816
MDL-81522 phpunit: Add missing void return type to all tests
While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.

All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
2024-06-11 11:55:07 +02:00
Andrew Nicols
8a92cb82a6
Merge branch 'MDL-81794-main' of https://github.com/meirzamoodle/moodle 2024-06-06 22:02:36 +08:00
Andrew Nicols
1790452026
Merge branch 'MDL-80208' of https://github.com/paulholden/moodle 2024-06-04 11:06:34 +08:00
meirzamoodle
ba8cb7874f MDL-81794 core: Fix the TLS issue on the Redis
The fix covers two places:
- The Redis session.
- The Redis cache store.

The PHP Redis has the option to establish the connection using TLS/SSL instead of using the "tls://" prefix.
This is done to ensure consistency with the Redis cluster connection,
as the code for both single and cluster connections is located in one place.
2024-05-29 09:14:27 +07:00
Paul Holden
493be63757
MDL-80208 cachestore_redis: ensure empty set many with TTL don't throw. 2024-05-21 22:33:07 +01:00
Andrew Nicols
0964cd5b69
MDL-81125 core: Update upgrade.txt files to document new upgrade notes 2024-05-20 22:26:45 +08:00
Jun Pataleta
a180dba314
MDL-81549 versions: bump all versions and requires near release 2024-04-17 00:03:29 +08:00
Jun Pataleta
3856addfdd
Merge branch 'MDL-67667-main' of https://github.com/andrewnicols/moodle 2024-04-12 12:41:39 +08:00
Andrew Nicols
6f1df841f7
MDL-67667 core: Deprecate and removal task blocking
There are inherent issues with task blocking which mean that it has
never worked properly. It is also very buggy and can lead to massive
performance issues with task processing.

It is almost impossible to deprecate this in a staged fashion because
various APIs use the methods and it is not possible to determine which
are API uses and which are other valid uses.

In reality there has been little-to-no uptake on the use of this feature
and it should just be removed.
2024-04-12 12:34:20 +08:00
Huong Nguyen
ca449af186
Merge branch 'MDL-81351-main-enfix' of https://github.com/mudrd8mz/moodle 2024-04-10 13:54:56 +07:00
meirzamoodle
ce5b7edd5c MDL-81366 redis: Remove the named parameters
Unfortunately, the read_timeout named parameter was not recognized on some machines.
To avoid such errors, this patch removed the named parameter on a single Redis connect() and the Redis cluster.
2024-03-28 10:19:35 +07:00
Helen Foster
dccc91f4bc MDL-81351 lang: Import fixed English strings (en_fix) 2024-03-26 23:13:15 +01:00
meirzamoodle
c700e4f8a9 MDL-63128 core_cache: Add new is_cluster_available helper
The ::is_cluster_available() will return true if the PHP support redis cluster.
2024-03-25 12:47:40 +07:00
meirzamoodle
6a28e0641e MDL-63128 cachestore_redis: Support Redis cluster as cache store
Co-authored-by: Daniel Thee Roperto <daniel@theeroperto.com>
Co-authored-by: Avi Levy <avi@sysbind.co.il>
2024-03-25 12:47:40 +07:00
Eloy Lafuente (stronk7)
361dfe8145
MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces:
- https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
- https://www.php.net/manual/en/reflectionproperty.setaccessible.php
- https://www.php.net/manual/en/reflectionmethod.setaccessible.php

As of PHP 8.1.0, calling this method has no effect; all methods are
invokable by default. So, let's remove all uses from core, they are
no-op.
2024-03-10 21:15:00 +01:00
Eloy Lafuente (stronk7)
29a541724f
MDL-65292 style: Fix all the function declaration ordering
This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration

It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.

So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.
2024-02-28 23:47:47 +01:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Dmitrii Metelkin
68c725f8b1 MDL-79185 cache: don't throw exception if cache data is corrupted 2023-11-22 12:45:48 +11:00
Huong Nguyen
5e0b16fa29 MDL-66546 caching: Improve Redis help text 2023-11-08 11:17:45 +07:00
Juan Carrera
63a7ce5108 MDL-66546 caching: Add support to unix:// connections to redis. 2023-11-02 16:04:54 +01:00
Jun Pataleta
94bc2cd38b
MDL-79551 versions: bump all versions and requires near release 2023-10-04 13:57:17 +08:00
sam marshall
0f8577784d MDL-78467 core_cache: Improve cache locking API
* Makes it possible to safely call acquire_lock so that it throws an
  exception instead of returning false if it can't get a lock (which
  most existing uses assumed it already does).
* Fix some omissions from the requirelockingbeforewrite option (it
  now checks on delete).
* Modinfo uses a versioned cache, so it is not necessary to delete
  items, only increase the version. (Provided we keep track of
  cacherev carefully...)
2023-09-14 09:28:10 +01:00
Ilya Tregubov
4fa5a40f34
Merge branch 'MDL-76865-master' of https://github.com/daledavies/moodle 2023-09-06 14:48:15 +08:00
Ilya Tregubov
b327210cd2
Merge branch 'MDL-78615' of https://github.com/paulholden/moodle 2023-08-29 13:32:46 +08:00
Brendan Heywood
482758b1df MDL-79150 cache: Improve requirelockingwrite error 2023-08-24 10:39:12 +10:00
Paul Holden
8462e7880d
MDL-78615 cache: display failure notifications deleting lock/store. 2023-08-21 10:45:11 +01:00
Dale Davies
af91ae626a MDL-76865 core: Check lock state before attempting to acquire a lock 2023-08-14 12:34:14 +01:00
sam marshall
8df2ac4e98 MDL-78109 core_cache: Remove harmful requirelockingwrite/read options
These cache options are not used in core and would cause a performance
cost without any benefit if ever used. Also they don't work properly.
2023-07-12 15:33:15 +01:00
Andrew Nicols
d1effac984
Merge branch 'MDL-78552' of https://github.com/skodak/moodle 2023-06-29 11:34:53 +08:00