166 Commits

Author SHA1 Message Date
Matt Porritt
d5adb60fa3 MDL-62777 Administration: CLI upgrade new setting notification
During a CLI upgrade when there are new settings in core or in
a plugin, the settings are set to the defined defaults
automatically. There is no ouput shown on the CLI about which
new settings have been introduced or what default values the
setting are set to.

This patch outputs the name of the new setting and what the
default value being is set is to the CLI during an upgrade.
Objects and arrays are expanded into a human readable format.
This plugin also makes the function that sets the defaults to
be more robust so it isno longer required to be called multiple
times to ensure all settings are set.
2018-10-22 14:28:06 +11:00
Mark Johnson
e3389c83b2 MDL-61244 caching: Allow granular purging of caches 2018-06-14 15:04:42 +01:00
Andrew Nicols
f8ad868fad Merge branch 'm35_MDL-60923_New_BackupDir_Setting-v2' of https://github.com/scara/moodle 2018-04-17 09:44:44 +08:00
Matteo Scaramuccia
ef844148a9 MDL-60923 backup: Added $CFG->backuptempdir
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.
2018-04-16 23:50:28 +02:00
Luca Bösch
c3c8cc40be MDL-39035 admin: show old and new version after upgrade in CLI 2018-04-12 18:02:12 +02:00
Jake Dallimore
811808b3d2 MDL-59581 database: removal of mssql bits from admin/ 2018-04-09 01:59:06 +02:00
sam marshall
a938e4096c MDL-60174 core_dml: fix miscellaneous incorrect recordset usage
The new recordset support for Postgres requires transactions and
will cause errors if recordsets are not closed correctly. This
commit fixes problems that were identified during unit tests, and
via some basic code analysis, across all core code. Most of these
are incorrect usage of recordset (forgetting to close them).
2017-11-27 11:10:33 +00:00
Alexander Bias
af25a2b739 MDL-60094 administration: Add CLI script to kill all sessions 2017-09-14 16:03:39 +02:00
Luca Bösch
3437a77552 MDL-59662 database: Typo in variable name. 2017-08-04 10:30:11 +02:00
David Monllao
f510788b44 Merge branch 'MDL-59150-master-3' of git://github.com/ryanwyllie/moodle 2017-07-18 08:27:13 +02:00
Ryan Wyllie
0f268f5db9 MDL-59150 admin: build site theme after CLI install or upgrade 2017-07-18 06:13:07 +00:00
Dan Poltawski
64e57937be MDL-57432 lib: unify PHP version checks
* Introduce a new php compatible library which can be used
  early in execution, without Moodle dependencies
* Use it where we previously had hardcoded checks

