End of component_installer class.
More...
|
const | RESULT_DOWNLOADERROR = 'downloaderror' |
| there was a problem with downloading the lang pack
|
|
const | RESULT_INSTALLED = 'installed' |
| lang pack was successfully downloaded and deployed
|
|
const | RESULT_UPTODATE = 'uptodate' |
| lang pack was up-to-date so no download was needed
|
|
|
string | $current |
| the code of language being currently installed
|
|
array | $done = array() |
| of languages already installed by this instance
|
|
array | $queue = array() |
| of languages to install
|
|
string | $version |
| this Moodle major 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.
- Copyright
- 2011 David Mudrak david.nosp@m.@moo.nosp@m.dle.c.nosp@m.om
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
lang_installer::__construct |
( |
|
$langcode = '' | ) |
|
Prepare the installer.
- Parameters
-
string | array | $langcode | a code of the language to install |
◆ add_to_queue()
lang_installer::add_to_queue |
( |
|
$langcodes | ) |
|
|
protected |
Adds a language pack (or a list of them) to the queue.
- Parameters
-
string | array | $langcodes | code of the language to install or a list of them |
◆ get_parent_language()
lang_installer::get_parent_language |
( |
|
$langcode | ) |
|
|
protected |
Returns a parent language of the given installed language.
- Parameters
-
- Return values
-
string | parent language's code |
◆ get_remote_list_of_languages()
lang_installer::get_remote_list_of_languages |
( |
| ) |
|
Returns the list of available language packs from download.moodle.org.
- Return values
-
array|bool | false if can not download |
◆ install_language_pack()
lang_installer::install_language_pack |
( |
|
$langcode | ) |
|
|
protected |
Perform the actual language pack installation.
@uses component_installer
- Parameters
-
- Return values
-
◆ lang_pack_url()
lang_installer::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.
- Parameters
-
string | $langcode | language code like 'cs' or empty for unknown |
- Return values
-
◆ mark_processed()
lang_installer::mark_processed |
( |
|
$langcode | ) |
|
|
protected |
Mark the given language pack as processed.
- See also
- self::was_processed()
- Parameters
-
◆ 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.
- Return values
-
array | results, array of self::RESULT_xxx constants indexed by language code |
◆ set_queue()
lang_installer::set_queue |
( |
|
$langcodes | ) |
|
Sets the queue of language packs to be installed.
- Parameters
-
string | array | $langcodes | language code like 'cs' or a list of them |
◆ was_processed()
lang_installer::was_processed |
( |
|
$langcode | ) |
|
|
protected |
Checks if the given language has already been processed by this instance.
- See also
- self::mark_processed()
- Parameters
-
- Return values
-
The documentation for this class was generated from the following file: