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.
There are two essential improvements here. Firstly, by replacing the
file_exists() check with array_key_exists() we make sure that only
actual language code will be written into the config.php file (and not
the empty value in case of input that does not pass the PARAM_SAFEDIR
cleaning).
Additionally, we no longer display the full list of available languages
by default. The list can be displayed in the interactive mode by typing
the ? character instead of the language code. This makes the overall
interface cleaner, does not cause the header information (such as the
Moodle version) to scroll away and makes the nice cli logo more visible
(which was the main motivation for the whole patch anyway ;-).
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
This reverses the references used for global $USER and $SESSION,
the reason is that PHP does not allow references to references.
$USER is a reference to $GLOBALS['USER'] which means we cannot
put any references to it. Solution is to store the current user and session
objects in $GLOBALS['USER'] and $GLOBALS['SESSIOn'] are reference
them in $_SESSION.
This patch makes the session code behave the same way in CLI,
phpunit and normal web requests - this allows use to finally
unit test most aspects of the session code in Moodle.
Useful for backing up a single course. Accepts parameters:
--courseid=INTEGER Course ID for backup
--courseshortname=STRING Course shortname for backup.
--destination=STRING Path where to store backup file. If not set, the backup
will stored within the same course backup area.
Includes:
* update checker refactored to \core\update\ namespace
* plugininfo classes refactored to \core\plugininfo\ namespace
* plugin_manager renamed to core_plugin_manager
* redirect back to original page after plugin uninstall
* fixed assign subplugin uninstall
* move assign subplugins under the assignment in admin tree
* fixed plugininfo for all question related plugin types
* auth uninstall support
* added missing block dependencies
* added theme uninstall
* subplugin types are following the plugin on plugin overview page
* several performance improvements in plugin manager
* new warnigns when plugininfo are outdated or missing
* multiple fixes and other improvements
List of changes:
* New OOP API using PHP namespace \core\session\.
* All handlers now update the sessions table consistently.
* Experimental DB session support in Oracle.
* Full support for session file handler (filesystem locking required).
* New option for alternative session directory.
* Official memcached session handler support.
* Workaround for memcached version with non-functional gc.
* Improved security - forced session id regeneration.
* Improved compatibility with recent PHP releases.
* Fixed borked CSS during install in debug mode.
* Switched to file based sessions in new installs.
* DB session setting disappears if DB does not support sessions.
* DB session setting disappears if session handler specified in config.php.
* Fast purging of sessions used in request only.
* No legacy distinction - file, database and memcached support the same functionality.
* Session handler name included in performance info.
* Fixed user_loggedin and user_loggedout event triggering.
* Other minor bugfixing and improvements.
* Fixed database session segfault if MUC disposed before $DB.
Limitations:
* Session access time is now updated right after session start.
* Support for $CFG->sessionlockloggedinonly was removed.
* First request does not update userid in sessions table.
* The timeouts may break badly if server hosting forces PHP.ini session settings.
* The session GC is a lot slower, we do not rely on external session timeouts.
* There cannot be any hooks triggered at the session write time.
* File and memcached handlers do not support session lock acquire timeouts.
* Some low level PHP session functions can not be used directly in Moodle code.
This commit reinstates:
commit 0bac49dc1983824e4861086ed1ab9e13af99d76d
Author: Marina Glancy <marina@moodle.com>
Date: Tue Sep 3 17:14:13 2013 +1000
MDL-37028 Integrity check for course modules and sections
If section mentioned in 'orphaned' module does not exist module is added to the first available section. Also corrected whitespaces
commit 1f0a9ce48b3e6f8c5dc6628aa692323909925032
Author: Marina Glancy <marina@moodle.com>
Date: Mon Aug 12 14:06:48 2013 +1000
MDL-37028 Integrity check for course modules and sections
created function, unittest, build-in quick integrity check on each call to rebuild_course_cache()
also added CLI script
This is failing unit tests.
This reverts commit 0bac49dc1983824e4861086ed1ab9e13af99d76d.
This reverts commit 1f0a9ce48b3e6f8c5dc6628aa692323909925032.
Improvements include:
* Alternative location might be useful when server administrator wants to maintain
a local copy of component cache instead of using shared $CFG->cachedir.
* Component caching is now enabled in behat tests which should improve performance.
* Standardised ignoring of component caching.
* Fixed debug mode in ABORT_AFTER_CONFIG scripts.
* General documentation improvements.