Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/db/upgradelib.php File Reference

Go to the source code of this file.

Namespaces

namespace  core

Functions

 upgrade_fix_category_depths ()
 upgrade_migrate_files_courses ()
 upgrade_simplify_overkill_pool_structure ()
 upgrade_migrate_user_icons ()
 upgrade_migrate_group_icons ()
 upgrade_migrate_files_course ($context, $path, $delete)
 upgrade_migrate_files_blog ()
 upgrade_fix_incorrect_mnethostids ()
 upgrade_cleanup_unwanted_block_contexts ($contextidarray)
 update_fix_automated_backup_config ()
 upgrade_populate_default_messaging_prefs ()

Function Documentation

This function is used to establish the automated backup settings using the original scheduled backup settings.

Since:
2010111000

Definition at line 638 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

This function is used as part of the great navigation upgrade of 20090828 It is used to clean up contexts that are unique to a blocks that are about to be removed.

Look at blocklib.php::blocks_delete_instance() the function from which I based this code. It is important to mention one very important fact before doing this I checked that the blocks did not override the block_base::instance_delete() method. Should this function ever be repeated check this again

navigation upgrade 20090828 array $contextidarray An array of block instance context ids void

Definition at line 603 of file upgradelib.php.

Here is the caller graph for this function:

Definition at line 34 of file upgradelib.php.

Here is the call graph for this function:

This function will fix the status of the localhost/all records in the mnet_host table checking they exist and adding them if missing + redefine CFG->mnet_localhost_id and CFG->mnet_all_hosts_id if needed + update all the users having non-existent mnethostid to correct CFG->mnet_localhost_id

Implemented because, at some point, specially in old installations upgraded along multiple versions, sometimes the stuff above has ended being inconsistent, causing problems here and there (noticeably in backup/restore). MDL-16879

Get current $CFG/mnet_host records

By wwwroot

By empty wwwroot

Create localhost_host if necessary (pretty improbable but better to be 100% in the safe side) Code stolen from mnet_environment->init

Get the ip of the server

SERVER_ADDR is only returned by Apache-like webservers

Create all_hosts_host if necessary (pretty improbable but better to be 100% in the safe side) Code stolen from mnet_environment->init

Compare old_mnet_localhost_id and current_mnet_localhost_host

Different = problems

Update $CFG->mnet_localhost_id to correct value

Delete $old_mnet_localhost_id if exists (users will be assigned to new one below)

Compare old_mnet_all_hosts_id and current_mnet_all_hosts_host

Different = problems

Update $CFG->mnet_localhost_id to correct value

Delete $old_mnet_all_hosts_id if exists

Finally, update all the incorrect user->mnethostid to the correct CFG->mnet_localhost_id, preventing UIX dupes

Give upgrade at least 60 more seconds

Definition at line 470 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Moves all block attachments

Unfortunately this function uses core file related functions - it might be necessary to tweak it if something changes there :-(

Definition at line 403 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_migrate_files_course ( context,
path,
delete 
)

Internal function - do not use directly

Definition at line 284 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Moves all course files except the moddata to new file storage

Unfortunately this function uses core file related functions - it might be necessary to tweak it if something changes there :-(

Definition at line 83 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Internal function - do not use directly

Give upgrade at least 60 more seconds

Definition at line 233 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Internal function - do not use directly

Give upgrade at least 60 more seconds

Definition at line 178 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

This function is used to set default messaging preferences when the new admin-level messaging defaults settings have been introduced.

Definition at line 681 of file upgradelib.php.

Here is the caller graph for this function:

Moodle 2.0dev was using xx/xx/xx file pool directory structure, this migrates the existing files to xx/xx. This will not be executed in production upgrades...

Returns:
void

Definition at line 111 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations