aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/cache/driver/base.php1
-rw-r--r--phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php5
-rw-r--r--phpBB/phpbb/di/container_builder.php31
-rw-r--r--phpBB/phpbb/language/language.php26
4 files changed, 58 insertions, 5 deletions
diff --git a/phpBB/phpbb/cache/driver/base.php b/phpBB/phpbb/cache/driver/base.php
index 55cd4668de..85762c4d95 100644
--- a/phpBB/phpbb/cache/driver/base.php
+++ b/phpBB/phpbb/cache/driver/base.php
@@ -49,6 +49,7 @@ abstract class base implements \phpbb\cache\driver\driver_interface
$this->remove_dir($fileInfo->getPathname());
}
else if (strpos($filename, 'container_') === 0 ||
+ strpos($filename, 'autoload_') === 0 ||
strpos($filename, 'url_matcher') === 0 ||
strpos($filename, 'url_generator') === 0 ||
strpos($filename, 'sql_') === 0 ||
diff --git a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php
index ecee09ce77..65e5b3fa73 100644
--- a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php
+++ b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php
@@ -17,7 +17,10 @@ class default_data_type_ids extends \phpbb\db\migration\migration
{
static public function depends_on()
{
- return array('\phpbb\db\migration\data\v320\v320a2');
+ return array(
+ '\phpbb\db\migration\data\v320\v320a2',
+ '\phpbb\db\migration\data\v320\oauth_states',
+ );
}
public function update_schema()
diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php
index 433847b285..9583da14f5 100644
--- a/phpBB/phpbb/di/container_builder.php
+++ b/phpBB/phpbb/di/container_builder.php
@@ -135,6 +135,11 @@ class container_builder
$config_cache = new ConfigCache($container_filename, defined('DEBUG'));
if ($this->use_cache && $config_cache->isFresh())
{
+ if ($this->use_extensions)
+ {
+ require($this->get_autoload_filename());
+ }
+
require($config_cache->getPath());
$this->container = new \phpbb_cache_container();
}
@@ -405,6 +410,15 @@ class container_builder
$extensions = $ext_container->get('ext.manager')->all_enabled();
// Load each extension found
+ $autoloaders = '<?php
+/**
+ * Loads all extensions custom auto-loaders.
+ *
+ * This file has been auto-generated
+ * by phpBB while loading the extensions.
+ */
+
+';
foreach ($extensions as $ext_name => $path)
{
$extension_class = '\\' . str_replace('/', '\\', $ext_name) . '\\di\\extension';
@@ -420,9 +434,14 @@ class container_builder
$filename = $path . 'vendor/autoload.php';
if (file_exists($filename))
{
- require $filename;
+ $autoloaders .= "require('{$filename}');\n";
}
}
+
+ $configCache = new ConfigCache($this->get_autoload_filename(), false);
+ $configCache->write($autoloaders);
+
+ require($this->get_autoload_filename());
}
else
{
@@ -540,6 +559,16 @@ class container_builder
}
/**
+ * Get the filename under which the dumped extensions autoloader will be stored.
+ *
+ * @return string Path for dumped extensions autoloader
+ */
+ protected function get_autoload_filename()
+ {
+ return $this->get_cache_dir() . 'autoload_' . md5($this->phpbb_root_path) . '.' . $this->php_ext;
+ }
+
+ /**
* Return the name of the current environment.
*
* @return string
diff --git a/phpBB/phpbb/language/language.php b/phpBB/phpbb/language/language.php
index 382d4db89e..42429c2c07 100644
--- a/phpBB/phpbb/language/language.php
+++ b/phpBB/phpbb/language/language.php
@@ -246,14 +246,14 @@ class language
}
/**
- * Act like lang() but takes a key and an array of parameters instead of using variadic
+ * Returns the raw value associated to a language key or the language key no translation is available.
+ * No parameter substitution is performed, can be a string or an array.
*
* @param string|array $key Language key
- * @param array $args Parameters
*
* @return array|string
*/
- public function lang_array($key, $args = array())
+ public function lang_raw($key)
{
// Load common language files if they not loaded yet
if (!$this->common_language_files_loaded)
@@ -281,6 +281,26 @@ class language
return $key;
}
+ return $lang;
+ }
+
+ /**
+ * Act like lang() but takes a key and an array of parameters instead of using variadic
+ *
+ * @param string|array $key Language key
+ * @param array $args Parameters
+ *
+ * @return string
+ */
+ public function lang_array($key, $args = array())
+ {
+ $lang = $this->lang_raw($key);
+
+ if ($lang === $key)
+ {
+ return $key;
+ }
+
// If the language entry is a string, we simply mimic sprintf() behaviour
if (is_string($lang))
{