Commit graph

448 commits

Author SHA1 Message Date
Andrew Nicols
2f36d545a5 Merge branch 'MDL-70233-alternative-disabled-cache-311' of https://github.com/Peterburnett/moodle into MOODLE_311_STABLE 2021-06-22 15:47:41 +08:00
Eloy Lafuente (stronk7)
0524a0b9f9 MDL-71583 versions: Add all the missing full-stops to version/requires
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.

This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:

while read -r line; do
    arr=(${line//:/ })
    if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
        echo "  file ${arr[0]}, line ${arr[1]}"
        sed -i "${arr[1]}s/\$/\./" ${arr[0]}
    fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
2021-05-11 20:00:11 +02:00
Eloy Lafuente (stronk7)
71d0cfefab MDL-71583 versions: bump all versions and requires near release
version = 2021051700 release version
requires= 2021051100 current rc1 (week7roll1) version

Note that, because we are under parallel development period,
this is being done in the branch that is going to be released
(MOODLE_311_STABLE already existing) for Moodle 3.11.0 and
not in master, that is the one getting the bump under normal
(non-parallel) periods.
2021-05-11 18:50:34 +02:00
Peter Burnett
49e201b592 MDL-70233 cache: Disabled factory now gets writer from parent 2021-04-07 15:33:07 +10:00
Eloy Lafuente (stronk7)
c0c276e49d Merge branch 'MDL-70901-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-18 00:40:55 +01:00
Eloy Lafuente (stronk7)
cbf01aa79a MDL-71036 phpunit: Renamed various file-related assertions
In PHPUnit 9.1, the following file-related assertions
have been deprecated and there are new alternatives for
all them:
- assertNotIsReadable()         -> assertIsNotReadable()
- assertNotIsWritable()         -> assertIsNotWritable()
- assertDirectoryNotExists()    -> assertDirectoryDoesNotExist()
- assertDirectoryNotIsReadable()-> assertDirectoryIsNotReadable()
- assertDirectoryNotIsWritable()-> assertDirectoryIsNotWritable()
- assertFileNotExists()         -> assertFileDoesNotExist()
- assertFileNotIsReadable()     -> assertFileIsNotReadable()
- assertFileNotIsWritable()     -> assertFileIsNotWritable()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

ag 'assertNotIsReadable|assertNotIsWritable|assertDirectoryNotExists|\
assertDirectoryNotIsReadable|assertDirectoryNotIsWritable|\
assertFileNotExists|assertFileNotIsReadable|assertFileNotIsWritable'
2021-03-11 23:07:30 +01:00
Brendan Heywood
27758f45f1 MDL-51111 cache: Don't lock and write the config file if unchanged 2021-02-24 12:43:42 +11:00
Marina Glancy
920331e74e MDL-70901 cache: @ no longer masks errors in unlink in php 8 2021-02-22 16:19:37 +01:00
Ferran Recio
e134a42963 MDL-70309 libraries: upgrade mongodb integration files 2021-01-22 14:44:29 +01:00
Ferran Recio
e941b105ac MDL-70309 libraries: upgrade mongodb to version 1.8.0 2021-01-22 14:44:29 +01:00
Michael Aherne
bbb83614d2 MDL-65941 cache: Prevent cache config failure on redis problems. 2020-11-11 14:49:15 +08:00
Víctor Déniz
8752df87ed Merge branch 'MDL-70137-310-2' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2020-11-06 19:16:52 +00:00
Andrew Nicols
511dab1cd3 MDL-70137 cache: Write config to temp file and move into place 2020-11-06 19:16:51 +00:00
Andrew Nicols
b26a5e5e08 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:16:44 +00:00
Eloy Lafuente (stronk7)
b0a1b4ce8b MDL-70089 versions: bump all versions and requires near release
version = 2020110900 release version
requires= 2020110300 current beta+ (week6roll1) version

Note that, because we are under parallel development period,
this is being done in the branch that is going to be released
(MOODLE_310_STABLE already existing) for Moodle 3.10.0 and
not in master, that is the one getting the bump under normal
(non-parallel) periods.
2020-11-03 19:34:52 +01:00
Eloy Lafuente (stronk7)
46606b3ddd 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:05 +02:00
Eloy Lafuente (stronk7)
35bc26b516 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:05 +02:00
Eloy Lafuente (stronk7)
a6674bf8a4 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:46:05 +02:00
Eloy Lafuente (stronk7)
d81a94807b 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:46:04 +02:00
Peter Burnett
0628d11380 MDL-68440 cache: Added counting of default mappings 2020-10-12 11:57:17 +10:00
Peter Burnett
40e41c1997 MDL-41492 cache: Added ability for alternate cache config 2020-09-28 15:14:30 +10:00
Andrew Nicols
e5f0085cdb MDL-42012 cache: Fix missing return value 2020-09-15 11:46:31 +08:00
Andrew Nicols
13e34fb428 MDL-42012 cache: Valid definitions are required even when disabled 2020-09-09 14:05:03 +08:00
Andrew Nicols
c705434a62 MDL-42012 cache: Fully disable cache for disabled cache factory 2020-09-09 14:05:03 +08:00
Andrew Nicols
cfe1a9a8d8 MDL-42012 cache: Allow data sources to work when caching is disabled 2020-09-09 14:05:03 +08:00
Eloy Lafuente (stronk7)
fe9ecef92b 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-24 14:08:46 +08: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