17 Commits

Author SHA1 Message Date
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)
a48504f8fb
MDL-79381 core: MoodleNet PHPUnit with the new controllers
Basically the changes imply that:
- For some tests that are using reflection, we need to ensure
  that the backup controller is passed.
- And, whenever used explicitly in tests, it has to be destroyed.
  (note that this leaves out tests running get_package(), because
  that method now instantiates and destroys the controller by itself.
  only tests that get a controller need to destroy it).
- Move from some old functions to the new ones introduced in the issue.
2023-10-05 10:40:33 +07:00
Huong Nguyen
c6bf02a3b5
MDL-78267 core: Backend API for partial sharing course for MoodleNet 2023-09-14 14:59:49 +07:00
David Woloszyn
045d4368f4 MDL-75502 core: Added MoodleNet share progress page 2023-09-12 15:14:39 +10:00
David Woloszyn
aa179d77d8 MDL-77296 core: Record MoodleNet share progress 2023-08-29 11:26:23 +10:00
Safat
933ab5201f MDL-75318 core: Backend api for sharing course to MoodleNet 2023-08-22 11:00:06 +10:00
Safat
a0238f277d MDL-75318 core: Capability to share course to MoodleNet 2023-08-22 11:00:06 +10:00
Paul Holden
a8da761f8b
MDL-77959 moodlenet: void return type style fixes in test. 2023-04-19 17:35:12 +01:00
Paul Holden
5338fc591e
Merge branch 'MDL-77959-master' of https://github.com/HuongNV13/moodle 2023-04-19 17:25:14 +01:00
Huong Nguyen
5548b91e3e MDL-77959 core_moodlenet: Convert activity intro to plaintext 2023-04-19 17:40:21 +07:00
Andrew Nicols
3ac1acacca MDL-77958 moodlenet: Various style fixes
This change contains various style fixes which I encountered and fixed
whilst addressing the other issues identified in this issue.
2023-04-19 16:12:50 +08:00
Andrew Nicols
581ccb9a47 MDL-77958 moodlenet: Pass stored_file to improve memory usage
Previously the content of the stored file was extracted and stored in a
variable, passed around, and then submitted to MoodleNet. This results
in very high memory consumption when dealing with MoodleNet.

The stored_file should be passed around as a first-level param to
discourage this, and the content should _never_ be loaded into memory.
Instead file streams and resources should be used to allow Guzzle/Curl
to buffer the file from disk/other storage straight to MoodleNet.
2023-04-19 16:12:50 +08:00
Paul Holden
fd8184a295
MDL-77954 moodlenet: store packaged activities in user draft.
We shouldn't invent fileareas with invalid values (specifically in
this case, the `itemid` overflowed maximum length of the field on
Oracle).

Given the generated file is transitory in nature, instead store it
in the users draft area.
2023-04-18 18:40:15 +01:00
Michael Hawkins
2e024f304a MDL-75316 core: MoodleNet integration final improvements 2023-04-18 17:00:54 +08:00
Michael Hawkins
77f85ed287 MDL-75316 core: Add activity sender & moodlenet_client to MoodleNet API
This makes it possible to share a single activity to a MoodleNet
instance (which has been enabled for sharing in site admin).
This utilises the core\moodlenet\activity_packager to create an
activity backup, then sends it using the MoodleNet create resource
API specification.

Originally implemented as MDL-75932
2023-04-18 17:04:14 +08:00
raortegar
9bc769a610 MDL-75316 core: Add activity packager to MoodleNet API
This makes it possible to package a single activity as a Moodle backup
file, excluding user data so it is ready to be shared as a MoodleNet
resource.

Co-authored-by: Michael Hawkins <michaelh@moodle.com>

Originally implemented as MDL-75932
2023-04-18 17:03:45 +08:00
Michael Hawkins
d6c4c0fbbd MDL-75316 core: Set up MoodleNet API structure and utilities helper
Initial folder structure and declaring API.
Created utilities class.

Originally implemented as MDL-75932
2023-04-18 17:03:18 +08:00