538 Commits

Author SHA1 Message Date
Ferran Recio
4b948f8a50 MDL-70309 libraries: upgrade mongodb to version 1.8.0 2021-01-22 14:41:12 +01:00
Michael Aherne
2385ae7ee2 MDL-65941 cache: Prevent cache config failure on redis problems. 2020-11-11 14:33:22 +08:00
Andrew Nicols
b8bf6f9c42 MDL-70137 cache: Write config to temp file and move into place 2020-11-06 19:15:43 +00:00
Andrew Nicols
db8377b53e MDL-70137 cache: Use sensible default when reading MUC config
When we read the MUC configuration, a file which exists but is empty
will not error, but will cause all configuration to be empty.

We already perform an {{is_array()}} check on the {{$configuration}}
variable, but the default value for {{$configuration}} is an empty
array. In the case where the file exists, but is empty, no errors occur
when the file is loaded, and the initial {{$configuration}} value is
not overwritten, leading to the file being replaced with an empty copy.
2020-11-06 19:15:34 +00:00
Eloy Lafuente (stronk7)
3a5641cb74 MDL-67673 phpunit: Remove deprecated assertEquals() params
The optional parameters of assertEquals() and assertNotEquals()
are deprecated in PHPUnit 8 (to be removed in PHPUnit 9):

- delta => use assertEqualsWithDelta()
- canonicalize => use assertEqualsCanonicalizing()
- ignoreCase => use assertEqualsIgnoringCase
- maxDepth => removed without replacement.

More info @ https://github.com/sebastianbergmann/phpunit/issues/3341

Initial search done with:

ag 'assert(Not)?Equals\(.*,.*,' --php

Then, running tests and fixing remaining cases.
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f94195c320 MDL-67673 phpunit: Remove deprecated assertInternalType()
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

assertInternalType() is deprecated and will be removed in
PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(),
assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(),
assertIsResource(), assertIsString(), assertIsScalar(),
assertIsCallable(), or assertIsIterable() instead.
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Peter Burnett
3d49421a21 MDL-68440 cache: Added counting of default mappings 2020-10-12 11:41:00 +10:00
Peter Burnett
ba9fc5ed57 MDL-41492 cache: Added ability for alternate cache config 2020-09-28 15:12:33 +10:00
Andrew Nicols
1c4b3ee262 MDL-42012 cache: Fix missing return value 2020-09-15 11:46:31 +08:00
Andrew Nicols
7f7df727c2 MDL-42012 cache: Valid definitions are required even when disabled 2020-09-09 14:04:17 +08:00
Andrew Nicols
d98bbcbbe6 MDL-42012 cache: Fully disable cache for disabled cache factory 2020-09-09 14:04:05 +08:00
Andrew Nicols
063c9ee94f MDL-42012 cache: Allow data sources to work when caching is disabled 2020-09-09 13:59:41 +08:00
Eloy Lafuente (stronk7)
9a79c34eb6 MDL-69479 upgrade: Change all 4.0 occurrences to 3.10
Under parallel development, when something is worth being commented
in upgrade.txt notes, it will be applied to all the development branches
using the "earliest" one to be released. So, if something changes
in 3.10 (and also is applied to master), the upgrade.txt notes will
show 3.10 in both branches.

Of course, if something only goes to one dev branch (say master), then the
master version will be used in the notes (4.0 in this case).
2020-08-21 23:57:17 +02:00
Eloy Lafuente (stronk7)
fbb0767536 MDL-69475 versions: bump all versions and requires in master
version = 2021052500 release version
requires= 2021052500 same than version

Why 20210525? (25th May 2021) ?

Because master is going to be Moodle 4.0, to be released
on November 2021. And, until then, we are going to have
a couple of "intermediate" releases:

