diff options
author | MateBartus <mate.bartus@gmail.com> | 2015-04-28 22:52:43 +0200 |
---|---|---|
committer | MateBartus <mate.bartus@gmail.com> | 2015-05-02 13:37:13 +0200 |
commit | 9f1f6f96ceaf0870dabd0cf68c40292682c04aa2 (patch) | |
tree | 75b0db9db574221403c8e17f14f8a7d99a78ea31 | |
parent | 179a4700221aa49071b07d638c44b9326c7a14a8 (diff) | |
download | forums-9f1f6f96ceaf0870dabd0cf68c40292682c04aa2.tar forums-9f1f6f96ceaf0870dabd0cf68c40292682c04aa2.tar.gz forums-9f1f6f96ceaf0870dabd0cf68c40292682c04aa2.tar.bz2 forums-9f1f6f96ceaf0870dabd0cf68c40292682c04aa2.tar.xz forums-9f1f6f96ceaf0870dabd0cf68c40292682c04aa2.zip |
[ticket/13762] Optional DI injectable default language module array
PHPBB3-13762
-rw-r--r-- | phpBB/phpbb/language/language.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/phpBB/phpbb/language/language.php b/phpBB/phpbb/language/language.php index 9c9a3b8df1..3298908365 100644 --- a/phpBB/phpbb/language/language.php +++ b/phpBB/phpbb/language/language.php @@ -73,9 +73,10 @@ class language /** * Constructor * - * @param \phpbb\language\language_file_loader $loader Language file loader + * @param \phpbb\language\language_file_loader $loader Language file loader + * @param array|null $common_modules Array of common language modules to load (optional) */ - public function __construct(language_file_loader $loader) + public function __construct(language_file_loader $loader, $common_modules = null) { $this->loader = $loader; @@ -92,9 +93,17 @@ class language ); // Common language files - $this->common_language_files = array( - 'common', - ); + if (is_array($common_modules)) + { + $this->common_language_files = $common_modules; + } + else + { + $this->common_language_files = array( + 'common', + ); + } + $this->common_language_files_loaded = false; $this->language_fallback = array(self::FALLBACK_LANGUAGE); |