It's important to say that this bug apparently (till now) only happens
when an *incorrect* instalation of a site happens, reusing the dataroot
from another existing site.
When that happens, the localcache/bootstrap.php file from the old
site is reused, setting siteidentifier and SYSCONTEXTID when it's not
time for them to be defined yet.
Their existenece leads to reusing some other structures from the old
dataroot (that, again, should have been changed or wiped!), ultimately
leading to all sort of errors about non-existent tables (course,
context...).
With this change we ensure that:
1) Whenever any change to the database configuration (prefix, user,
type..) happens, it's detected and immediately the information
in the localcache/bootstrap.php is discarded and the file removed.
This should fix problems like MDL-73098 itself.
2) We only set SYSCONTEXTID if the file is not stale. Main reason
for doing that check within the localcache/bootstrap.php file
itself is that we cannot "undefine" it @ setup.php. This should
prevent errros like MDL-72888 to happen.
3) Finally, little detail, we only define SYSCONTEXTID if it has
not been defined earlier. In the past, it was recommended to
define it in config.php (exactly to save one DB read) and, sites
having them will face "already defined" warnings.
It is still used widely in the plugins that would stop working suddenly
without being warned via a debugging message. We must keep it forever as
an alias for the wwwroot.
The new setting will allow to host the temporary backup files
into a specific target directory. Defaults to '$CFG->tempdir/backup'.
Calling make_backup_temp_directory() checks that the required sub-directory
will be properly created under the new target directory.
Before this patch behat_dataroot for parallel runs
were created at same level as ->behat_dataroot
After this patch, it will be created 1 level under
->behat_dataroot with BEHAT_PARALLEL_SITE_NAME
prefix and run number as suffix. This will allow
common files as test enabled and parallel run info
to be saved in parent directory and access it easily.
Units tests have been adjusted e.g. 'boost' instead of 'clean' in pix urls.
Some places I didn't update the test to reflect the boost markup and reset
the theme to clean. This is because the test was not testing the markup - but the
functionality (e.g. looking for specific structures to indicate an error in a form element).
Moodle 3.2 and up will require PHP >= 5.6.5. Hopefully some day we'll
have this centralized with MDL-39007, just it's not done yet.
Thanks to Stephen Bourget for raising this!
dirname() is a slow function compared with __DIR__ and using
'/../'. Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code. This allows those required includes to perform as
best as possible in this situation.
The admin setting updateautodeploy no longer exists. The two existing
config.php flags $CFG->disableupdateautodeploy and
$CFG->disableonclickaddoninstall merged into a single one.
This patch replaces all homegrown timezone
stuff with standard PHP date/time code.
The main change is the introduction of core_date
class that returns normalised user and server
timezones. From now on nobody should be using
$CFG->timezone or $user->timezone directly!
Other new features and fixes:
* admins are prompted for timezone during install
* editing of other users is finally fixed
* timezones are displayed in user profile
* new $this->setTimezone() in phpunit
* time locale is now automatically reset in phpunit
* timezone is now automatically reset in phpunit
* phpunit has Australia/Perth as default timezone
Both $CFG->logsql and $CFG->dblogerror had no use in moodle core
since ages ago (just the former had one use for nothing). Good time
to get rid of both as they are 100% misleading.
1. Create behat datadir within behat_dataroot not at same level
2. Define suffix for link and not use hard-coded values
3. Renamed ns_parallel to run.php
4. Rename variables to best understand them
5. Added support for each run to specify db, prefix, rerun and profile.
6. Showing number of steps in each line of parallel run.