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

Go to the source code of this file.

Data Structures

class  upgrade_exception
class  downgrade_exception
class  upgrade_requires_exception
class  plugin_defective_exception

Namespaces

namespace  core

Enumerations

enum  UPGRADE_LOG_NORMAL
enum  UPGRADE_LOG_NOTICE
enum  UPGRADE_LOG_ERROR

Functions

 upgrade_main_savepoint ($result, $version, $allowabort=true)
 upgrade_mod_savepoint ($result, $version, $modname, $allowabort=true)
 upgrade_block_savepoint ($result, $version, $blockname, $allowabort=true)
 upgrade_plugin_savepoint ($result, $version, $type, $plugin, $allowabort=true)
 upgrade_plugins ($type, $startcallback, $endcallback, $verbose)
 upgrade_plugins_modules ($startcallback, $endcallback, $verbose)
 upgrade_plugins_blocks ($startcallback, $endcallback, $verbose)
 log_update_descriptions ($component)
 external_update_descriptions ($component)
 external_delete_descriptions ($component)
 upgrade_handle_exception ($ex, $plugin=null)
 upgrade_log ($type, $plugin, $info, $details=null, $backtrace=null)
 upgrade_started ($preinstall=false)
 upgrade_finished_handler ()
 upgrade_finished ($continueurl=null)
 upgrade_setup_debug ($starting)
 print_upgrade_separator ()
 print_upgrade_part_start ($plugin, $installation, $verbose)
 print_upgrade_part_end ($plugin, $installation, $verbose)
 upgrade_init_javascript ()
 upgrade_language_pack ($lang=null)
 install_core ($version, $verbose)
 upgrade_core ($version, $verbose)
 upgrade_noncore ($verbose)
 core_tables_exist ()
 upgrade_plugin_mnet_functions ($component)
 admin_mnet_method_profile (Zend_Server_Reflection_Function_Abstract $function)

Enumeration Type Documentation

UPGRADE_LOG_ERROR = 2

Definition at line 34 of file upgradelib.php.

UPGRADE_LOG_NORMAL = 0

Definition at line 30 of file upgradelib.php.

UPGRADE_LOG_NOTICE = 1

Definition at line 32 of file upgradelib.php.


Function Documentation

Given some sort of Zend Reflection function/method object, return a profile array, ready to be serialized and stored

Parameters:
Zend_Server_Reflection_Function_Abstract$functioncan be any subclass of this object type
Returns:
array

Definition at line 1672 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Checks if the main tables have been installed yet or not.

Returns:
bool

Definition at line 1460 of file upgradelib.php.

external_delete_descriptions ( component)

Delete all service and external functions information defined in the specified component.

Parameters:
string$componentname of component (moodle, mod_assignment, etc.)
Returns:
void

Definition at line 1000 of file upgradelib.php.

Here is the caller graph for this function:

external_update_descriptions ( component)

Web service discovery function used during install and upgrade.

Parameters:
string$componentname of component (moodle, mod_assignment, etc.)
Returns:
void

Definition at line 833 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

install_core ( version,
verbose 
)

Install core moodle tables and initialize

Parameters:
float$versiontarget version
bool$verbose
Returns:
void, may throw exception

Definition at line 1341 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

log_update_descriptions ( component)

Log_display description function used during install and upgrade.

Parameters:
string$componentname of component (moodle, mod_assignment, etc.)
Returns:
void

Definition at line 776 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_upgrade_part_end ( plugin,
installation,
verbose 
)

Default end upgrade callback

Parameters:
string$plugin
bool$installationtrue if installation, false means upgrade

Definition at line 1260 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_upgrade_part_start ( plugin,
installation,
verbose 
)

Default start upgrade callback

Parameters:
string$plugin
bool$installationtrue if installation, false means upgrade

Definition at line 1227 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1216 of file upgradelib.php.

Here is the caller graph for this function:

upgrade_block_savepoint ( result,
version,
blockname,
allowabort = true 
)

Blocks upgrade savepoint, marks end of blocks upgrade blocks It stores block version, resets upgrade timeout and abort upgrade if user cancels page loading.

object

Parameters:
bool$resultfalse if upgrade step failed, true if completed
stringor float $version main version
string$blocknamename of block
bool$allowabortallow user to abort script execution here
Returns:
void

