Whoops will only be used under the following conditions:
- Not an AJAX request
- Not a CLI usage
- debugdisplay is set
- composer dependencies are installed
- Whoops is available
- The configuration setting is enabled
In order to get compatibility with PHP 8.1 there are 2 options:
1) Move to the Goutte 2 mink driver, that uses Goutte 4.
2) Move to the BrowserKit mink driver.
While 1) could sound like the easier alternative, and that is
what we are doing right now, there are a few points to take into consideration.
a) Goutte 4 is a complete wrapper over BrowserKit. 100%. See its
source code: https://github.com/FriendsOfPHP/Goutte/blob/master/Goutte/Client.php
b) The mink extension still doesn't support Goutte 4, but supports
BrowserKit. See https://github.com/FriendsOfBehat/MinkExtension (PR#16)
(we could workaround this by forking the package again)
c) Last, but not least, recently (June 2023) both the MinkGoutteDriver
and Goutte itself have been archived/abandoned:
- https://packagist.org/packages/behat/mink-goutte-driver
- https://packagist.org/packages/fabpot/goutte
So, given the points above, this is an attempt to move away
completely from Goutte and straight use the BrowserKit alternative
that, in practice, is the very same code that we are already using
(you can see that, in the .lock changes there isn't any new thing
being installed, because, as said, we are using it already).
Let's see how complex it is, I imagine it won't be hard. Surely killing
all references everywhere about Goutte will be the most complex task.
This bumps direct dependencies to current ones:
- phpunit: 9.5.x No updates here, there is the 9.6.x series
available but a lot of deprecation warnings have been
introduced there without any alternative to use. See:
- https://github.com/sebastianbergmann/phpunit/issues/5160
- https://github.com/sebastianbergmann/phpunit/issues/5062
- ...
While that will be handy to prepare ourselves to PHPUnit 10
in some months... we cannot force everybody to jump to 9.6.x
because that will make a lot of tests to start emitting
warnings.
So we stay with PHPUnit 9.5.x for the life of this branch.
- mink-phpwebdriver: 1.2.1 No updates here, just changed the
constraint because we cannot advance to 1.3.x yet, there is
a change there causing some app tests to fail. See:
- https://github.com/oleg-andreyev/MinkPhpWebDriver/pull/81
So we stay with 1.2.x until that issue is fixed/clarified,
only then we'll review the status.
- behat: 3.12.x => 3.13.x
And also, automatically, a bunch of 2nd and deepest dependencies.
Generated with php80 that is the lowest php version supported
by this branch and, also, by some of the dependencies, as per
documented @ https://moodledev.io/general/development/tools/composer
Worth mentioning behat/mink-goutte-driver, that we should move
to mink-browserkit-driver, but that's out from this issue scope.
Now that the required PHP version has been raised to php80, set
it in the composer.json file and regenerate everything, following
the instructions @ https://docs.moodle.org/dev/Composer .
The only changes, as agreed in the issue are:
- Raise min PHP version to 8.0 (from 7.4).
- Make the php-sodium extension required (was optional).
- Small behat/behat bump to 3.12.0 (from 3.11.0)
Normal removal procedure:
- Remove the plugin completely from core.
- Document it in the webservices upgrade.txt file.
- Add a core upgrade step to proceed to remove any configuration
if the plugin has not been re-installed manually.
Plus:
- Remove a few remaining uses in the hub/sites registration scripts,
that were moved from xmlrpc to hand.made rest calls by MDL-31436
(Moodle 3.4.1 and up) and never removed then.
- Remove the php-xmlrpc extension as a recommendation in composer.
- Remove "xmlrpc" from various comments, trivial cleanup.
Note:
- While working on this MDL-76078 has been created about to
fix a serious design problem detected (it does not affect
functionality). That's out from this issue scope.
This automatically comes with Goutte client 4.x that is
the one we want to, also, update.
It should work 100% the same and comes with some php81
warnings cleaned.
We were using our fork of the mink extension:
https://github.com/moodlehq/MinkExtension.git
Because they bumped requirements to PHP 7.4 too early for us. Now,
with Moodle 4.1, finally our requirements are also PHP 7.4, so we
can stop using the fork and switch to the upstream one:
https://github.com/FriendsOfBehat/MinkExtension
Note this only can be done in 4.1dev, because this is the first
version using PHP >= 7.4. Older branches will need to continue
using the fork. Also, note that we may need to go back to the
fork if there is any future trouble with the upstream library
not matching our supported PHP versions.
Apart from that, it's a good moment to bump other components to
current ones.
Of course, this has been generated following the instructions:
https://docs.moodle.org/dev/Composer
And using PHP 7.4 (always the min version supported) to generate
the lock file.
Now that the required PHP version has been raised to php74, set
it in the composer.json file and regenerate everything, following
the instructions @ https://docs.moodle.org/dev/Composer, also
with php74.
That's the only change (raised php version) as far as no change
has been performed to extension.
Upstream behat/mink-extension isn't updated since 2018.
So we switch to friends-of-behat/mink-extension until
upstream situation is clarified.
But friends-of-behat/mink-extension has some PHP8 issues
that, at the time of writting this, have not been solved:
- https://github.com/FriendsOfBehat/MinkExtension/pull/9
So we are temporarily changing to one fork:
https://github.com/moodlehq/MinkExtension
Whenever those issues are solved by friends-of-beha or behat
we will change back to them and remove our fork.
Generated with composer 2.x and PHP 7.3
This commit updates the composer dependencies to make use of the updated
version of moodlehq/moodle-behat-extension which depends upon the
php-webdriver/webdriver and relevant Mink WebDriver.
This makes everything to break, but it's what we'll be fixing
in the next commits, heh. :-)
Generated with php72 (min version supported), following the
instructions @ https://docs.moodle.org/dev/Composer
(using php71 for this branch)
This uses a new version of the moodlehq-behat-extension which ensures
that a node is visible and in the view port before it is clicked on.
This resolves an issue with Firefox on Ubuntu 18.04 whereby the node is
only brought into the viewport instead of clicked on.
With behat extension v3.38.2 we started requiring php 7.1.0
(same requirement than core 3.8.x). This bumps all the components
in the lock file to suit that requirement.
Generated with php 7.1.x.
It seems that https://github.com/instaclick/php-webdriver/pull/91
is being ignored (in fact the repository itself doesn't show much
activity). So we have decided to fork it and apply any fix able
to keep our (non-marionette) runs working.
Hopefully, soon, the new W3C drivers will be supported by our
behat->mink stack... and we'll be able to move to it (from current
JSonwire drivers). So all this will be hostory.
To generate a new composer.lock for a given Moodle branch:
- Remove composer.lock
- Remove vendor
- Remove composer caches:
php composer.phar clearcache
- Using lower PHP version supported (7.1.x for Moodle 3.7), update:
php composer.phar update
https://docs.moodle.org/dev/Composer#How_to_prepare_and_submit_composer_changes
This change moves all operations which deal with the fetching/updating, or
setting of files from the file_storage class into a new file_system class.
A new file_system can be specified in the config.php and used to replace
all relevant methods in order to move the file system component to an
alternative solution.
Stats definition was being shared between
progress and moodle_progress format which
was causing double counting. Now they both
have there own stats counter definitions