diff --git a/.gitignore b/.gitignore index 06b13923f5..18f598cf67 100644 --- a/.gitignore +++ b/.gitignore @@ -5,15 +5,13 @@ /phpBB/cache/*.php /phpBB/cache/*.lock /phpBB/composer.phar -/phpBB/config.php -/phpBB/config_dev.php -/phpBB/config_test.php +/phpBB/config*.php /phpBB/ext/* /phpBB/files/* /phpBB/images/avatars/gallery/* /phpBB/images/avatars/upload/* /phpBB/store/* /phpBB/vendor -/tests/phpbb_unit_tests.sqlite2 -/tests/test_config.php +/tests/phpbb_unit_tests.sqlite* +/tests/test_config*.php /tests/tmp/* diff --git a/.travis.yml b/.travis.yml index a65b1ccd2b..3d79d156de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,23 +14,13 @@ services: - redis-server install: - - sh -c "if [ '$DB' = 'mariadb' ]; then travis/setup-mariadb.sh; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then travis/setup-php-extensions.sh; fi" - - sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi" - - cd phpBB - - php ../composer.phar install --dev --no-interaction --prefer-source - - cd .. + - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION before_script: - - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi" - - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' -a '$DB' = 'mysql' ]; then mysql -e 'SET GLOBAL storage_engine=MyISAM;'; fi" - - sh -c "if [ '$DB' = 'mysql' -o '$DB' = 'mariadb' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" + - travis/setup-database.sh $DB $TRAVIS_PHP_VERSION script: - - cd build - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' ]; then ../phpBB/vendor/bin/phing sniff; fi" - - cd .. + - travis/phing-sniff.sh $DB $TRAVIS_PHP_VERSION - phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi" @@ -40,3 +30,8 @@ matrix: env: DB=mariadb - php: 5.4 env: DB=postgres + - php: 5.4 + env: DB=sqlite3 + allow_failures: + - php: hhvm + fast_finish: true diff --git a/build/build.xml b/build/build.xml index 3a2a66b113..79b6096c97 100644 --- a/build/build.xml +++ b/build/build.xml @@ -2,9 +2,9 @@ - - - + + + @@ -141,6 +141,7 @@ + @@ -273,6 +274,10 @@ + + + + @@ -284,6 +289,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/build_helper.php b/build/build_helper.php index d6169b913b..7c75206d6d 100644 --- a/build/build_helper.php +++ b/build/build_helper.php @@ -312,4 +312,63 @@ class build_package return $result; } + + /** + * Collect the list of the deleted files from a list of deleted files and folders. + * + * @param string $deleted_filename The full path to a file containing the list of deleted files and directories + * @param string $package_name The name of the package + * @return array + */ + public function collect_deleted_files($deleted_filename, $package_name) + { + $result = array(); + $file_contents = file($deleted_filename); + + foreach ($file_contents as $filename) + { + $filename = trim($filename); + + if (!$filename) + { + continue; + } + + $filename = str_replace('Only in ' . $package_name, '', $filename); + $filename = ltrim($filename, '/'); + + if (substr($filename, 0, 1) == ':') + { + $replace = ''; + } + else + { + $replace = '/'; + } + + $filename = str_replace(': ', $replace, $filename); + + if (is_dir("{$this->locations['old_versions']}{$package_name}/{$filename}")) + { + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator( + "{$this->locations['old_versions']}{$package_name}/{$filename}", + \FilesystemIterator::UNIX_PATHS | \FilesystemIterator::SKIP_DOTS + ), + \RecursiveIteratorIterator::LEAVES_ONLY + ); + + foreach ($iterator as $file_info) + { + $result[] = "{$filename}/{$iterator->getSubPathname()}"; + } + } + else + { + $result[] = $filename; + } + } + + return $result; + } } diff --git a/build/code_sniffer/ruleset-php-legacy.xml b/build/code_sniffer/ruleset-php-legacy.xml index 550c919b5d..65eb0a8622 100644 --- a/build/code_sniffer/ruleset-php-legacy.xml +++ b/build/code_sniffer/ruleset-php-legacy.xml @@ -41,6 +41,18 @@ + + + + + + + + + + + + diff --git a/build/code_sniffer/ruleset-php-strict.xml b/build/code_sniffer/ruleset-php-strict.xml index 5e3c26a616..f2d5b86dd1 100644 --- a/build/code_sniffer/ruleset-php-strict.xml +++ b/build/code_sniffer/ruleset-php-strict.xml @@ -22,18 +22,6 @@ - - - - - - - - - - - - diff --git a/build/package.php b/build/package.php index 00930abe65..206e3b6640 100755 --- a/build/package.php +++ b/build/package.php @@ -45,6 +45,10 @@ if (sizeof($package->old_packages)) $package->get('patch_directory') . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.patch', $_package_name ); + $diff_file_changes[$_package_name]['deleted'] = $package->collect_deleted_files( + $package->get('patch_directory') . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.deleted', + $_package_name + ); } // Now put those files determined within the correct directories @@ -292,6 +296,15 @@ $update_info = array( $index_contents .= "\t'binary' => array(),\n"; } + if (sizeof($file_contents['deleted'])) + { + $index_contents .= "\t'deleted' => array(\n\t\t'" . implode("',\n\t\t'", $file_contents['deleted']) . "',\n\t),\n"; + } + else + { + $index_contents .= "\t'deleted' => array(),\n"; + } + $index_contents .= ");\n"; $fp = fopen($dest_filename_dir . '/install/update/index.php', 'wt'); diff --git a/phpBB/.htaccess b/phpBB/.htaccess index 6f33916775..1ae74ed825 100644 --- a/phpBB/.htaccess +++ b/phpBB/.htaccess @@ -26,12 +26,50 @@ RewriteRule ^(.*)$ app.php [QSA,L] #Options +FollowSymLinks - -Order Allow,Deny -Deny from All - - - -Order Allow,Deny -Deny from All - +# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from +# module mod_authz_host to a new module called mod_access_compat (which may be +# disabled) and a new "Require" syntax has been introduced to mod_authz_host. +# We could just conditionally provide both versions, but unfortunately Apache +# does not explicitly tell us its version if the module mod_version is not +# available. In this case, we check for the availability of module +# mod_authz_core (which should be on 2.4 or higher only) as a best guess. + + + + Order Allow,Deny + Deny from All + + + Order Allow,Deny + Deny from All + + + = 2.4> + + Require all denied + + + Require all denied + + + + + + + Order Allow,Deny + Deny from All + + + Order Allow,Deny + Deny from All + + + + + Require all denied + + + Require all denied + + + diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index 82fb229fae..0e3b5ff3b2 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -331,15 +331,15 @@
{L_TITLE} - +
- - - - - + + + + + @@ -348,7 +348,7 @@ - + @@ -378,7 +378,7 @@
{L_TITLE} -
{L_FILENAME}{L_FILEDATE}{L_FILESIZE}{L_ATTACH_POST_ID}{L_ATTACH_TO_POST}{L_DELETE}{L_FILEDATE}{L_FILESIZE}{L_ATTACH_POST_ID}{L_ATTACH_TO_POST}{L_DELETE}
{orphan.REAL_FILENAME} {orphan.FILETIME} {orphan.FILESIZE}{L_ATTACH_ID}{L_COLON} {L_ATTACH_ID}{L_COLON}
+ +
- - - + + + @@ -406,25 +407,19 @@ {attachments.REAL_FILENAME}
{attachments.COMMENT}
{attachments.L_DOWNLOAD_COUNT}
{L_TOPIC}{L_COLON} {attachments.TOPIC_TITLE} - - + + - - - -
{L_FILENAME}{L_POSTED}{L_FILESIZE}{L_DELETE}{L_POSTED}{L_FILESIZE}{L_MARK}
{attachments.FILETIME}
{L_POST_BY_AUTHOR} {attachments.ATTACHMENT_POSTER}
{attachments.FILESIZE}{attachments.FILESIZE}
 {L_MARK_ALL} :: {L_UNMARK_ALL}
+ +
+

{L_NO_ATTACHMENTS}

+
+ -
- {L_DISPLAY_LOG}{L_COLON}  {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} - -
- -
- -

-   - -

+
+ {L_DISPLAY_LOG}{L_COLON}  {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} + +
+ +
+ + +
+
+

+ {L_MARK_ALL} • + {L_UNMARK_ALL} +

+
+ {S_FORM_TOKEN}
diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html index 592b5bbc16..ec2065f906 100644 --- a/phpBB/adm/style/acp_logs.html +++ b/phpBB/adm/style/acp_logs.html @@ -13,7 +13,7 @@ -