202 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
4003e31983 MDL-73785 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- When belonging to other components and being valid api:
  - analytics related tests have been moved to tests/analytics subdir.
  - backup & restore related tests have been moved to tests/backup subdir.
  - events related tests have been moved to tests/event subdir.
  - privacy related tests have been moved to tests/privacy.
  - task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
  needed now that they are namespaced):
  - some xxxlib_test.php have been renamed lib_test.php
    (when they where testing the corresponding lib.php).
  - cache stores tests have been all renamed store_test, originally
    each one had its own name (file_test, apcu_test, redis_test...)
  - assign feedback tests have been all renamed feedback_test, originally
    each one had its own name (file_test, editpdf_test...)
2022-03-03 12:19:30 +01:00
Helen Foster
7ff6b2daef MDL-73812 lang: Import fixed English strings (en_fix) 2022-02-18 15:50:26 +00:00
Jackson D'souza
18de3388f8 MDL-69088 cache: Make file cache store purge async 2022-02-03 10:30:09 +00:00
Eloy Lafuente (stronk7)
c11096576a Merge branch 'MDL-72619-master' of https://github.com/sammarshallou/moodle 2021-11-03 18:15:28 +01:00
sam marshall
9c29979b8b MDL-72596 core_cache: Track cache I/O size in perfdebug
For cache types which mean this information can be obtained without a
significant performance cost (i.e. just by calling strlen and not
having to serialize something that wasn't serialized already),
this change calculates the size of data read from or written to cache
in each request and includes it in the perfdebug table at bottom of
output (when that is turned on).

This supports the following cache types:

* File store
* Redis (only if caching is enabled)
2021-10-19 17:00:48 +01:00
sam marshall
1b94bb8c20 MDL-72619 core_cache: Provide admin page to view cache size estimates 2021-10-11 16:49:21 +01:00
sam marshall
8ddfa20121 MDL-72328 cachestore_redis: Add TTL support for Redis cache
A list of times for each cache key in a TTL cache is kept in a Redis
sorted list, which can be queried efficiently to delete expired
cache items later in a scheduled task.

This change makes set and delete 2x slower (only for caches which use
TTL) but there is no impact on get performance.
2021-09-21 13:43:11 +01:00
Eloy Lafuente (stronk7)
9d6aa39985 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:11:07 +02:00
Marina Glancy
2d059d1657 MDL-70901 cache: @ no longer masks errors in unlink in php 8 2021-02-22 16:17:49 +01:00
Ferran Recio
e161edc97a MDL-70309 libraries: upgrade mongodb integration files 2021-01-22 14:41:12 +01:00
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
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
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
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
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
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
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
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
Paul Holden
114973b549 MDL-59326 admin: use passwordunmask element for shared secrets. 2019-03-29 09:27:45 +00:00
Eloy Lafuente (stronk7)
c071eefced NOBUG: Fixed file access permissions 2019-03-21 20:19:27 +01:00
Victor Deniz Falcon
02a5d26bd5 MDL-54592 cachestore_mongodb: check MongoDB server connection
The connection to the MongoDB server is checked on the creation and
deletion of a cache store instance. If the connection fails during
creation, the instance is set as not ready. Before deleting a instance,
a new cachestore_mongodb object is created, and connection checked.
There is no reason to check again the connection in the instance_deleted() method.
2019-03-18 11:11:01 +00:00
Víctor Déniz Falcón
2a944b5b41 MDL-54592 cachestore_mongodb: MongoDB cache store use new driver.
The scope of this change is limited to modifying the MongoDB cache
plugin to use the new version of the driver that accepts PHP 7.x
versions. Following the instructions in the official MongoDB
documentation, https://docs.mongodb.com/php-library/current/, the
MongoDB PHP Library was included and used.
2019-03-15 13:50:51 +00:00
Víctor Déniz Falcón
b3c0e79678 MDL-54592 cachestore_mongodb: add MongoDB PHP Library
The new mongodb extension provides a limited API. The MongoDB PHP adds a
high level abstraction layer that provides methods for CRUD operations
and common commands. This version of MongoDB PHP Library requires
the PHP mongodb extension >= 1.5.
2019-03-15 13:50:51 +00:00
Helen Foster
65d70aa81b MDL-64509 lang: Import fixed English strings (en_fix)
Significant string change: enablerunnow_desc,tool_task - including
mention of pathtophp requirement
2019-01-07 14:40:34 +01:00
Eloy Lafuente (stronk7)
085353b315 MDL-64282 versions: bump all versions and requires near release
version = 2018120300 release version
requires= 2018112800 current rc2 (week7roll1) version
2018-11-29 18:24:08 +01:00
Helen Foster
0c19b2c8fa MDL-63730 lang: Merge English strings from the en_fix language pack
Significant string changes:

* withselectedusers_help, core - removing mention of 'Add a common note'
  as the option no longer exists
* considereddigitalminor and digitalminor_desc, core - more
  child-friendly wording
* configmessagingallusers, core_admin - clearer explanation
* auth_dbtype, auth_db - fixed broken link
2018-10-26 12:48:40 +02:00
Shamim Rezaie
19fc6012cf MDL-63554 cachestore_session: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 12:48:31 +02:00
Shamim Rezaie
936c06f8bb MDL-63554 cachestore_redis: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 12:48:30 +02:00
Shamim Rezaie
a42c9a71bb MDL-63554 cachestore_mongodb: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 12:48:30 +02:00
Shamim Rezaie
81684f7c8b MDL-63554 cachestore_memcached: Support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 12:48:30 +02:00
Andrew Nicols
666196271f MDL-60630 cachestore: Remove memcache plugin 2018-09-12 21:07:01 +08:00
Andrew Nicols
31b02f6ef5 MDL-63050 cachestore_redis: Update hExists to check empty 2018-08-02 10:59:53 +08:00
Eloy Lafuente (stronk7)
57ea6753d3 MDL-62361 versions: bump all versions and requires near release
version = 2018051400 release version
requires= 2018050800 current beta+ (week4roll1) version
2018-05-09 02:46:30 +02:00