The PSR-4 specification does not preclude a single namespaces from
having multiple sources. This is the case for several PSR standards
including standard packagist packages distributed by PSR:
- PSR-7 - HTTP Message Interfaces: \Psr\Http\Message
- PSR-17 - HTTP Factories: \Psr\Http\Message
- PSR-15 - http-server-handler: \Psr\Http\Server
- PSR-15 - http-server-middleware: \Psr\Http\Server
This commit will implement the Guzzle library in core
to make it usable in different locations.
Co-Authored-By: Andrew Nicols <andrew@nicols.co.uk>
Co-Authored-By: Safat Shahin <safat.shahin@moodle.com>
Right now we have the information only in docs:
- https://docs.moodle.org/dev/Core_APIs
- https://moodledev.io/docs/apis
And, in fact, we are crawling those pages to get the information
from various tools (moodlecheck, CiBoT...). Obviously, that's far
from ideal, the source only has the current list of APIs, and
there isn't much information there but the names.
So we are moving the source of information to be in core, so it
can be modified between branches, and contains richer information:
- The component the API belongs to, usually a subsystem or core.
- If the API can be used as level 2 namespace.
- If the API can be used as level 2 namespace out from its component.
Note that all that information has NO USES right now in core (and maybe
never will), but tools/checkers will benefit enormously by having that
information at hand, so we can check for namespaces, categories and
other bits way better.
Also, once we have this, the APIs dev documents linked above, surely
can be improved by being automatically generated and include all the
meta-information available.
It also includes a very basic json schema validating the basis. It can
be tried online @ https://www.jsonschemavalidator.net , or any other
tool. PHP requires extra libraries to be able to perform the validation.
Covered with unit tests, both api-related functions and structure validation.
As the message_jabber notification plugin has been removed from core,
the XMPPHP library (aka Jabber) is not required any more so it has
been completely removed from Moodle core too.
The core_component::$ignoreddirs lists all directories that are reserved
and cannot be used as valid plugin names. This is particularly important
for some plugin types such as 'webservice' that share the same root
location as the core subsystem of the same name.
components are loaded very early in Moodle bootstrap/warmup
process. So, basically, core_component must be vanilla php
and moodlelib/weblib facilitites are not available yet.
So, changing debugging() call to error_log(), to make it
consistent with the rest of the calls in the method.
Added static caching of classes to reduce load times and reduce calls to `get_component_classes`
by altering to accept a null component value to search classmap only once.
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.
This commit is part of work on Custom fields API,
to minimize commit history in moodle core the work of a team of developers was split
into several commits with different authors but the authorship of individual
lines of code may be different from the commit author.
These components have no classes and no strings and have no purspose. Component core_hub is responsible
for storing data, defining classes and strings for site registration and course publishing
This also reverts MDL-61945