- Moodle 3.10 to be released 9th November 2020. (2020110900)

  This version will be using versions from today to 2020110900
  (once it's released the YYYYMMDD part stops advancing).

- Moodle 3.11 to be released 10th May 2021. (2021051000)

  This version will be using versions from 3.10 release to 2021051000
  (once it's released the YYYYMMDD part stops advancing).

That means that all versions from today to 2021051000 are going
to be used by those 2 "intermediate" releases (3.10 and 3.11).

And we cannot use them in master, because it's forbidden to have
any overlapping of versions between branches (or different upgrade
paths will fail).

So, get that 2021051000, let's add it a couple of weeks to cover
the on-sync period (or a 2 weeks delay max!) and, the first version
that master can "own" in exclusive (without any overlap) is, exactly,
25th May 2021, hence our 20210525.
2020-08-18 00:47:15 +02:00
Mihail Geshoski
566b73fbfc MDL-67594 core_lock: Deprecate extend() 2020-07-06 13:04:33 +08:00
Mihail Geshoski
80736a93aa MDL-67594 core_lock: Deprecate extend_lock() 2020-07-06 13:03:08 +08:00
Mihail Geshoski
4b71cdcd89 MDL-67594 core_lock: Deprecate supports_recursion() 2020-07-06 13:01:16 +08:00
Eloy Lafuente (stronk7)
489b82b22a Merge branch 'MDL-69005' of https://github.com/paulholden/moodle 2020-06-10 17:52:53 +02:00
Paul Holden
2d70187ade MDL-69005 cache: fix private $store access in loader. 2020-06-10 10:31:47 +01:00
Eloy Lafuente (stronk7)
e69ab798dd MDL-68973 versions: Fix other small details
Thanks to Luca Bösch and Matteo Scaramuccia that detected
these 2 minor, but ugly details in core version files:

1) Adding comments pointed to versions (3.x, 20190801...) is not
   recommended, they easily come outdated.
2) Using plugin->release in core is no sense. Core plugins belong
   to the core release.

This commit just gets rid of them. That's all.
2020-06-09 20:27:30 +02:00
Eloy Lafuente (stronk7)
115cc0214f MDL-68973 versions: bump all versions and requires near release
version = 2020061500 release version
requires= 2020060900 current rc1 (week7roll1) version
2020-06-09 16:23:09 +02:00
Brendan Heywood
9f4bb48e40 MDL-68329 cache: Improve cache performance footer info 2020-04-28 10:08:28 +10:00
Helen Foster
a753f4f9a1 MDL-67979 lang: Import fixed English strings (en_fix)
Significant string changes:

* configcustommenuitems,core_admin - corrected example
* custommenuitems_desc,tool_mobile - fallback behaviour of custom menu
  items in the app
2020-02-25 12:21:09 +01:00
Shamim Rezaie
02c64a4c1b MDL-67385 libraries: Upgrde mongodb to version 1.5.1 2019-12-16 17:42:08 +11:00
Shamim Rezaie
5a28e4ec05 MDL-67385 libraries: Move readme_moodle.txt out of the library directory 2019-12-16 16:58:51 +11:00
Eloy Lafuente (stronk7)
d5be859063 MDL-67199 versions: bump all versions and requires near release
version = 2019111800 release version
requires= 2019111200 current beta (week7roll1) version
2019-11-12 17:57:08 +01:00
Marina Glancy
bcfa5e248c MDL-67087 cachestore_redis: fix warning in phpunit 2019-10-30 18:52:22 +01:00
Eloy Lafuente (stronk7)
f4feabb83f MDL-66968 php74: array_key_exists() for objects is deprecated
Replace it for correct property_exists() when the element
being inspected is a property of object/class.

Amended and squased changes:
- keep mongo unmodified. The information is array, hence correct.
- fix a couple of messaging phpdocs that were incorrect.