Definition at line 196 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_core ( version,
verbose 
)

Upgrade moodle core

Parameters:
float$versiontarget version
bool$verbose
Returns:
void, may throw exception

Definition at line 1379 of file upgradelib.php.

Here is the call graph for this function:

upgrade_finished ( continueurl = null)

Indicates upgrade is finished.

This function may be called repeatedly.

object object

Definition at line 1180 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Internal function - executed if upgrade interrupted.

Definition at line 1168 of file upgradelib.php.

Here is the call graph for this function:

upgrade_handle_exception ( ex,
plugin = null 
)

upgrade logging functions

Definition at line 1014 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Sets up JS code required for all upgrade scripts. object

Definition at line 1286 of file upgradelib.php.

Here is the caller graph for this function:

upgrade_language_pack ( lang = null)

Try to upgrade the given language pack (or current language)

Parameters:
string$langthe code of the language to update, defaults to the current language

Definition at line 1299 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_log ( type,
plugin,
info,
details = null,
backtrace = null 
)

Adds log entry into upgrade_log table

Parameters:
int$typeUPGRADE_LOG_NORMAL, UPGRADE_LOG_NOTICE or UPGRADE_LOG_ERROR
string$pluginfrankenstyle component name
string$infoshort description text of log entry
string$detailslong problem description
string$backtracestring used for errors only
Returns:
void

Definition at line 1041 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_main_savepoint ( result,
version,
allowabort = true 
)

Upgrade savepoint, marks end of each upgrade block. It stores new main version, resets upgrade timeout and abort upgrade if user cancels page loading.

Please do not make large upgrade blocks with lots of operations, for example when adding tables keep only one table operation per block.

object

Parameters:
bool$resultfalse if upgrade step failed, true if completed
stringor float $version main version
bool$allowabortallow user to abort script execution here
Returns:
void

Definition at line 114 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_mod_savepoint ( result,
version,
modname,
allowabort = true 
)

Module upgrade savepoint, marks end of module upgrade blocks It stores module version, resets upgrade timeout and abort upgrade if user cancels page loading.

object

Parameters:
bool$resultfalse if upgrade step failed, true if completed
stringor float $version main version
string$modnamename of module
bool$allowabortallow user to abort script execution here
Returns:
void

Definition at line 156 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_noncore ( verbose)

Upgrade/install other parts of moodle

Parameters:
bool$verbose
Returns:
void, may throw exception

Definition at line 1440 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrades the mnet rpc definitions for the given component. this method doesn't return status, an exception will be thrown in the case of an error

Parameters:
string$componentthe plugin to upgrade, eg auth_mnet

Definition at line 1483 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_plugin_savepoint ( result,
version,
type,
plugin,
allowabort = true 
)

Plugins upgrade savepoint, marks end of blocks upgrade blocks It stores plugin version, resets upgrade timeout and abort upgrade if user cancels page loading.

Parameters:
bool$resultfalse if upgrade step failed, true if completed
stringor float $version main version
string$typename of plugin
string$dirlocation of plugin
bool$allowabortallow user to abort script execution here
Returns:
void

Definition at line 236 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_plugins ( type,
startcallback,
endcallback,
verbose 
)

Upgrade plugins

Parameters:
string$typeThe type of plugins that should be updated (e.g. 'enrol', 'qtype') return void

special cases

Install tables if defined

store version

execute post install file

Install various components

Run the upgrade function for the plugin.

Upgrade various components

Definition at line 266 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_plugins_blocks ( startcallback,
endcallback,
verbose 
)

This function finds all available blocks and install them into blocks table or do all the upgrade process if newer.

object object

Definition at line 580 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_plugins_modules ( startcallback,
endcallback,
verbose 
)

Find and check all modules and load them up or upgrade them if necessary

object object

Execute install.xml (XMLDB) - must be present in all modules

Add record into modules table - may be needed in install.php already

Post installation hook - optional

Install various components

If versions say that we need to upgrade but no upgrade files are available, notify and continue

Definition at line 419 of file upgradelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

upgrade_setup_debug ( starting)

object object

Definition at line 1199 of file upgradelib.php.

Here is the caller graph for this function:

upgrade_started ( preinstall = false)

Marks start of upgrade, blocks any other access to site. The upgrade is finished at the end of script or after timeout.

object object object

Definition at line 1133 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