|
Moodle
2.2.1
http://www.collinsharper.com
|
End of component_installer class. More...

Public Member Functions | |
| __construct ($langcode= '') | |
| set_queue ($langcodes) | |
| run () | |
| lang_pack_url ($langcode= '') | |
| get_remote_list_of_languages () | |
Data Fields | |
| const | RESULT_INSTALLED = 'installed' |
| const | RESULT_UPTODATE = 'uptodate' |
| const | RESULT_DOWNLOADERROR = 'downloaderror' |
Protected Member Functions | |
| add_to_queue ($langcodes) | |
| is_queued ($langcode= '') | |
| was_processed ($langcode) | |
| mark_processed ($langcode) | |
| get_parent_language ($langcode) | |
| install_language_pack ($langcode) | |
Protected Attributes | |
| $queue = array() | |
| $current | |
| $done = array() | |
| $version | |
End of component_installer class.
Language packs installer
This class wraps the functionality provided by component_installer and adds support for installing a set of language packs.
Given an array of required language packs, this class fetches them all and installs them. It detects eventual dependencies and installs all parent languages, too.
Definition at line 567 of file componentlib.class.php.
| __construct | ( | $ | langcode = '' | ) |
Prepare the installer
| string | array | $langcode | a code of the language to install |
Definition at line 591 of file componentlib.class.php.

| add_to_queue | ( | $ | langcodes | ) | [protected] |
Adds a language pack (or a list of them) to the queue
| string | array | $langcodes | code of the language to install or a list of them |
Definition at line 705 of file componentlib.class.php.

| get_parent_language | ( | $ | langcode | ) | [protected] |
Returns a parent language of the given installed language
| string | $langcode |
Reimplemented in testable_lang_installer.
Definition at line 759 of file componentlib.class.php.

Returns the list of available language packs from download.moodle.org
Definition at line 680 of file componentlib.class.php.

| install_language_pack | ( | $ | langcode | ) | [protected] |
Perform the actual language pack installation
| string | $langcode |
Reimplemented in testable_lang_installer.
Definition at line 770 of file componentlib.class.php.

| is_queued | ( | $ | langcode = '' | ) | [protected] |
| lang_pack_url | ( | $ | langcode = '' | ) |
Returns the URL where a given language pack can be downloaded
Alternatively, if the parameter is empty, returns URL of the page with the list of all available language packs.
| string | $langcode | language code like 'cs' or empty for unknown |
Definition at line 666 of file componentlib.class.php.
| mark_processed | ( | $ | langcode | ) | [protected] |
Mark the given language pack as processed
| string | $langcode |
Definition at line 749 of file componentlib.class.php.

| run | ( | ) |
Runs the installer
This method calls self::install_language_pack for every language in the queue. If a dependency is detected, the parent language is added to the queue.
Definition at line 625 of file componentlib.class.php.

| set_queue | ( | $ | langcodes | ) |
Sets the queue of language packs to be installed
| string | array | $langcodes | language code like 'cs' or a list of them |
Definition at line 609 of file componentlib.class.php.

| was_processed | ( | $ | langcode | ) | [protected] |
Checks if the given language has already been processed by this instance
| string | $langcode |
Definition at line 739 of file componentlib.class.php.

$current [protected] |
Definition at line 579 of file componentlib.class.php.
$done = array() [protected] |
Definition at line 581 of file componentlib.class.php.
$queue = array() [protected] |
Definition at line 577 of file componentlib.class.php.
$version [protected] |
Definition at line 583 of file componentlib.class.php.
| const RESULT_DOWNLOADERROR = 'downloaderror' |
there was a problem with downloading the lang pack
Definition at line 574 of file componentlib.class.php.
| const RESULT_INSTALLED = 'installed' |
lang pack was successfully downloaded and deployed
Definition at line 570 of file componentlib.class.php.
| const RESULT_UPTODATE = 'uptodate' |
lang pack was up-to-date so no download was needed
Definition at line 572 of file componentlib.class.php.