Amended take#2:
- As far as mongo resturns BSONDocument that is ArrayObject, aka
implements ArrayAccess, we have decided to explicitly cast results
to array so existing array_key_exists() and other accesses will
continue working the same.
2019-10-25 00:49:04 +02:00
Mark Nelson
de0b6d938c MDL-66428 cachestore_redis: add Zstd compression support 2019-10-07 19:03:43 +01:00
Mark Nelson
493295e326 MDL-63127 cachestore_redis: dont use compression unless specified 2019-10-07 18:23:10 +01:00
Eloy Lafuente (stronk7)
f232409e13 MDL-63127 cachestore_redis: cover combinations without compressor
To verify that, internally, everything is stored as expected
and there aren't hidden regressions
2019-10-07 18:23:10 +01:00
Mark Nelson
182a0698e1 MDL-63127 cachestore_redis: clean up compressor_test.php 2019-10-07 12:12:48 +01:00
Mark Nelson
4ccbb67474 MDL-63127 cachestore_redis: do not return early without unserialisation 2019-10-07 12:12:48 +01:00
Mark Nelson
3ad56eee9f MDL-63127 cachestore_redis: add check before using igbinary_serialize
Redis::SERIALIZER_IGBINARY is undefined if redis is not compiled
with this option.
2019-10-07 12:12:48 +01:00
Mark Nelson
54a659a5bd MDL-63127 cachestore_redis: delegate functionality to specific areas
These functions should not have to worry about compression logic.
2019-10-07 12:12:48 +01:00
Mark Nelson
ac19c888b0 MDL-63127 cachestore_redis: set pair value correctly 2019-10-07 12:12:48 +01:00
Daniel Thee Roperto
cda3e431ca MDL-63127 cachestore_redis: Implemented compression 2019-10-07 12:12:48 +01:00
Jake Dallimore
9e93b2f20e Merge branch 'MDL-66139' of https://github.com/stronk7/moodle 2019-08-29 11:51:06 +08:00
Netica Informática
d17bf23e8a MDL-66139 cachestore_redis: Fix connection problems when port is not set
Due to some changes in Redis 5 php extension Moodle fails to connect via TCP when
no port is set. It's fixed upstream in phpredis repo (version 5.0.0, 5.0.1 and
5.0.2 affected so far), but with this patch we'll send the right port anyway.
2019-08-28 20:57:40 +02:00
Mark Nelson
8e86a8d2db MDL-60341 core_cache: show cache definitions that can use local store 2019-08-28 14:00:38 +08:00
Eloy Lafuente (stronk7)
f795e2008f NOBUG: Fixed file access permissions 2019-07-11 23:33:29 +02:00
Víctor Déniz Falcón
8b7d951046 MDL-65772 cachestore_mongodb: fix the version number of the library 2019-07-01 12:40:59 +01:00
Tim Hunt
376b7fb857 MDL-65492 cache admin: make it easier to purge a cache repeatedly
This can be a big time-saver, e.g. during development.
2019-06-12 13:23:06 +01:00
Tim Hunt
1baf3af3e8 MDL-65492 cache admin: make the code easier to understand 2019-06-12 13:23:03 +01:00
Eloy Lafuente (stronk7)
c9a1a6341c MDL-65571 versions: bump all versions and requires near release
version = 2019052000 release version
requires= 2019051100 current beta (week6roll2) version
2019-05-12 23:46:34 +02:00
David Monllaó
f82701acad Merge branch 'MDL-59326' of https://github.com/paulholden/moodle 2019-04-15 07:47:33 +02:00
Leon Stringer
36b6444420 MDL-64719 cache: Implement purge_current_user() in \cache
\cache::make() may return a cache_disabled subclass but callers, specifically
user/lib.php:user_create_user(), invoke \cache::purge_current_user() which was
only implemented by the cache_session subclass.  Added empty
\cache::purge_current_user() which subclasses can implement, i.e.
cache_session, or not, i.e. cache_disabled.
2019-04-01 15:29:39 +01:00
Paul Holden
114973b549 MDL-59326 admin: use passwordunmask element for shared secrets. 2019-03-29 09:27:45 +00:00