aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_install.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-12-07 13:32:19 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-12-07 13:32:19 +0100
commit47ea6bc9e61c71f6d54df848b6c61ace052d9e2a (patch)
tree9a4181d1c3c2d045abc1575634480d2ab5b1a634 /phpBB/includes/functions_install.php
parentf32a30eecacba212850a11b7b4740d0a69bd49de (diff)
parent71169de8230812f2d05b87bfba42331e04663b81 (diff)
downloadforums-47ea6bc9e61c71f6d54df848b6c61ace052d9e2a.tar
forums-47ea6bc9e61c71f6d54df848b6c61ace052d9e2a.tar.gz
forums-47ea6bc9e61c71f6d54df848b6c61ace052d9e2a.tar.bz2
forums-47ea6bc9e61c71f6d54df848b6c61ace052d9e2a.tar.xz
forums-47ea6bc9e61c71f6d54df848b6c61ace052d9e2a.zip
Merge branch 'develop' of https://github.com/phpbb/phpbb into ticket/11997
Conflicts: tests/functional/fixtures/ext/foo/bar/config/services.yml
Diffstat (limited to 'phpBB/includes/functions_install.php')
-rw-r--r--phpBB/includes/functions_install.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 1be6e49471..deb304b838 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -533,3 +533,51 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test
return $config_data;
}
+
+/**
+* Check whether a file should be ignored on update
+*
+* We ignore new files in some circumstances:
+* 1. The file is a language file, but the language is not installed
+* 2. The file is a style file, but the style is not installed
+* 3. The file is a style language file, but the language is not installed
+*
+* @param string $phpbb_root_path phpBB root path
+* @param string $file File including path from phpbb root
+* @return bool Should we ignore the new file or add it to the board?
+*/
+function phpbb_ignore_new_file_on_update($phpbb_root_path, $file)
+{
+ $ignore_new_file = false;
+
+ // We ignore new files in some circumstances:
+ // 1. The file is a language file, but the language is not installed
+ if (!$ignore_new_file && strpos($file, 'language/') === 0)
+ {
+ list($language_dir, $language_iso) = explode('/', $file);
+ $ignore_new_file = !file_exists($phpbb_root_path . $language_dir . '/' . $language_iso);
+ }
+
+ // 2. The file is a style file, but the style is not installed
+ if (!$ignore_new_file && strpos($file, 'styles/') === 0)
+ {
+ list($styles_dir, $style_name) = explode('/', $file);
+ $ignore_new_file = !file_exists($phpbb_root_path . $styles_dir . '/' . $style_name);
+ }
+
+ // 3. The file is a style language file, but the language is not installed
+ if (!$ignore_new_file && strpos($file, 'styles/') === 0)
+ {
+ $dirs = explode('/', $file);
+ if (sizeof($dirs) >= 5)
+ {
+ list($styles_dir, $style_name, $template_component, $language_iso) = explode('/', $file);
+ if ($template_component == 'theme' && $language_iso !== 'images')
+ {
+ $ignore_new_file = !file_exists($phpbb_root_path . 'language/' . $language_iso);
+ }
+ }
+ }
+
+ return $ignore_new_file;
+}