This was originally suggested in MDL-39007.
2017-07-10 09:16:55 +01:00
Ryan Wyllie
5dd40ec4b4 MDL-59123 admin: add cli script to compile theme CSS
Added a script to selectively compile theme CSS. In order to allow
compiling on per theme basis without purging all theme CSS in the
local cache I have made some changes to how CSS is compiled and
how it is accessed via local cache.
2017-06-27 06:48:45 +00:00
Adrian Greeve
c05dc071b0 MDL-58729 database: Improve performance of CLI tool.
Imporve the speed with which mysql_collation converts to
a different collation.
2017-06-12 14:03:36 +08:00
Adrian Greeve
0bbefd81cd MDL-48228 database: Make utf8mb4 the default character set for mysql.
Thanks to Jetha Chan for providing the initial patch that this is
based on.
2017-03-01 09:03:12 +08:00
David Mudrák
00eeb686bf MDL-57896 admin: Prevent cfg.php from trying to change hard-set value
Credit goes to Andrew Nicols for spotting and suggesting this check.
2017-02-15 09:23:02 +01:00
David Mudrák
dfefcef2f1 MDL-57896 admin: Introduce the new admin/cli/cfg.php utility 2017-02-09 12:51:19 +01:00
Damyon Wiese
644fcbb629 MDL-55837 themes: base and canvas themes removed
Look for them in the plugins DB if you still need them.
2016-09-19 13:35:13 +08:00
Jun Pataleta
49ccaee5a9 MDL-55206 admin: Some code cleanup
* Removed unnecessary TODOs.
* Changed message prompt case to sentence case.
2016-07-15 14:44:35 +08:00
Jun Pataleta
36b88f2486 MDL-55206 admin: Remove div tags in password policy error message 2016-07-15 14:40:54 +08:00
David Monllao
c68010eaee MDL-55048 cli: Add example using new cool options
Also added short option for ignore password policy.
2016-07-11 15:17:57 +02:00
David Monllao
34127afdb6 Merge branch 'MDL-55084' of git://github.com/prg3/moodle 2016-07-11 15:06:38 +02:00
Paul Greidanus
c248c3f07f MDL-55084 admin: CLI driven password reset
This patch allows for changing a user's password via the command line.
This allows for scripted password changes easily.
2016-07-06 07:00:57 -06:00
Eloy Lafuente (stronk7)
ae96cf6246 MDL-53019 php: bump all harcoded versions to new 5.6.5 requirement
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!
2016-07-05 01:50:43 +02:00
Russell Smith
1fcf0ca8a5 MDL-35628 performance: Remove dirname() where possible.
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.
2016-06-10 08:06:49 +10:00
Jun Pataleta
54285c3ff5 MDL-53260 upgrade: Fix lang help text description. 2016-03-23 14:13:36 +08:00
Jun Pataleta
830f8bc780 MDL-53260 upgrade: Make lang option default to the site language 2016-03-21 15:08:59 +08:00
Nadav Kavalerchik
14aaa2d75b MDL-53260 upgrade: Option to display CLI upgrade messages in English 2016-03-21 11:59:50 +08:00
David Mudrák
6ef02f8479 MDL-51261 admin: Add option to define upgradekey via cli installer 2015-09-24 21:02:33 +02:00
David Mudrák
7d62bc2417 MDL-51403 install: Improve the language validation in the CLI installer
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 ;-).
2015-09-17 21:06:32 +02:00
Charles Fulton
096fd59653 MDL-46167 admin_cli: allow skipping of database installation 2015-07-04 19:15:50 +00:00
Tyler Bannister
7f7144fd50 MDL-47787 course: Added question delete to cm delete. 2015-06-25 16:35:22 -04:00
David Mudrák
394034ec6e MDL-50631 cli: Display the Moodle ASCII logo in the CLI installer header 2015-06-17 22:48:14 +02:00
John Okely
65903c7607 MDL-49842 install: Set front page summary to '' after cli install
This is to prevent front page summary from appearing as a 'new setting'
after the first upgrade of a site installed via cli.
2015-04-16 11:49:22 +08:00
Simey Lameze
0148cd852e MDL-49723 tool: deprecate guess_antolope_row_size method 2015-04-10 09:33:35 +08:00
Petr Skoda
d6e7a63d9a MDL-49684 timezones: rewrite timezone support
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
2015-04-06 13:53:51 +12:00
Andrew Nicols
da992717f4 MDL-28513 install: Add adminemail to the CLI installers 2015-01-21 09:42:51 +08:00
Dan Poltawski
df11019a82 MDL-46235/MDL-46971 mysql_compress_rows: fix typo 2014-10-14 16:36:47 +01:00
Damyon Wiese
a4fa3604e7 MDL-46235 Admin: Fix typos in mysql_compressed_rows.php cli script 2014-08-26 12:32:44 +08:00
Petr Skoda
a45d54b8cb MDL-46235 ddl: add support for large number of text fields in one database table 2014-08-25 12:40:57 +12:00
Petr Skoda
2e00d01db4 MDL-46099 session: fix use of references for session globals
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.
2014-07-01 08:38:00 +12:00
Petr Skoda
4f4fb38cb5 MDL-45985 cli: add new cli tool for validation of database structure 2014-06-17 16:54:31 +12:00
Sam Hemelryk
3f5827459e MDL-39617 backup: language improvements to cli/backup.php 2014-02-04 09:04:01 +13:00
Ruslan Kabalin
d00951b585 MDL-39617 Add cli backup script for a single course backing up.
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.
2014-01-28 13:40:03 +00:00
Petr Škoda
dbe0203ba8 MDL-42931 fix hardcoded PHP version tests for 2.7 2013-12-13 14:04:24 +08:00
Petr Škoda
e87214bda7 MDL-42078 multiple uninstall improvements and cleanup
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
2013-10-07 13:10:36 +02:00
Petr Škoda
1a4621d8e5 MDL-31501 fake requried globals in both installers 2013-09-23 21:46:05 +02:00
Sam Hemelryk
98d696b6d5 MDL-31501 session: fixed missing autoloader during install 2013-09-23 15:38:45 +12:00
Petr Škoda
d79d5ac276 MDL-31501 rework user session architecture
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.
2013-09-21 13:11:56 +02:00
Marina Glancy
cfda8732b7 MDL-37028 fixed statement to clear course cache 2013-09-11 14:57:59 +10:00