diff options
419 files changed, 4106 insertions, 2639 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index b15bbf551d..1b531098b1 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -9,13 +9,13 @@ environment: matrix: - db: mssql db_version: sql2012sp1 - php: 7.0 + php: 7.1 - db: mssql db_version: sql2014 - php: 7.0 + php: 7.1 - db: mssql db_version: sql2016 - php: 7.1.12 + php: 7.2 # - db: mssql # db_version: sql2017 # php: 7.1 @@ -63,10 +63,11 @@ before_test: # Get MSSQL driver if ($env:db -eq "mssql") { cd c:\tools\php\ext - $DLLVersion = "4.1.6.1" - curl -o php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip https://windows.php.net/downloads/pecl/releases/sqlsrv/$($:DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip + $DLLVersion = "5.3.0" + $VCVersion = If ([System.Version]"$($env:php)" -ge [System.Version]"7.2") {"vc15"} Else {"vc14"} + curl -o php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip https://windows.php.net/downloads/pecl/releases/sqlsrv/$($:DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-$($VCVersion)-x64.zip 7z x -y php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip > $null - curl -o php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip + curl -o php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-$($VCVersion)-x64.zip 7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip > $null Remove-Item c:\tools\php\* -include .zip cd c:\tools\php diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 3fceabda10..47b859d31e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,5 +2,5 @@ 1. [Create an account on phpBB.com](http://www.phpbb.com/community/ucp.php?mode=register) 2. [Create a ticket (unless there already is one)](http://tracker.phpbb.com/secure/CreateIssue!default.jspa) -3. Read our [Coding guidelines](https://wiki.phpbb.com/Coding_guidelines) and [Git Contribution Guidelines](http://wiki.phpbb.com/Git) +3. Read our [Coding guidelines](https://area51.phpbb.com/docs/dev/master/development/coding_guidelines.html) and [Git Contribution Guidelines](https://area51.phpbb.com/docs/dev/master/development/git.html) 4. Send us a pull request diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cacfcf1118..bf8df273a9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,9 +1,9 @@ Checklist: -- [ ] Correct branch: master for new features; 3.2.x for fixes +- [ ] Correct branch: master for new features; 3.3.x & 3.2.x for fixes - [ ] Tests pass -- [ ] Code follows coding guidelines: [master](https://area51.phpbb.com/docs/dev/master/development/coding_guidelines.html) and [3.2.x](https://area51.phpbb.com/docs/dev/3.2.x/development/coding_guidelines.html) -- [ ] Commit follows commit message [format](https://area51.phpbb.com/docs/dev/3.2.x/development/git.html) +- [ ] Code follows coding guidelines: [master](https://area51.phpbb.com/docs/dev/master/development/coding_guidelines.html), [3.3.x](https://area51.phpbb.com/docs/dev/3.3.x/development/coding_guidelines.html) and [3.2.x](https://area51.phpbb.com/docs/dev/3.2.x/development/coding_guidelines.html) +- [ ] Commit follows commit message [format](https://area51.phpbb.com/docs/dev/3.3.x/development/git.html) Tracker ticket (set the ticket ID to **your ticket ID**): diff --git a/.gitignore b/.gitignore index ac29bb403c..31145bc84b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,9 @@ /phpBB/store/* /phpBB/styles/* !/phpBB/styles/prosilver +/phpBB/styles/prosilver/theme/*/ +!/phpBB/styles/prosilver/theme/en +!/phpBB/styles/prosilver/theme/images !/phpBB/styles/all /phpBB/vendor /tests/phpbb_unit_tests.sqlite* diff --git a/.travis.yml b/.travis.yml index 327633d01c..a33cc03aea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,30 +2,22 @@ language: php matrix: include: - - php: 5.4 + - php: 7.1 env: DB=none;NOTESTS=1 - - php: 5.4 - env: DB=mysqli # MyISAM - - php: 5.4 - env: DB=mysql - - php: 5.4 + - php: 7.1 env: DB=mariadb - - php: 5.4 + - php: 7.1 env: DB=postgres - - php: 5.4 + - php: 7.1 env: DB=sqlite3 - - php: 5.4 + - php: 7.1 env: DB=mysqli;SLOWTESTS=1 - - php: 5.5 - env: DB=mysqli - - php: 5.6 - env: DB=mysqli - - php: 7.0 - env: DB=mysqli - php: 7.1 - env: DB=mysqli + env: DB=mysqli # MyISAM - php: 7.2 env: DB=mysqli + - php: 7.3 + env: DB=mysqli - php: nightly env: DB=mysqli allow_failures: @@ -32,8 +32,8 @@ Read our [Vagrant documentation](phpBB/docs/vagrant.md) to find out how to use V We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](https://bamboo.phpbb.com) or check our travis builds below: * [![Build Status](https://travis-ci.org/phpbb/phpbb.svg?branch=master)](http://travis-ci.org/phpbb/phpbb)[![Build status](https://ci.appveyor.com/api/projects/status/8g98ybngd2f3axy1/branch/master?svg=true)](https://ci.appveyor.com/project/phpBB/phpbb/branch/master) **master** - Latest development version +* [![Build Status](https://travis-ci.org/phpbb/phpbb.svg?branch=3.3.x)](http://travis-ci.org/phpbb/phpbb)[![Build status](https://ci.appveyor.com/api/projects/status/8g98ybngd2f3axy1/branch/3.3.x?svg=true)](https://ci.appveyor.com/project/phpBB/phpbb/branch/3.3.x) **3.3.x** - Development of version 3.3.x * [![Build Status](https://travis-ci.org/phpbb/phpbb.svg?branch=3.2.x)](http://travis-ci.org/phpbb/phpbb)[![Build status](https://ci.appveyor.com/api/projects/status/8g98ybngd2f3axy1/branch/3.2.x?svg=true)](https://ci.appveyor.com/project/phpBB/phpbb/branch/3.2.x) **3.2.x** - Development of version 3.2.x -* [![Build Status](https://travis-ci.org/phpbb/phpbb.svg?branch=3.1.x)](http://travis-ci.org/phpbb/phpbb) **3.1.x** - Development of version 3.1.x ## LICENSE diff --git a/build/build.xml b/build/build.xml index c82754ed68..9e9b19923f 100644 --- a/build/build.xml +++ b/build/build.xml @@ -2,7 +2,7 @@ <project name="phpBB" description="The phpBB forum software" default="all" basedir="../"> <!-- a few settings for the build --> - <property name="newversion" value="3.2.8-dev" /> + <property name="newversion" value="3.3.0-b1-dev" /> <property name="prevversion" value="3.2.7" /> <property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0-a1, 3.2.0-a2, 3.2.0-b1, 3.2.0-b2, 3.2.0-RC1, 3.2.0-RC2, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6" /> <!-- no configuration should be needed beyond this point --> @@ -81,28 +81,36 @@ --ignore=${project.basedir}/phpBB/phpbb/db/migration/data/v30x/* phpBB/phpbb" dir="." returnProperty="retval-php-strict" passthru="true" /> + <php function="preg_replace" returnProperty="sniffIgnoreList"> + <param value="/\s+/"/> + <param value=""/> + <param value="${project.basedir}/phpBB/cache/*, + ${project.basedir}/phpBB/develop/*, + ${project.basedir}/phpBB/ext/*, + ${project.basedir}/phpBB/includes/diff/*.php, + ${project.basedir}/phpBB/includes/sphinxapi.php, + ${project.basedir}/phpBB/includes/utf/data/*, + ${project.basedir}/phpBB/install/data/*, + ${project.basedir}/phpBB/install/database_update.php, + ${project.basedir}/phpBB/phpbb/*, + ${project.basedir}/phpBB/vendor/*, + ${project.basedir}/phpBB/vendor-ext/*, + ${project.basedir}/phpBB/config.php, + ${project.basedir}/phpBB/config_dev.php, + ${project.basedir}/phpBB/config_test.php"/> + </php> <exec command="phpBB/vendor/bin/phpcs -s -p --extensions=php --standard=build/code_sniffer/ruleset-php-legacy-core.xml - --ignore=${project.basedir}/phpBB/cache/* - --ignore=${project.basedir}/phpBB/develop/* - --ignore=${project.basedir}/phpBB/ext/* - --ignore=${project.basedir}/phpBB/includes/diff/*.php - --ignore=${project.basedir}/phpBB/includes/sphinxapi.php - --ignore=${project.basedir}/phpBB/includes/utf/data/* - --ignore=${project.basedir}/phpBB/install/data/* - --ignore=${project.basedir}/phpBB/install/database_update.php - --ignore=${project.basedir}/phpBB/phpbb/* - --ignore=${project.basedir}/phpBB/vendor/* + --ignore=${sniffIgnoreList} phpBB" dir="." returnProperty="retval-php-legacy" passthru="true" /> <exec command="phpBB/vendor/bin/phpcs -s -p --extensions=php --standard=build/code_sniffer/ruleset-php-extensions.xml - --ignore=${project.basedir}/phpBB/ext/*/tests/* - --ignore=${project.basedir}/phpBB/ext/*/vendor/* + --ignore=${project.basedir}/phpBB/ext/*/tests/*,${project.basedir}/phpBB/ext/*/vendor/* phpBB/ext" dir="." returnProperty="retval-php-ext" passthru="true" /> <if> diff --git a/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php b/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php index 8c0ec853ff..ed8b231be5 100644 --- a/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php +++ b/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php @@ -11,6 +11,9 @@ * */ +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + /** * Checks that each PHP source file contains a valid header as defined by the * phpBB Coding Guidelines. @@ -18,7 +21,7 @@ * @package code_sniffer * @author Manuel Pichler <mapi@phpundercontrol.org> */ -class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff +class phpbb_Sniffs_Commenting_FileCommentSniff implements Sniff { /** * Returns an array of tokens this test wants to listen for. @@ -33,13 +36,13 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff /** * Processes this test, when one of its tokens is encountered. * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param File $phpcsFile The file being scanned. * @param int $stackPtr The position of the current token * in the stack passed in $tokens. * - * @return null + * @return void */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + public function process(File $phpcsFile, $stackPtr): void { // We are only interested in the first file comment. if ($stackPtr !== 0) @@ -62,7 +65,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff // Mark as error if this is not a doc comment else if ($start === false || $tokens[$start]['code'] !== T_DOC_COMMENT_OPEN_TAG) { - $phpcsFile->addError('Missing required file doc comment.', $stackPtr); + $phpcsFile->addError('Missing required file doc comment.', $stackPtr, 'MissingComment'); return; } @@ -82,7 +85,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff if ($tokens[$token]['column'] === 1 && (($tokens[$token]['content'] !== '*' && $tokens[$token]['content'] !== ' ') || ($tokens[$token]['content'] === ' ' && $tokens[$token + 1]['content'] !== '*'))) { $message = 'The file doc comment should not be indented.'; - $phpcsFile->addWarning($message, $token); + $phpcsFile->addWarning($message, $token, 'CommentIndented'); } } @@ -95,13 +98,13 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff if (!(($tokens[$start + 2]['content'] !== '*' && $tokens[$start + 4]['content'] !== '*') || ($tokens[$start + 3]['content'] !== '*' && $tokens[$start + 6]['content'] !== '*'))) { $message = 'The first file comment line should be empty.'; - $phpcsFile->addWarning($message, ($start + 1)); + $phpcsFile->addWarning($message, ($start + 1), 'CommentFirstNotEmpty'); } if ($tokens[$end - 3]['content'] !== '*' && $tokens[$end - 6]['content'] !== '*') { $message = 'The last file comment line should be empty.'; - $phpcsFile->addWarning($message, $end - 1); + $phpcsFile->addWarning($message, $end - 1, 'CommentLastNotEmpty'); } //$this->processPackage($phpcsFile, $start, $tags); @@ -113,59 +116,59 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff /** * Checks that the tags array contains a valid package tag * - * @param PHP_CodeSniffer_File $phpcsFile The context source file instance. + * @param File $phpcsFile The context source file instance. * @param integer The stack pointer for the first comment token. * @param array(string=>array) $tags The found file doc comment tags. * - * @return null + * @return void */ - protected function processPackage(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags) + protected function processPackage(File $phpcsFile, $ptr, $tags): void { if (!isset($tags['package'])) { $message = 'Missing require @package tag in file doc comment.'; - $phpcsFile->addError($message, $ptr); + $phpcsFile->addError($message, $ptr, 'MissingTagPackage'); } else if (preg_match('/^([\w]+)$/', $tags['package'][0]) === 0) { $message = 'Invalid content found for @package tag.'; - $phpcsFile->addWarning($message, $tags['package'][1]); + $phpcsFile->addWarning($message, $tags['package'][1], 'InvalidTagPackage'); } } /** * Checks that the tags array contains a valid version tag * - * @param PHP_CodeSniffer_File $phpcsFile The context source file instance. + * @param File $phpcsFile The context source file instance. * @param integer The stack pointer for the first comment token. * @param array(string=>array) $tags The found file doc comment tags. * - * @return null + * @return void */ - protected function processVersion(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags) + protected function processVersion(File $phpcsFile, $ptr, $tags): void { if (!isset($tags['version'])) { $message = 'Missing require @version tag in file doc comment.'; - $phpcsFile->addError($message, $ptr); + $phpcsFile->addError($message, $ptr, 'MissingTagVersion'); } else if (preg_match('/^\$Id:[^\$]+\$$/', $tags['version'][0]) === 0) { $message = 'Invalid content found for @version tag, use "$Id: $".'; - $phpcsFile->addError($message, $tags['version'][1]); + $phpcsFile->addError($message, $tags['version'][1], 'InvalidTagVersion'); } } /** * Checks that the tags array contains a valid copyright tag * - * @param PHP_CodeSniffer_File $phpcsFile The context source file instance. + * @param File $phpcsFile The context source file instance. * @param integer The stack pointer for the first comment token. * @param array(string=>array) $tags The found file doc comment tags. * - * @return null + * @return void */ - protected function processCopyright(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags) + protected function processCopyright(File $phpcsFile, $ptr, $tags): void { $copyright = '(c) phpBB Limited <https://www.phpbb.com>'; $tokens = $phpcsFile->getTokens(); @@ -177,7 +180,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff if ($tokens[$tag + 2]['content'] !== $copyright) { $message = 'Invalid content found for the first @copyright tag, use "' . $copyright . '".'; - $phpcsFile->addError($message, $tags['copyright'][0][1]); + $phpcsFile->addError($message, $tags['copyright'][0][1], 'InvalidTagCopyright'); } return; @@ -185,19 +188,19 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff } $message = 'Missing require @copyright tag in file doc comment.'; - $phpcsFile->addError($message, $ptr); + $phpcsFile->addError($message, $ptr, 'MissingTagCopyright'); } /** * Checks that the tags array contains a valid license tag * - * @param PHP_CodeSniffer_File $phpcsFile The context source file instance. + * @param File $phpcsFile The context source file instance. * @param integer The stack pointer for the first comment token. * @param array(string=>array) $tags The found file doc comment tags. * - * @return null + * @return void */ - protected function processLicense(PHP_CodeSniffer_File $phpcsFile, $ptr, $tags) + protected function processLicense(File $phpcsFile, $ptr, $tags): void { $license = 'GNU General Public License, version 2 (GPL-2.0)'; $tokens = $phpcsFile->getTokens(); @@ -210,7 +213,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff if ($found) { $message = 'It must be only one @license tag in file doc comment.'; - $phpcsFile->addError($message, $ptr); + $phpcsFile->addError($message, $ptr, 'MultiTagVersion'); } $found = true; @@ -218,7 +221,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff if ($tokens[$tag + 2]['content'] !== $license) { $message = 'Invalid content found for @license tag, use "' . $license . '".'; - $phpcsFile->addError($message, $tags['license'][0][1]); + $phpcsFile->addError($message, $tags['license'][0][1], 'InvalidTagLicense'); } } } @@ -226,7 +229,7 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff if (!$found) { $message = 'Missing require @license tag in file doc comment.'; - $phpcsFile->addError($message, $ptr); + $phpcsFile->addError($message, $ptr, 'MissingTagLicense'); } } } diff --git a/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php index 885c38c5b4..a529fc25cb 100644 --- a/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php +++ b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php @@ -11,11 +11,14 @@ * */ +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + /** * Checks that the opening brace of a control structures is on the line after. * From Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff */ -class phpbb_Sniffs_ControlStructures_OpeningBraceBsdAllmanSniff implements PHP_CodeSniffer_Sniff +class phpbb_Sniffs_ControlStructures_OpeningBraceBsdAllmanSniff implements Sniff { /** * Registers the tokens that this sniff wants to listen for. @@ -36,13 +39,13 @@ class phpbb_Sniffs_ControlStructures_OpeningBraceBsdAllmanSniff implements PHP_C /** * Processes this test, when one of its tokens is encountered. * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param File $phpcsFile The file being scanned. * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * * @return void */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); diff --git a/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php index 349bccbb02..d4ecd6cb95 100644 --- a/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php +++ b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningParenthesisSniff.php @@ -11,11 +11,14 @@ * */ +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + /** * Checks that there is exactly one space between the keyword and the opening * parenthesis of a control structures. */ -class phpbb_Sniffs_ControlStructures_OpeningParenthesisSniff implements PHP_CodeSniffer_Sniff +class phpbb_Sniffs_ControlStructures_OpeningParenthesisSniff implements Sniff { /** * Registers the tokens that this sniff wants to listen for. @@ -36,13 +39,13 @@ class phpbb_Sniffs_ControlStructures_OpeningParenthesisSniff implements PHP_Code /** * Processes this test, when one of its tokens is encountered. * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param File $phpcsFile The file being scanned. * @param int $stackPtr The position of the current token in the * stack passed in $tokens. * * @return void */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); diff --git a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php index b3cdbf7496..0279888de1 100644 --- a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php +++ b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php @@ -11,10 +11,13 @@ * */ +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + /** * Checks that each use statement is used. */ -class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff +class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff { /** * {@inheritdoc} @@ -24,7 +27,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff return array(T_USE); } - protected function check($phpcsFile, $found_name, $full_name, $short_name, $line) + protected function check(File $phpcsFile, $found_name, $full_name, $short_name, $line) { if ($found_name === $full_name) @@ -44,7 +47,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff /** * {@inheritdoc} */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + public function process(File $phpcsFile, $stackPtr) { if ($this->should_ignore_use($phpcsFile, $stackPtr) === true) { @@ -179,13 +182,13 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff /** * Check if this use statement is part of the namespace block. * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param File $phpcsFile The file being scanned. * @param int $stackPtr The position of the current token in * the stack passed in $tokens. * * @return bool */ - private function should_ignore_use(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + private function should_ignore_use(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); @@ -207,7 +210,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff } /** - * @param PHP_CodeSniffer_File $phpcsFile + * @param File $phpcsFile * @param int $field * @param array $tokens * @param string $class_name_full @@ -216,7 +219,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff * * @return bool */ - private function checkDocblock(PHP_CodeSniffer_File $phpcsFile, $comment_end, $tokens, $class_name_full, $class_name_short) + private function checkDocblock(File $phpcsFile, $comment_end, $tokens, $class_name_full, $class_name_short) { $ok = false; diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index d27f56f28b..c648fdf100 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -49,7 +49,6 @@ if (!$auth->acl_get('a_')) define('IN_ADMIN', true); // Some oft used variables -$safe_mode = (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) === 'on') ? true : false; $file_uploads = (@ini_get('file_uploads') == '1' || strtolower(@ini_get('file_uploads')) === 'on') ? true : false; $module_id = $request->variable('i', ''); $mode = $request->variable('mode', ''); diff --git a/phpBB/adm/style/acp_avatar_options_upload.html b/phpBB/adm/style/acp_avatar_options_upload.html index 63a734ea7d..666950e0ae 100644 --- a/phpBB/adm/style/acp_avatar_options_upload.html +++ b/phpBB/adm/style/acp_avatar_options_upload.html @@ -1,6 +1,6 @@ <dl> <dt><label for="avatar_upload_file">{L_UPLOAD_AVATAR_FILE}{L_COLON}</label></dt> - <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_UPLOAD_SIZE}" /><input type="file" name="avatar_upload_file" id="avatar_upload_file" class="inputbox autowidth" /></dd> + <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_UPLOAD_SIZE}" /><input type="file" name="avatar_upload_file" id="avatar_upload_file" class="inputbox autowidth" accept="{{ AVATAR_ALLOWED_EXTENSIONS }}" /></dd> </dl> <!-- IF S_UPLOAD_AVATAR_URL --> diff --git a/phpBB/adm/style/acp_contact.html b/phpBB/adm/style/acp_contact.html index 828fd4b659..f1752d0055 100644 --- a/phpBB/adm/style/acp_contact.html +++ b/phpBB/adm/style/acp_contact.html @@ -44,7 +44,7 @@ <!-- INCLUDE acp_posting_buttons.html --> <dl class="responsive-columns"> - <dt style="width: 90px;" id="color_palette_placeholder" data-orientation="v" data-height="12" data-width="15" data-bbcode="true"> + <dt style="width: 90px;" id="color_palette_placeholder" data-color-palette="v" data-height="12" data-width="15" data-bbcode="true"> </dt> <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px;"> diff --git a/phpBB/adm/style/acp_ext_actions.html b/phpBB/adm/style/acp_ext_actions.html new file mode 100644 index 0000000000..6f2341f381 --- /dev/null +++ b/phpBB/adm/style/acp_ext_actions.html @@ -0,0 +1,6 @@ +{% for action in enabled.actions %} +<a href="{{ action.U_ACTION }}"{% if action.L_ACTION_EXPLAIN %} title="{{ action.L_ACTION_EXPLAIN }}"{% endif %}{% if action.COLOR %} style="color: {{ action.COLOR }};"{% endif %} data-ajax="{{ action.ACTION_AJAX }}" data-refresh="true">{{ action.L_ACTION }}</a>{% if not action.S_LAST_ROW %} | {% endif %} +{% endfor %} +{% for action in disabled.actions %} +<a href="{{ action.U_ACTION }}"{% if action.L_ACTION_EXPLAIN %} title="{{ action.L_ACTION_EXPLAIN }}"{% endif %}{% if action.COLOR %} style="color: {{ action.COLOR }};"{% endif %} data-ajax="{{ action.ACTION_AJAX }}" data-refresh="true">{{ action.L_ACTION }}</a>{% if not action.S_LAST_ROW %} | {% endif %} +{% endfor %}
\ No newline at end of file diff --git a/phpBB/adm/style/acp_ext_delete_data.html b/phpBB/adm/style/acp_ext_delete_data.html deleted file mode 100644 index 0f3adb7cfe..0000000000 --- a/phpBB/adm/style/acp_ext_delete_data.html +++ /dev/null @@ -1,40 +0,0 @@ -<!-- INCLUDE overall_header.html --> - - <a id="maincontent"></a> - - <h1>{L_EXTENSIONS_ADMIN}</h1> - - <p>{L_EXTENSIONS_EXPLAIN}</p> - <p>{L_EXTENSION_DELETE_DATA_EXPLAIN}</p> - - <!-- IF MIGRATOR_ERROR --> - <div class="errorbox"> - <p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p> - <p>{MIGRATOR_ERROR}</p> - <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p> - </div> - <!-- ELSEIF PRE --> - <div class="errorbox"> - <p>{L_CONFIRM_MESSAGE}</p> - </div> - - <form id="acp_extensions" method="post" action="{U_PURGE}"> - <fieldset class="submit-buttons"> - <legend>{L_EXTENSION_DELETE_DATA}</legend> - <input class="button1" type="submit" name="delete_data" value="{L_EXTENSION_DELETE_DATA}" /> - <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> - </fieldset> - </form> - <!-- ELSEIF S_NEXT_STEP --> - <div class="errorbox"> - <p>{L_EXTENSION_DELETE_DATA_IN_PROGRESS}</p> - </div> - <!-- ELSE --> - <div class="successbox"> - <p>{L_EXTENSION_DELETE_DATA_SUCCESS}</p> - <br /> - <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p> - </div> - <!-- ENDIF --> - -<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html deleted file mode 100644 index d2b5c46fe8..0000000000 --- a/phpBB/adm/style/acp_ext_disable.html +++ /dev/null @@ -1,34 +0,0 @@ -<!-- INCLUDE overall_header.html --> - - <a id="maincontent"></a> - - <h1>{L_EXTENSIONS_ADMIN}</h1> - - <p>{L_EXTENSIONS_EXPLAIN}</p> - <p>{L_EXTENSION_DISABLE_EXPLAIN}</p> - - <!-- IF PRE --> - <fieldset> - <h2>{L_CONFIRM}</h2> - <p>{L_CONFIRM_MESSAGE}</p> - </fieldset> - - <form id="acp_extensions" method="post" action="{U_DISABLE}"> - <fieldset class="submit-buttons"> - <input class="button1" type="submit" name="disable" value="{L_EXTENSION_DISABLE}" /> - <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> - </fieldset> - </form> - <!-- ELSEIF S_NEXT_STEP --> - <div class="successbox notice"> - <p>{L_EXTENSION_DISABLE_IN_PROGRESS}</p> - </div> - <!-- ELSE --> - <div class="successbox"> - <p>{L_EXTENSION_DISABLE_SUCCESS}</p> - <br /> - <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p> - </div> - <!-- ENDIF --> - -<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html deleted file mode 100644 index 8a4a35359e..0000000000 --- a/phpBB/adm/style/acp_ext_enable.html +++ /dev/null @@ -1,40 +0,0 @@ -<!-- INCLUDE overall_header.html --> - - <a id="maincontent"></a> - - <h1>{L_EXTENSIONS_ADMIN}</h1> - - <p>{L_EXTENSIONS_EXPLAIN}</p> - <p>{L_EXTENSION_ENABLE_EXPLAIN}</p> - - <!-- IF MIGRATOR_ERROR --> - <div class="errorbox"> - <p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p> - <p>{MIGRATOR_ERROR}</p> - <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p> - </div> - <!-- ELSEIF PRE --> - <fieldset> - <h2>{L_CONFIRM}</h2> - <p>{L_CONFIRM_MESSAGE}</p> - </fieldset> - - <form id="acp_extensions" method="post" action="{U_ENABLE}"> - <fieldset class="submit-buttons"> - <input class="button1" type="submit" name="enable" value="{L_EXTENSION_ENABLE}" /> - <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> - </fieldset> - </form> - <!-- ELSEIF S_NEXT_STEP --> - <div class="successbox notice"> - <p>{L_EXTENSION_ENABLE_IN_PROGRESS}</p> - </div> - <!-- ELSE --> - <div class="successbox"> - <p>{L_EXTENSION_ENABLE_SUCCESS}</p> - <br /> - <p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p> - </div> - <!-- ENDIF --> - -<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html index 8e2c7452a3..e5783124c6 100644 --- a/phpBB/adm/style/acp_ext_list.html +++ b/phpBB/adm/style/acp_ext_list.html @@ -7,7 +7,7 @@ <p>{L_EXTENSIONS_EXPLAIN}</p> <fieldset class="quick"> - <span class="small"><a href="https://www.phpbb.com/go/customise/extensions/3.2" target="_blank">{L_BROWSE_EXTENSIONS_DATABASE}</a> • <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE_ALL}</a> • <a href="javascript:phpbb.toggleDisplay('version_check_settings');">{L_SETTINGS}</a></span> + <span class="small"><a href="https://www.phpbb.com/go/customise/extensions/3.3" target="_blank">{L_BROWSE_EXTENSIONS_DATABASE}</a> • <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE_ALL}</a> • <a href="javascript:phpbb.toggleDisplay('version_check_settings');">{L_SETTINGS}</a></span> </fieldset> <form id="version_check_settings" method="post" action="{U_ACTION}" style="display:none"> @@ -42,8 +42,8 @@ </tr> </thead> <tbody> - <!-- IF .enabled --> - <tr> + + <tr id="ext_enabled_header"<!-- IF not .enabled --> class="hidden"<!-- ENDIF -->> <td class="row3" colspan="4"><strong>{L_EXTENSIONS_ENABLED}</strong><!-- EVENT acp_ext_list_enabled_title_after --></td> </tr> <!-- BEGIN enabled --> @@ -59,17 +59,12 @@ </td> <td style="text-align: center;"><a href="{enabled.U_DETAILS}">{L_DETAILS}</a></td> <td style="text-align: center;"> - <!-- BEGIN actions --> - <a href="{enabled.actions.U_ACTION}"<!-- IF enabled.actions.L_ACTION_EXPLAIN --> title="{enabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{enabled.actions.L_ACTION}</a> - <!-- IF not enabled.actions.S_LAST_ROW --> | <!-- ENDIF --> - <!-- END actions --> + <!-- INCLUDE acp_ext_actions.html --> </td> </tr> <!-- END enabled --> - <!-- ENDIF --> - <!-- IF .disabled --> - <tr> + <tr id="ext_disabled_header"<!-- IF not .disabled --> class="hidden"<!-- ENDIF -->> <td class="row3" colspan="4"><strong>{L_EXTENSIONS_DISABLED}</strong><!-- EVENT acp_ext_list_disabled_title_after --></td> </tr> <!-- BEGIN disabled --> @@ -87,14 +82,10 @@ <!-- IF disabled.U_DETAILS --><a href="{disabled.U_DETAILS}">{L_DETAILS}</a><!-- ENDIF --> </td> <td style="text-align: center;"> - <!-- BEGIN actions --> - <a href="{disabled.actions.U_ACTION}"<!-- IF disabled.actions.L_ACTION_EXPLAIN --> title="{disabled.actions.L_ACTION_EXPLAIN}"<!-- ENDIF -->>{disabled.actions.L_ACTION}</a> - <!-- IF not disabled.actions.S_LAST_ROW --> | <!-- ENDIF --> - <!-- END actions --> + <!-- INCLUDE acp_ext_actions.html --> </td> </tr> <!-- END disabled --> - <!-- ENDIF --> </tbody> </table> diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index d0096370d9..8eec3b63c6 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -98,7 +98,7 @@ <input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" /> <!-- IF GROUP_COLOUR --> <span style="background-color: #{GROUP_COLOUR}"> </span><!-- ENDIF --> <span> [ <a href="#" id="color_palette_toggle">{L_COLOUR_SWATCH}</a> ]</span> - <div id="color_palette_placeholder" style="display: none;" data-orientation="h" data-height="12" data-width="15" data-target="#group_colour"></div> + <div id="color_palette_placeholder" style="display: none;" data-color-palette="h" data-height="12" data-width="15" data-target="#group_colour"></div> </dd> </dl> <dl> diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index 79fef94207..5e3ac9532a 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -69,7 +69,7 @@ <p>{L_ACP_LANGUAGE_PACKS_EXPLAIN}</p> <fieldset class="quick"> - <span class="small"><a href="https://www.phpbb.com/go/customise/language-packs/3.2" target="_blank">{L_BROWSE_LANGUAGE_PACKS_DATABASE}</a></span> + <span class="small"><a href="https://www.phpbb.com/go/customise/language-packs/3.3" target="_blank">{L_BROWSE_LANGUAGE_PACKS_DATABASE}</a></span> </fieldset> <table class="table1 zebra-table"> diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index 12477a4b77..ce55d81375 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -94,90 +94,113 @@ <!-- EVENT acp_main_notice_after --> - <table class="table1 two-columns no-header" data-no-responsive-header="true"> - <caption>{L_FORUM_STATS}</caption> - <col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" /> - <thead> - <tr> - <th>{L_STATISTIC}</th> - <th>{L_VALUE}</th> - <th>{L_STATISTIC}</th> - <th>{L_VALUE}</th> - </tr> - </thead> - <tbody> - <tr> - <td>{L_NUMBER_POSTS}{L_COLON} </td> - <td><strong>{TOTAL_POSTS}</strong></td> - <td>{L_POSTS_PER_DAY}{L_COLON} </td> - <td><strong>{POSTS_PER_DAY}</strong></td> - </tr> - <tr> - <td>{L_NUMBER_TOPICS}{L_COLON} </td> - <td><strong>{TOTAL_TOPICS}</strong></td> - <td>{L_TOPICS_PER_DAY}{L_COLON} </td> - <td><strong>{TOPICS_PER_DAY}</strong></td> - </tr> - <tr> - <td>{L_NUMBER_USERS}{L_COLON} </td> - <td><strong>{TOTAL_USERS}</strong></td> - <td>{L_USERS_PER_DAY}{L_COLON} </td> - <td><strong>{USERS_PER_DAY}</strong></td> - </tr> - <tr> - <td>{L_NUMBER_FILES}{L_COLON} </td> - <td><strong>{TOTAL_FILES}</strong></td> - <td>{L_FILES_PER_DAY}{L_COLON} </td> - <td><strong>{FILES_PER_DAY}</strong></td> - </tr> - <tr> - <td>{L_BOARD_STARTED}{L_COLON} </td> - <td><strong>{START_DATE}</strong></td> - <td>{L_AVATAR_DIR_SIZE}{L_COLON} </td> - <td><strong>{AVATAR_DIR_SIZE}</strong></td> - </tr> - <tr> - <td>{L_DATABASE_SIZE}{L_COLON} </td> - <td><strong>{DBSIZE}</strong></td> - <td>{L_UPLOAD_DIR_SIZE}{L_COLON} </td> - <td><strong>{UPLOAD_DIR_SIZE}</strong></td> - </tr> - <tr> - <td>{L_DATABASE_SERVER_INFO}{L_COLON} </td> - <td><strong>{DATABASE_INFO}</strong></td> - <td>{L_GZIP_COMPRESSION}{L_COLON} </td> - <td><strong>{GZIP_COMPRESSION}</strong></td> - </tr> - <tr> - <td>{L_PHP_VERSION}{L_COLON} </td> - <td><strong>{PHP_VERSION_INFO}</strong></td> - <!-- IF S_TOTAL_ORPHAN --> - <td>{L_NUMBER_ORPHAN}{L_COLON} </td> - <td> - <!-- IF TOTAL_ORPHAN > 0 --> - <a href="{U_ATTACH_ORPHAN}" title="{L_MORE_INFORMATION}"><strong>{TOTAL_ORPHAN}</strong></a> - <!-- ELSE --> - <strong>{TOTAL_ORPHAN}</strong> - <!-- ENDIF --> - </td> - <!-- ELSE --> - <td> </td> - <td> </td> - <!-- ENDIF --> - </tr> - <!-- IF S_VERSIONCHECK --> - <tr> - <td>{L_BOARD_VERSION}{L_COLON} </td> - <td> - <strong><a href="{U_VERSIONCHECK}" <!-- IF S_VERSION_UP_TO_DATE -->style="color: #228822;" <!-- ELSEIF not S_VERSIONCHECK_FAIL -->style="color: #BC2A4D;" <!-- ENDIF -->title="{L_MORE_INFORMATION}">{BOARD_VERSION}</a></strong> [ <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> ] - </td> - <td> </td> - <td> </td> - </tr> - <!-- ENDIF --> - </tbody> - </table> - + <div class="lside"> + <table class="table1 zebra-table no-header" data-no-responsive-header="true"> + <thead> + <tr> + <th>{L_STATISTIC}</th> + <th>{L_VALUE}</th> + </tr> + </thead> + <tbody> + <tr> + <td class="tabled">{L_NUMBER_POSTS}{L_COLON}</td> + <td class="tabled"><strong>{TOTAL_POSTS}</strong></td> + </tr> + <tr> + <td class="tabled">{L_POSTS_PER_DAY}{L_COLON}</td> + <td class="tabled"><strong>{POSTS_PER_DAY}</strong></td> + </tr> + <tr> + <td class="tabled">{L_NUMBER_TOPICS}{L_COLON}</td> + <td class="tabled"><strong>{TOTAL_TOPICS}</strong></td> + </tr> + <tr> + <td class="tabled">{L_TOPICS_PER_DAY}{L_COLON}</td> + <td class="tabled"><strong>{TOPICS_PER_DAY}</strong></td> + </tr> + <tr> + <td class="tabled">{L_NUMBER_USERS}{L_COLON}</td> + <td class="tabled"><strong>{TOTAL_USERS}</strong></td> + </tr> + <tr> + <td class="tabled">{L_USERS_PER_DAY}{L_COLON}</td> + <td class="tabled"><strong>{USERS_PER_DAY}</strong></td> + </tr> + <tr> + <td class="tabled">{L_NUMBER_FILES}{L_COLON}</td> + <td class="tabled"><strong>{TOTAL_FILES}</strong></td> + </tr> + <tr> + <td class="tabled">{L_FILES_PER_DAY}{L_COLON}</td> + <td class="tabled"><strong>{FILES_PER_DAY}</strong></td> + </tr> + <tr> + <td class="tabled"> </td> + <td class="tabled"> </td> + </tr> + </tbody> + </table> + <table class="table1 zebra-table no-header" data-no-responsive-header="true"> + <thead> + <tr> + <th>{L_STATISTIC}</th> + <th>{L_VALUE}</th> + </tr> + </thead> + <tbody> + <tr> + <td class="tabled">{L_BOARD_STARTED}{L_COLON}</td> + <td class="tabled"><strong>{START_DATE}</strong></td> + </tr> + <tr> + <td class="tabled">{L_AVATAR_DIR_SIZE}{L_COLON}</td> + <td class="tabled"><strong>{AVATAR_DIR_SIZE}</strong></td> + </tr> + <tr> + <td class="tabled">{L_DATABASE_SIZE}{L_COLON}</td> + <td class="tabled"><strong>{DBSIZE}</strong></td> + </tr> + <tr> + <td class="tabled">{L_UPLOAD_DIR_SIZE}{L_COLON}</td> + <td class="tabled"><strong>{UPLOAD_DIR_SIZE}</strong></td> + </tr> + <tr> + <td class="tabled">{L_DATABASE_SERVER_INFO}{L_COLON}</td> + <td class="tabled"><strong>{DATABASE_INFO}</strong></td> + </tr> + <tr> + <td class="tabled">{L_GZIP_COMPRESSION}{L_COLON}</td> + <td class="tabled"><strong>{GZIP_COMPRESSION}</strong></td> + </tr> + <tr> + <td class="tabled">{L_PHP_VERSION}{L_COLON}</td> + <td class="tabled"><strong>{PHP_VERSION_INFO}</strong></td> + </tr> + <tr> + <!-- IF S_TOTAL_ORPHAN --> + <td class="tabled">{L_NUMBER_ORPHAN}{L_COLON}</td> + <td class="tabled"> + <!-- IF TOTAL_ORPHAN > 0 --> + <a href="{U_ATTACH_ORPHAN}" title="{L_MORE_INFORMATION}"><strong>{TOTAL_ORPHAN}</strong></a> + <!-- ELSE --> + <strong>{TOTAL_ORPHAN}</strong> + <!-- ENDIF --> + </td> + <!-- ELSE --> + <!-- ENDIF --> + </tr> + <!-- IF S_VERSIONCHECK --> + <tr> + <td class="tabled">{L_BOARD_VERSION}{L_COLON}</td> + <td class="tabled"> + <strong><a href="{U_VERSIONCHECK}" <!-- IF S_VERSION_UP_TO_DATE -->style="color: #228822;" <!-- ELSEIF not S_VERSIONCHECK_FAIL -->style="color: #BC2A4D;" <!-- ENDIF -->title="{L_MORE_INFORMATION}">{BOARD_VERSION}</a></strong> [ <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> ] + </td> + </tr> + <!-- ENDIF --> + </tbody> + </table> + </div> <!-- IF S_ACTION_OPTIONS --> <fieldset> <legend>{L_STATISTIC_RESYNC_OPTIONS}</legend> diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index 38bec5a1e4..b9c3925eca 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -33,7 +33,7 @@ <!-- IF L_EXPLAIN --><p>{L_EXPLAIN}</p><!-- ENDIF --> <fieldset class="quick"> - <span class="small"><a href="https://www.phpbb.com/go/customise/styles/3.2" target="_blank">{L_BROWSE_STYLES_DATABASE}</a></span> + <span class="small"><a href="https://www.phpbb.com/go/customise/styles/3.3" target="_blank">{L_BROWSE_STYLES_DATABASE}</a></span> </fieldset> <form id="acp_styles" method="post" action="{U_ACTION}"> diff --git a/phpBB/adm/style/acp_users_signature.html b/phpBB/adm/style/acp_users_signature.html index c7ec5cc0eb..2e57700fd1 100644 --- a/phpBB/adm/style/acp_users_signature.html +++ b/phpBB/adm/style/acp_users_signature.html @@ -26,7 +26,7 @@ <!-- INCLUDE acp_posting_buttons.html --> <dl class="responsive-columns"> - <dt style="width: 90px;" id="color_palette_placeholder" data-orientation="v" data-height="12" data-width="15" data-bbcode="true"> + <dt style="width: 90px;" id="color_palette_placeholder" data-color-palette="v" data-height="12" data-width="15" data-bbcode="true"> </dt> <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px;"><textarea name="signature" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" data-bbcode="true">{SIGNATURE}</textarea></dd> <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 90px; margin-top: 5px;"> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 7cf6c22236..4f0a3312e4 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1,4 +1,4 @@ -/* phpBB 3.2 Admin Style Sheet +/* phpBB 3.3 Admin Style Sheet ------------------------------------------------------------------------ Original author: subBlue ( http://www.subblue.com/ ) Copyright (c) phpBB Limited <https://www.phpbb.com> @@ -723,9 +723,20 @@ td { } .table1 { - border-collapse: separate; - border-spacing: 1px; clear: both; + border-spacing: 1px; + border-collapse: separate; +} + +@media only screen and (min-width: 1100px), only screen and (min-device-width: 1100px) { + .lside .table1 { + display: inline-table; + width: 49.7%; + } +} + +.tabled { + width: 25%; } dt#color_palette_placeholder table { diff --git a/phpBB/adm/style/admin.js b/phpBB/adm/style/admin.js index 551c78a4a3..5fdd07356c 100644 --- a/phpBB/adm/style/admin.js +++ b/phpBB/adm/style/admin.js @@ -229,6 +229,64 @@ function parse_document(container) } /** + * Extension actions helper functions + */ +function move_to_enabled(element) +{ + var disabled_header = document.querySelector('#ext_disabled_header'); + disabled_header.parentNode.insertBefore(element, disabled_header); + element.classList.remove('ext_disabled'); + element.classList.add('ext_enabled'); +} +function move_to_disabled(element) +{ + var table_body = document.querySelector('#ext_disabled_header').parentNode; + table_body.appendChild(element); + element.classList.remove('ext_enabled'); + element.classList.add('ext_disabled'); +} +function set_actions(container, actions) { + container.innerHTML = ''; + for (var i = 0; i < actions.length; i++) { + var a = document.createElement('a'); + a.href = actions[i].U_ACTION.split('&').join('&'); // replace all occurances + a.title = actions[i].L_ACTION_EXPLAIN; + if (actions[i].COLOR) { + a.style = actions[i].COLOR; + } + a.innerHTML = actions[i].L_ACTION; + // ajaxify this action as well + phpbb.ajaxify({ + selector: a, + refresh: true, + callback: actions[i].ACTION_AJAX + }); + + container.appendChild(a); + + if (i < actions.length - 1) { + container.innerHTML += ' | '; + } + } +} +function show_enabled_header() { + document.querySelector('#ext_enabled_header').classList.remove('hidden'); +} +function show_disabled_header() { + document.querySelector('#ext_disabled_header').classList.remove('hidden'); +} +function hide_disabled_header_if_empty() { + if (!document.querySelector('.ext_disabled')) { + document.querySelector('#ext_disabled_header').classList.add('hidden'); + } +} +function hide_enabled_header_if_empty() { + if (!document.querySelector('.ext_enabled')) { + document.querySelector('#ext_enabled_header').classList.add('hidden'); + } +} + +/** * Run onload functions */ (function($) { diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index 895bb056e5..644e74bef7 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -158,6 +158,34 @@ phpbb.addAjaxCallback('row_delete', function(res) { }); /** + * Callbacks for extension actions + */ +phpbb.addAjaxCallback('ext_enable', function(res) { + if (res.EXT_ENABLE_SUCCESS) { + move_to_enabled(this.parentNode.parentNode); + set_actions(this.parentNode, res.ACTIONS); + show_enabled_header(); + hide_disabled_header_if_empty(); + } +}); +phpbb.addAjaxCallback('ext_delete_data', function(res) { + if (res.EXT_DELETE_DATA_SUCCESS) { + move_to_disabled(this.parentNode.parentNode); + set_actions(this.parentNode, res.ACTIONS); + show_disabled_header(); + hide_enabled_header_if_empty(); + } +}); +phpbb.addAjaxCallback('ext_disable', function(res) { + if (res.EXT_DISABLE_SUCCESS) { + move_to_disabled(this.parentNode.parentNode); + set_actions(this.parentNode, res.ACTIONS); + show_disabled_header(); + hide_enabled_header_if_empty(); + } +}); + +/** * Handler for submitting permissions form in chunks * This call will submit permissions forms in chunks of 5 fieldsets. */ diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 5218a8c1be..2ce20a3b1a 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1492,7 +1492,7 @@ phpbb.colorPalette = function(dir, width, height) { * @param {jQuery} el jQuery object for the palette container. */ phpbb.registerPalette = function(el) { - var orientation = el.attr('data-orientation'), + var orientation = el.attr('data-color-palette'), height = el.attr('data-height'), width = el.attr('data-width'), target = el.attr('data-target'), @@ -1662,7 +1662,7 @@ $(function() { phpbb.registerPageDropdowns(); - $('[data-orientation]').each(function() { + $('[data-color-palette]').each(function() { phpbb.registerPalette($(this)); }); diff --git a/phpBB/common.php b/phpBB/common.php index 172503f078..fc009dd8c4 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -12,7 +12,7 @@ */ /** -* Minimum Requirement: PHP 5.4.0 +* Minimum Requirement: PHP 7.1.0 */ if (!defined('IN_PHPBB')) @@ -132,6 +132,8 @@ catch (InvalidArgumentException $e) $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver')); $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); +$phpbb_container->get('dbal.conn')->set_debug_sql_explain($phpbb_container->getParameter('debug.sql_explain')); +$phpbb_container->get('dbal.conn')->set_debug_load_time($phpbb_container->getParameter('debug.load_time')); require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx); register_compatibility_globals(); diff --git a/phpBB/composer.json b/phpBB/composer.json index d192fd57c8..f42b6f268d 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -25,51 +25,51 @@ "phpbb/phpbb-core": "self.version" }, "require": { - "php": ">=5.4", - "bantu/ini-get-wrapper": "1.0.*", + "php": ">=7.1", + "ext-json": "*", + "bantu/ini-get-wrapper": "~1.0", "google/recaptcha": "~1.1", - "guzzlehttp/guzzle": "~5.3", + "guzzlehttp/guzzle": "~6.3", "lusitanian/oauth": "^0.8.1", "marc1706/fast-image-size": "^1.1", "paragonie/random_compat": "^1.4", "patchwork/utf8": "^1.1", "s9e/text-formatter": "^1.3", - "symfony/config": "^2.8", - "symfony/console": "^2.8", - "symfony/debug": "^2.8", - "symfony/dependency-injection": "^2.8", - "symfony/event-dispatcher": "^2.8", - "symfony/filesystem": "^2.8", - "symfony/finder": "^2.8", - "symfony/http-foundation": "^2.8", - "symfony/http-kernel": "^2.8", - "symfony/proxy-manager-bridge": "^2.8", - "symfony/routing": "^2.8", - "symfony/twig-bridge": "^2.8", - "symfony/yaml": "^2.8", - "twig/twig": "^1.0" + "symfony/config": "~3.4", + "symfony/console": "~3.4", + "symfony/debug": "~3.4", + "symfony/dependency-injection": "~3.4", + "symfony/event-dispatcher": "~3.4", + "symfony/filesystem": "~3.4", + "symfony/finder": "~3.4", + "symfony/http-foundation": "~3.4", + "symfony/http-kernel": "~3.4", + "symfony/proxy-manager-bridge": "~3.4", + "symfony/routing": "~3.4", + "symfony/twig-bridge": "~3.4", + "symfony/yaml": "~3.4", + "twig/twig": "^1.0 || ^2.0" }, "require-dev": { - "fabpot/goutte": "~2.0", - "facebook/webdriver": "~1.1", - "laravel/homestead": "~2.2", - "phing/phing": "2.4.*", - "phpunit/dbunit": "1.3.*", - "phpunit/phpunit": "^4.1", - "sami/sami": "1.*", - "squizlabs/php_codesniffer": "2.*", - "symfony/browser-kit": "^2.8", - "symfony/css-selector": "^2.8", - "symfony/dom-crawler": "^2.8" + "fabpot/goutte": "~3.2", + "facebook/webdriver": "~1.6", + "laravel/homestead": "~7.0", + "phing/phing": "~2.4", + "phpunit/dbunit": "~4.0", + "phpunit/phpunit": "^7.0", + "squizlabs/php_codesniffer": "~3.4", + "symfony/browser-kit": "~3.4", + "symfony/css-selector": "~3.4", + "symfony/dom-crawler": "~3.4" }, "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "3.3.x-dev" } }, "config": { "platform": { - "php": "5.4.7" + "php": "7.1" } } } diff --git a/phpBB/composer.lock b/phpBB/composer.lock index 2c338bf292..1759288199 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6daa2f5f7a161377dee1835bd4d5b463", + "content-hash": "c098125fbe2261605adf47a875fe439b", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -38,28 +38,30 @@ }, { "name": "google/recaptcha", - "version": "1.1.2", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/google/recaptcha.git", - "reference": "2b7e00566afca82a38a1d3adb8e42c118006296e" + "reference": "e7add3be59211482ecdb942288f52da64a35f61a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/recaptcha/zipball/2b7e00566afca82a38a1d3adb8e42c118006296e", - "reference": "2b7e00566afca82a38a1d3adb8e42c118006296e", + "url": "https://api.github.com/repos/google/recaptcha/zipball/e7add3be59211482ecdb942288f52da64a35f61a", + "reference": "e7add3be59211482ecdb942288f52da64a35f61a", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "4.5.*" + "friendsofphp/php-cs-fixer": "^2.2.20|^2.12", + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -71,41 +73,53 @@ "license": [ "BSD-3-Clause" ], - "description": "Client library for reCAPTCHA, a free service that protect websites from spam and abuse.", - "homepage": "http://www.google.com/recaptcha/", + "description": "Client library for reCAPTCHA, a free service that protects websites from spam and abuse.", + "homepage": "https://www.google.com/recaptcha/", "keywords": [ "Abuse", "captcha", "recaptcha", "spam" ], - "time": "2015-09-02T17:23:59+00:00" + "time": "2018-08-05T09:31:53+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "5.3.3", + "version": "6.3.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "93bbdb30d59be6cd9839495306c65f2907370eb9" + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/93bbdb30d59be6cd9839495306c65f2907370eb9", - "reference": "93bbdb30d59be6cd9839495306c65f2907370eb9", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "shasum": "" }, "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0", - "react/promise": "^2.2" + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { "GuzzleHttp\\": "src/" } @@ -121,7 +135,7 @@ "homepage": "https://github.com/mtdowling" } ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "description": "Guzzle is a PHP HTTP client library", "homepage": "http://guzzlephp.org/", "keywords": [ "client", @@ -132,44 +146,41 @@ "rest", "web service" ], - "time": "2018-07-31T13:33:10+00:00" + "time": "2018-04-22T15:46:56+00:00" }, { - "name": "guzzlehttp/ringphp", - "version": "1.1.1", + "name": "guzzlehttp/promises", + "version": "v1.3.1", "source": { "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", "shasum": "" }, "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" + "php": ">=5.5.0" }, "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" + "phpunit/phpunit": "^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.4-dev" } }, "autoload": { "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -182,39 +193,50 @@ "homepage": "https://github.com/mtdowling" } ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "time": "2018-07-31T13:22:33+00:00" + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" }, { - "name": "guzzlehttp/streams", - "version": "3.0.0", + "name": "guzzlehttp/psr7", + "version": "1.5.2", "source": { "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" + "url": "https://github.com/guzzle/psr7.git", + "reference": "9f83dded91781a01c63574e387eaa769be769115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" + }, + "provide": { + "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.5-dev" } }, "autoload": { "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -225,57 +247,24 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ], - "time": "2014-10-12T19:18:40+00:00" - }, - { - "name": "ircmaxell/password-compat", - "version": "v1.0.4", - "source": { - "type": "git", - "url": "https://github.com/ircmaxell/password_compat.git", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "autoload": { - "files": [ - "lib/password.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ + }, { - "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", - "homepage": "http://blog.ircmaxell.com" + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", - "homepage": "https://github.com/ircmaxell/password_compat", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ - "hashing", - "password" + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" ], - "time": "2014-11-20T16:49:30+00:00" + "time": "2018-12-04T20:46:45+00:00" }, { "name": "lusitanian/oauth", @@ -397,39 +386,95 @@ "time": "2017-10-23T18:52:01+00:00" }, { + "name": "ocramius/package-versions", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" + }, + "require-dev": { + "composer/composer": "^1.6.3", + "doctrine/coding-standard": "^5.0.1", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2019-02-21T12:16:21+00:00" + }, + { "name": "ocramius/proxy-manager", - "version": "1.0.2", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/Ocramius/ProxyManager.git", - "reference": "57e9272ec0e8deccf09421596e0e2252df440e11" + "reference": "e18ac876b2e4819c76349de8f78ccc8ef1554cd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11", - "reference": "57e9272ec0e8deccf09421596e0e2252df440e11", + "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/e18ac876b2e4819c76349de8f78ccc8ef1554cd7", + "reference": "e18ac876b2e4819c76349de8f78ccc8ef1554cd7", "shasum": "" }, "require": { - "php": ">=5.3.3", - "zendframework/zend-code": ">2.2.5,<3.0" + "ocramius/package-versions": "^1.1.1", + "php": "^7.1.0", + "zendframework/zend-code": "^3.1.0" }, "require-dev": { + "couscous/couscous": "^1.5.2", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "1.5.*" + "humbug/humbug": "dev-master@DEV", + "nikic/php-parser": "^3.0.4", + "phpbench/phpbench": "^0.12.2", + "phpstan/phpstan": "^0.6.4", + "phpunit/phpunit": "^5.6.4", + "phpunit/phpunit-mock-objects": "^3.4.1", + "squizlabs/php_codesniffer": "^2.7.0" }, "suggest": { "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)", "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)", - "zendframework/zend-stdlib": "To use the hydrator proxy", "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -445,7 +490,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "http://ocramius.github.io/" } ], "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", @@ -457,7 +502,7 @@ "proxy pattern", "service proxies" ], - "time": "2015-08-09T04:28:19+00:00" + "time": "2017-05-04T11:12:50+00:00" }, { "name": "paragonie/random_compat", @@ -567,6 +612,105 @@ "time": "2016-05-18T13:57:10+00:00" }, { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { "name": "psr/log", "version": "1.1.0", "source": { @@ -614,32 +758,30 @@ "time": "2018-11-20T15:27:04+00:00" }, { - "name": "react/promise", - "version": "v2.7.1", + "name": "ralouphie/getallheaders", + "version": "2.0.5", "source": { "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "31ffa96f8d2ed0341a57848cbb84d88b89dd664d" + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/31ffa96f8d2ed0341a57848cbb84d88b89dd664d", - "reference": "31ffa96f8d2ed0341a57848cbb84d88b89dd664d", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" }, "type": "library", "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, "files": [ - "src/functions_include.php" + "src/getallheaders.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -648,29 +790,25 @@ ], "authors": [ { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" } ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "time": "2019-01-07T21:25:54+00:00" + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" }, { "name": "s9e/text-formatter", - "version": "1.4.2", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/s9e/TextFormatter.git", - "reference": "dc7efff70b67b9cee00881ad3bef0a1da076b31e" + "reference": "76138c98161b2a063ecb28f5a46f9212a04aad1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/dc7efff70b67b9cee00881ad3bef0a1da076b31e", - "reference": "dc7efff70b67b9cee00881ad3bef0a1da076b31e", + "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/76138c98161b2a063ecb28f5a46f9212a04aad1a", + "reference": "76138c98161b2a063ecb28f5a46f9212a04aad1a", "shasum": "" }, "require": { @@ -722,29 +860,36 @@ "parser", "shortcodes" ], - "time": "2019-03-27T14:19:41+00:00" + "time": "2019-04-26T12:32:18+00:00" }, { "name": "symfony/config", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "7dd5f5040dc04c118d057fb5886563963eb70011" + "reference": "177a276c01575253c95cefe0866e3d1b57637fe0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/7dd5f5040dc04c118d057fb5886563963eb70011", - "reference": "7dd5f5040dc04c118d057fb5886563963eb70011", + "url": "https://api.github.com/repos/symfony/config/zipball/177a276c01575253c95cefe0866e3d1b57637fe0", + "reference": "177a276c01575253c95cefe0866e3d1b57637fe0", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~3.0.0", + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", "symfony/polyfill-ctype": "~1.8" }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, "require-dev": { - "symfony/yaml": "~2.7|~3.0.0" + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -752,7 +897,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -779,41 +924,52 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-11-26T09:38:12+00:00" + "time": "2019-02-23T15:06:07+00:00" }, { "name": "symfony/console", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" + "reference": "15a9104356436cb26e08adab97706654799d31d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8", + "reference": "15a9104356436cb26e08adab97706654799d31d8", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2|~3.0.0", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", + "symfony/lock": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -840,37 +996,36 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-11-20T15:55:20+00:00" + "time": "2019-04-08T09:29:13+00:00" }, { "name": "symfony/debug", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0" + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", - "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "url": "https://api.github.com/repos/symfony/debug/zipball/681afbb26488903c5ac15e63734f1d8ac430c9b9", + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.2|~3.0.0", - "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + "symfony/http-kernel": "~2.8|~3.0|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -897,43 +1052,51 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-04-11T09:48:14+00:00" }, { "name": "symfony/dependency-injection", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "a2f40df187f0053bc361bcea3b27ff2b85744d9f" + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/a2f40df187f0053bc361bcea3b27ff2b85744d9f", - "reference": "a2f40df187f0053bc361bcea3b27ff2b85744d9f", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be0feb3fa202aedfd8d1956f2dafd563fb13acbf", + "reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8", + "psr/container": "^1.0" }, "conflict": { - "symfony/expression-language": "<2.6" + "symfony/config": "<3.3.7", + "symfony/finder": "<3.3", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "~2.2|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7" + "symfony/config": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/config": "", "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -960,31 +1123,34 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-04-20T15:32:49+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a088aafcefb4eef2520a290ed82e4374092a6dff", + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -993,7 +1159,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1020,30 +1186,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-11-21T14:20:20+00:00" + "time": "2019-04-02T08:51:52+00:00" }, { "name": "symfony/filesystem", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "7ae46872dad09dffb7fe1e93a0937097339d0080" + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/7ae46872dad09dffb7fe1e93a0937097339d0080", - "reference": "7ae46872dad09dffb7fe1e93a0937097339d0080", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/acf99758b1df8e9295e6b85aa69f294565c9fedb", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1070,29 +1236,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-02-04T21:34:32+00:00" }, { "name": "symfony/finder", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "1444eac52273e345d9b95129bf914639305a9ba4" + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/1444eac52273e345d9b95129bf914639305a9ba4", - "reference": "1444eac52273e345d9b95129bf914639305a9ba4", + "url": "https://api.github.com/repos/symfony/finder/zipball/61af5ce0b34b942d414fe8f1b11950d0e9a90e98", + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1119,35 +1285,34 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-04-02T19:54:57+00:00" }, { "name": "symfony/http-foundation", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "d0ab719bedc9fc6748a95b2dcb04137292a27b92" + "reference": "fa02215233be8de1c2b44617088192f9e8db3512" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0ab719bedc9fc6748a95b2dcb04137292a27b92", - "reference": "d0ab719bedc9fc6748a95b2dcb04137292a27b92", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/fa02215233be8de1c2b44617088192f9e8db3512", + "reference": "fa02215233be8de1c2b44617088192f9e8db3512", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php54": "~1.0", - "symfony/polyfill-php55": "~1.0" + "symfony/polyfill-php70": "~1.6" }, "require-dev": { - "symfony/expression-language": "~2.4|~3.0.0" + "symfony/expression-language": "~2.8|~3.0|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1174,54 +1339,59 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-11-25T11:27:05+00:00" + "time": "2019-05-01T08:04:33+00:00" }, { "name": "symfony/http-kernel", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "3df0207d4c973eb9c91b38a608aef4654dc256fa" + "reference": "586046f5adc6a08eaebbe4519ef18ad52f54e453" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3df0207d4c973eb9c91b38a608aef4654dc256fa", - "reference": "3df0207d4c973eb9c91b38a608aef4654dc256fa", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/586046f5adc6a08eaebbe4519ef18ad52f54e453", + "reference": "586046f5adc6a08eaebbe4519ef18ad52f54e453", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0", - "symfony/debug": "^2.6.2", - "symfony/event-dispatcher": "^2.6.7|~3.0.0", - "symfony/http-foundation": "~2.7.36|~2.8.29|~3.1.6", + "symfony/debug": "^3.3.3|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~3.4.12|~4.0.12|^4.1.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/config": "<2.7", + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4.10|<4.0.10,>=4", + "symfony/var-dumper": "<3.3", "twig/twig": "<1.34|<2.4,>=2" }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { - "symfony/browser-kit": "~2.3|~3.0.0", - "symfony/class-loader": "~2.1|~3.0.0", - "symfony/config": "~2.8", - "symfony/console": "~2.3|~3.0.0", - "symfony/css-selector": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.8|~3.0.0", - "symfony/dom-crawler": "^2.0.5|~3.0.0", - "symfony/expression-language": "~2.4|~3.0.0", - "symfony/finder": "^2.0.5|~3.0.0", - "symfony/process": "^2.0.5|~3.0.0", - "symfony/routing": "~2.8|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0", - "symfony/templating": "~2.2|~3.0.0", - "symfony/translation": "^2.0.5|~3.0.0", - "symfony/var-dumper": "~2.6|~3.0.0" + "psr/cache": "~1.0", + "symfony/browser-kit": "~2.8|~3.0|~4.0", + "symfony/class-loader": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/console": "~2.8|~3.0|~4.0", + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "^3.4.10|^4.0.10", + "symfony/dom-crawler": "~2.8|~3.0|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0", + "symfony/routing": "~3.4|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0", + "symfony/templating": "~2.8|~3.0|~4.0", + "symfony/translation": "~2.8|~3.0|~4.0", + "symfony/var-dumper": "~3.3|~4.0" }, "suggest": { "symfony/browser-kit": "", - "symfony/class-loader": "", "symfony/config": "", "symfony/console": "", "symfony/dependency-injection": "", @@ -1231,7 +1401,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1258,7 +1428,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-12-06T14:45:07+00:00" + "time": "2019-05-01T13:03:24+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1305,7 +1475,7 @@ }, { "name": "Gert de Pagter", - "email": "backendtea@gmail.com" + "email": "BackEndTea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -1378,20 +1548,21 @@ "time": "2019-02-06T07:57:58+00:00" }, { - "name": "symfony/polyfill-php54", + "name": "symfony/polyfill-php70", "version": "v1.11.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "2964b17ddc32dba7bcba009d5501c84d3fba1452" + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "bc4858fb611bda58719124ca079baff854149c89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/2964b17ddc32dba7bcba009d5501c84d3fba1452", - "reference": "2964b17ddc32dba7bcba009d5501c84d3fba1452", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/bc4858fb611bda58719124ca079baff854149c89", + "reference": "bc4858fb611bda58719124ca079baff854149c89", "shasum": "" }, "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", "php": ">=5.3.3" }, "type": "library", @@ -1402,7 +1573,7 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php54\\": "" + "Symfony\\Polyfill\\Php70\\": "" }, "files": [ "bootstrap.php" @@ -1425,63 +1596,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2019-02-06T07:57:58+00:00" - }, - { - "name": "symfony/polyfill-php55", - "version": "v1.11.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "96fa25cef405ea452919559a0025d5dc16e30e4c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/96fa25cef405ea452919559a0025d5dc16e30e4c", - "reference": "96fa25cef405ea452919559a0025d5dc16e30e4c", - "shasum": "" - }, - "require": { - "ircmaxell/password-compat": "~1.0", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php55\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -1493,30 +1608,30 @@ }, { "name": "symfony/proxy-manager-bridge", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/proxy-manager-bridge.git", - "reference": "9c5f8d58e9c8017affdbeaec86c89d558aee4ec8" + "reference": "f534483997cdfb1984b6fb2130faa61da84771f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/proxy-manager-bridge/zipball/9c5f8d58e9c8017affdbeaec86c89d558aee4ec8", - "reference": "9c5f8d58e9c8017affdbeaec86c89d558aee4ec8", + "url": "https://api.github.com/repos/symfony/proxy-manager-bridge/zipball/f534483997cdfb1984b6fb2130faa61da84771f7", + "reference": "f534483997cdfb1984b6fb2130faa61da84771f7", "shasum": "" }, "require": { "ocramius/proxy-manager": "~0.4|~1.0|~2.0", - "php": ">=5.3.9", - "symfony/dependency-injection": "~2.8|~3.0.0" + "php": "^5.5.9|>=7.0.8", + "symfony/dependency-injection": "~3.4|~4.0" }, "require-dev": { - "symfony/config": "~2.3|~3.0.0" + "symfony/config": "~2.8|~3.0|~4.0" }, "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1543,40 +1658,42 @@ ], "description": "Symfony ProxyManager Bridge", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-04-16T11:13:42+00:00" }, { "name": "symfony/routing", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "8b0df6869d1997baafff6a1541826eac5a03d067" + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/8b0df6869d1997baafff6a1541826eac5a03d067", - "reference": "8b0df6869d1997baafff6a1541826eac5a03d067", + "url": "https://api.github.com/repos/symfony/routing/zipball/ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, "conflict": { - "symfony/config": "<2.7" + "symfony/config": "<3.3.1", + "symfony/dependency-injection": "<3.3", + "symfony/yaml": "<3.4" }, "require-dev": { "doctrine/annotations": "~1.0", "psr/log": "~1.0", - "symfony/config": "~2.7|~3.0.0", - "symfony/expression-language": "~2.4|~3.0.0", - "symfony/http-foundation": "~2.3|~3.0.0", - "symfony/yaml": "^2.0.5|~3.0.0" + "symfony/config": "^3.3.1|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "doctrine/annotations": "For using the annotation loader", "symfony/config": "For using the all-in-one router or any loader", - "symfony/dependency-injection": "For loading routes from a service", "symfony/expression-language": "For using expression matching", "symfony/http-foundation": "For using a Symfony Request object", "symfony/yaml": "For using the YAML loader" @@ -1584,7 +1701,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1617,46 +1734,50 @@ "uri", "url" ], - "time": "2018-11-20T15:55:20+00:00" + "time": "2019-03-29T21:58:42+00:00" }, { "name": "symfony/twig-bridge", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "ecc1e30d05fa99f25b504e2d6a8684555ae39f7c" + "reference": "9fc026c05e927fe59cf89f67b9f9926e44301eea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/ecc1e30d05fa99f25b504e2d6a8684555ae39f7c", - "reference": "ecc1e30d05fa99f25b504e2d6a8684555ae39f7c", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/9fc026c05e927fe59cf89f67b9f9926e44301eea", + "reference": "9fc026c05e927fe59cf89f67b9f9926e44301eea", "shasum": "" }, "require": { - "php": ">=5.3.9", - "twig/twig": "~1.34|~2.4" + "php": "^5.5.9|>=7.0.8", + "twig/twig": "^1.40|^2.9" }, "conflict": { - "symfony/form": "<2.8.23" + "symfony/console": "<3.4", + "symfony/form": "<3.4.13|>=4.0,<4.0.13|>=4.1,<4.1.2" }, "require-dev": { - "symfony/asset": "~2.7|~3.0.0", - "symfony/console": "~2.8|~3.0.0", - "symfony/expression-language": "~2.4|~3.0.0", - "symfony/finder": "~2.3|~3.0.0", - "symfony/form": "^2.8.23", - "symfony/http-foundation": "^2.8.29|~3.0.0", - "symfony/http-kernel": "~2.8|~3.0.0", + "symfony/asset": "~2.8|~3.0|~4.0", + "symfony/console": "~3.4|~4.0", + "symfony/dependency-injection": "~2.8|~3.0|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/form": "^3.4.23|^4.2.4", + "symfony/http-foundation": "^3.3.11|~4.0", + "symfony/http-kernel": "~3.2|~4.0", "symfony/polyfill-intl-icu": "~1.0", - "symfony/routing": "~2.2|~3.0.0", - "symfony/security": "^2.8.31|^3.3.13", - "symfony/security-acl": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.2|~3.0.0", - "symfony/templating": "~2.1|~3.0.0", - "symfony/translation": "~2.7|~3.0.0", - "symfony/var-dumper": "~2.7.16|~2.8.9|~3.0.9", - "symfony/yaml": "^2.0.5|~3.0.0" + "symfony/routing": "~2.8|~3.0|~4.0", + "symfony/security": "^2.8.31|^3.3.13|~4.0", + "symfony/security-acl": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0", + "symfony/templating": "~2.8|~3.0|~4.0", + "symfony/translation": "~2.8|~3.0|~4.0", + "symfony/var-dumper": "~2.8.10|~3.1.4|~3.2|~4.0", + "symfony/web-link": "~3.3|~4.0", + "symfony/workflow": "~3.3|~4.0", + "symfony/yaml": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/asset": "For using the AssetExtension", @@ -1670,12 +1791,13 @@ "symfony/templating": "For using the TwigEngine", "symfony/translation": "For using the TranslationExtension", "symfony/var-dumper": "For using the DumpExtension", + "symfony/web-link": "For using the WebLinkExtension", "symfony/yaml": "For using the YamlExtension" }, "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1702,30 +1824,39 @@ ], "description": "Symfony Twig Bridge", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-04-30T12:26:26+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "02c1859112aa779d9ab394ae4f3381911d84052b" + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/02c1859112aa779d9ab394ae4f3381911d84052b", - "reference": "02c1859112aa779d9ab394ae4f3381911d84052b", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8" }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1752,25 +1883,26 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-03-25T07:48:46+00:00" }, { "name": "twig/twig", - "version": "v1.39.1", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "23e7b6f0cfa1d7ba3de69f30d8e05cf957412fec" + "reference": "82a1c055c8ed4c4705023bfd0405f3c74db6e3ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/23e7b6f0cfa1d7ba3de69f30d8e05cf957412fec", - "reference": "23e7b6f0cfa1d7ba3de69f30d8e05cf957412fec", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/82a1c055c8ed4c4705023bfd0405f3c74db6e3ae", + "reference": "82a1c055c8ed4c4705023bfd0405f3c74db6e3ae", "shasum": "" }, "require": { - "php": ">=5.4.0", - "symfony/polyfill-ctype": "^1.8" + "php": "^7.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { "psr/container": "^1.0", @@ -1780,7 +1912,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.39-dev" + "dev-master": "2.9-dev" } }, "autoload": { @@ -1818,42 +1950,42 @@ "keywords": [ "templating" ], - "time": "2019-04-16T17:12:57+00:00" + "time": "2019-04-28T06:57:38+00:00" }, { "name": "zendframework/zend-code", - "version": "2.5.1", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-code.git", - "reference": "5d998f261ec2a55171c71da57a11622745680153" + "reference": "c21db169075c6ec4b342149f446e7b7b724f95eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-code/zipball/5d998f261ec2a55171c71da57a11622745680153", - "reference": "5d998f261ec2a55171c71da57a11622745680153", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/c21db169075c6ec4b342149f446e7b7b724f95eb", + "reference": "c21db169075c6ec4b342149f446e7b7b724f95eb", "shasum": "" }, "require": { - "php": ">=5.3.23", - "zendframework/zend-eventmanager": "~2.5" + "php": "^7.1", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" }, "require-dev": { - "doctrine/common": ">=2.1", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-stdlib": "~2.5", - "zendframework/zend-version": "~2.5" + "doctrine/annotations": "~1.0", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "zendframework/zend-coding-standard": "^1.0.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" }, "suggest": { - "doctrine/common": "Doctrine\\Common >=2.1 for annotation features", + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", "zendframework/zend-stdlib": "Zend\\Stdlib component" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "3.3.x-dev", + "dev-develop": "3.4.x-dev" } }, "autoload": { @@ -1871,35 +2003,41 @@ "code", "zf2" ], - "time": "2015-06-03T15:31:59+00:00" + "time": "2018-08-13T20:36:59+00:00" }, { "name": "zendframework/zend-eventmanager", - "version": "2.5.1", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "d94a16039144936f107f906896349900fd634443" + "reference": "a5e2583a211f73604691586b8406ff7296a946dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/d94a16039144936f107f906896349900fd634443", - "reference": "d94a16039144936f107f906896349900fd634443", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd", "shasum": "" }, "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "~2.5" + "php": "^5.6 || ^7.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" } }, "autoload": { @@ -1911,99 +2049,48 @@ "license": [ "BSD-3-Clause" ], + "description": "Trigger and listen to events within a PHP application", "homepage": "https://github.com/zendframework/zend-eventmanager", "keywords": [ + "event", "eventmanager", + "events", "zf2" ], - "time": "2015-06-03T15:32:01+00:00" - }, - { - "name": "zendframework/zend-stdlib", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cc8e90a60dd5d44b9730b77d07b97550091da1ae", - "reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-config": "~2.5", - "zendframework/zend-eventmanager": "~2.5", - "zendframework/zend-filter": "~2.5", - "zendframework/zend-inputfilter": "~2.5", - "zendframework/zend-serializer": "~2.5", - "zendframework/zend-servicemanager": "~2.5" - }, - "suggest": { - "zendframework/zend-eventmanager": "To support aggregate hydrator usage", - "zendframework/zend-filter": "To support naming strategy hydrator usage", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Stdlib\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-stdlib", - "keywords": [ - "stdlib", - "zf2" - ], - "time": "2015-06-03T15:32:03+00:00" + "time": "2018-04-25T15:33:34+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "a2c590166b2133a4633738648b6b064edae0814a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", + "reference": "a2c590166b2133a4633738648b6b064edae0814a", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^6.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -2023,44 +2110,50 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2019-03-17T17:37:11+00:00" }, { "name": "fabpot/goutte", - "version": "v2.0.4", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "0ad3ee6dc2d0aaa832a80041a1e09bf394e99802" + "reference": "3f0eaf0a40181359470651f1565b3e07e3dd31b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/0ad3ee6dc2d0aaa832a80041a1e09bf394e99802", - "reference": "0ad3ee6dc2d0aaa832a80041a1e09bf394e99802", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/3f0eaf0a40181359470651f1565b3e07e3dd31b8", + "reference": "3f0eaf0a40181359470651f1565b3e07e3dd31b8", "shasum": "" }, "require": { - "guzzlehttp/guzzle": ">=4,<6", - "php": ">=5.4.0", - "symfony/browser-kit": "~2.1", - "symfony/css-selector": "~2.1", - "symfony/dom-crawler": "~2.1" + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "symfony/browser-kit": "~2.1|~3.0|~4.0", + "symfony/css-selector": "~2.1|~3.0|~4.0", + "symfony/dom-crawler": "~2.1|~3.0|~4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3 || ^4" }, "type": "application", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { "psr-4": { "Goutte\\": "Goutte" - } + }, + "exclude-from-classmap": [ + "Goutte/Tests" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2077,35 +2170,49 @@ "keywords": [ "scraper" ], - "time": "2015-05-05T21:14:57+00:00" + "time": "2018-06-29T15:13:57+00:00" }, { "name": "facebook/webdriver", - "version": "1.1.3", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/facebook/php-webdriver.git", - "reference": "b7186fb1bcfda956d237f59face250d06ef47253" + "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/b7186fb1bcfda956d237f59face250d06ef47253", - "reference": "b7186fb1bcfda956d237f59face250d06ef47253", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/bd8c740097eb9f2fc3735250fc1912bc811a954e", + "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e", "shasum": "" }, "require": { "ext-curl": "*", - "php": ">=5.3.19" + "ext-json": "*", + "ext-mbstring": "*", + "ext-zip": "*", + "php": "^5.6 || ~7.0", + "symfony/process": "^2.8 || ^3.1 || ^4.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^1.11", - "phpunit/phpunit": "4.6.* || ~5.0", - "squizlabs/php_codesniffer": "^2.6" + "friendsofphp/php-cs-fixer": "^2.0", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "php-coveralls/php-coveralls": "^2.0", + "php-mock/php-mock-phpunit": "^1.1", + "phpunit/phpunit": "^5.7", + "sebastian/environment": "^1.3.4 || ^2.0 || ^3.0", + "squizlabs/php_codesniffer": "^2.6", + "symfony/var-dumper": "^3.3 || ^4.0" }, "suggest": { - "phpdocumentor/phpdocumentor": "2.*" + "ext-SimpleXML": "For Firefox profile creation" }, "type": "library", + "extra": { + "branch-alias": { + "dev-community": "1.5-dev" + } + }, "autoload": { "psr-4": { "Facebook\\WebDriver\\": "lib/" @@ -2115,7 +2222,7 @@ "license": [ "Apache-2.0" ], - "description": "A PHP client for WebDriver", + "description": "A PHP client for Selenium WebDriver", "homepage": "https://github.com/facebook/php-webdriver", "keywords": [ "facebook", @@ -2123,31 +2230,41 @@ "selenium", "webdriver" ], - "time": "2016-08-10T00:44:08+00:00" + "time": "2018-05-16T17:37:13+00:00" }, { "name": "laravel/homestead", - "version": "v2.2.2", + "version": "v7.20.0", "source": { "type": "git", "url": "https://github.com/laravel/homestead.git", - "reference": "f4e45f895d8707042c2d0698627d33c484e7c6ba" + "reference": "cae38adcfdde1de1c4581e7a33872adaf9fbf926" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/homestead/zipball/f4e45f895d8707042c2d0698627d33c484e7c6ba", - "reference": "f4e45f895d8707042c2d0698627d33c484e7c6ba", + "url": "https://api.github.com/repos/laravel/homestead/zipball/cae38adcfdde1de1c4581e7a33872adaf9fbf926", + "reference": "cae38adcfdde1de1c4581e7a33872adaf9fbf926", "shasum": "" }, "require": { - "php": ">=5.4", - "symfony/console": "~2.0 || ~3.0", - "symfony/process": "~2.0 || ~3.0" + "php": "^5.6 || ^7.0", + "symfony/console": "~3.3|~4.0", + "symfony/process": "~3.3|~4.0", + "symfony/yaml": "~3.3|~4.0" + }, + "require-dev": { + "phly/changelog-generator": "^2.2", + "phpunit/phpunit": "^5.7 || ^6.0" }, "bin": [ - "homestead" + "bin/homestead" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { "psr-4": { "Laravel\\Homestead\\": "src/" @@ -2164,82 +2281,133 @@ } ], "description": "A virtual machine for web artisans.", - "time": "2016-09-17T04:42:33+00:00" + "time": "2018-12-11T02:04:35+00:00" }, { - "name": "michelf/php-markdown", - "version": "1.8.0", + "name": "myclabs/deep-copy", + "version": "1.9.1", "source": { "type": "git", - "url": "https://github.com/michelf/php-markdown.git", - "reference": "01ab082b355bf188d907b9929cd99b2923053495" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/01ab082b355bf188d907b9929cd99b2923053495", - "reference": "01ab082b355bf188d907b9929cd99b2923053495", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", + "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { "psr-4": { - "Michelf\\": "Michelf/" + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2019-04-07T13:18:21+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { - "name": "Michel Fortin", - "email": "michel.fortin@michelf.ca", - "homepage": "https://michelf.ca/", + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", "role": "Developer" }, { - "name": "John Gruber", - "homepage": "https://daringfireball.net/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "PHP Markdown", - "homepage": "https://michelf.ca/projects/php-markdown/", - "keywords": [ - "markdown" - ], - "time": "2018-01-15T00:49:33+00:00" + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2018-07-08T19:23:20+00:00" }, { - "name": "nikic/php-parser", - "version": "v0.9.5", + "name": "phar-io/version", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "ef70767475434bdb3615b43c327e2cae17ef12eb" + "url": "https://github.com/phar-io/version.git", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ef70767475434bdb3615b43c327e2cae17ef12eb", - "reference": "ef70767475434bdb3615b43c327e2cae17ef12eb", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.2" + "php": "^5.6 || ^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.9-dev" - } - }, "autoload": { - "psr-0": { - "PHPParser": "lib/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2247,37 +2415,85 @@ ], "authors": [ { - "name": "Nikita Popov" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2014-07-23T18:24:17+00:00" + "description": "Library for handling version information and constraints", + "time": "2018-07-08T19:19:57+00:00" }, { "name": "phing/phing", - "version": "2.4.14", + "version": "2.16.1", "source": { "type": "git", "url": "https://github.com/phingofficial/phing.git", - "reference": "41075d93ca254f1c90c79ec7ce81be2b2629e138" + "reference": "cbe0f969e434e269af91b4160b86fe899c6e07c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phingofficial/phing/zipball/41075d93ca254f1c90c79ec7ce81be2b2629e138", - "reference": "41075d93ca254f1c90c79ec7ce81be2b2629e138", + "url": "https://api.github.com/repos/phingofficial/phing/zipball/cbe0f969e434e269af91b4160b86fe899c6e07c7", + "reference": "cbe0f969e434e269af91b4160b86fe899c6e07c7", "shasum": "" }, "require": { - "php": ">=5.2.0" + "php": ">=5.2.0", + "symfony/yaml": "^3.1 || ^4.0" + }, + "require-dev": { + "ext-pdo_sqlite": "*", + "mikey179/vfsstream": "^1.6", + "pdepend/pdepend": "2.x", + "pear/archive_tar": "1.4.x", + "pear/http_request2": "dev-trunk", + "pear/net_growl": "dev-trunk", + "pear/pear-core-minimal": "1.10.1", + "pear/versioncontrol_git": "@dev", + "pear/versioncontrol_svn": "~0.5", + "phpdocumentor/phpdocumentor": "2.x", + "phploc/phploc": "~2.0.6", + "phpmd/phpmd": "~2.2", + "phpunit/phpunit": ">=3.7", + "sebastian/git": "~1.0", + "sebastian/phpcpd": "2.x", + "siad007/versioncontrol_hg": "^1.0", + "simpletest/simpletest": "^1.1", + "squizlabs/php_codesniffer": "~2.2" + }, + "suggest": { + "pdepend/pdepend": "PHP version of JDepend", + "pear/archive_tar": "Tar file management class", + "pear/versioncontrol_git": "A library that provides OO interface to handle Git repository", + "pear/versioncontrol_svn": "A simple OO-style interface for Subversion, the free/open-source version control system", + "phpdocumentor/phpdocumentor": "Documentation Generator for PHP", + "phploc/phploc": "A tool for quickly measuring the size of a PHP project", + "phpmd/phpmd": "PHP version of PMD tool", + "phpunit/php-code-coverage": "Library that provides collection, processing, and rendering functionality for PHP code coverage information", + "phpunit/phpunit": "The PHP Unit Testing Framework", + "sebastian/phpcpd": "Copy/Paste Detector (CPD) for PHP code", + "siad007/versioncontrol_hg": "A library for interfacing with Mercurial repositories.", + "tedivm/jshrink": "Javascript Minifier built in PHP" }, "bin": [ "bin/phing" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.16.x-dev" + } + }, "autoload": { "classmap": [ "classes/phing/" @@ -2288,7 +2504,7 @@ "classes" ], "license": [ - "LGPL3" + "LGPL-3.0" ], "authors": [ { @@ -2297,51 +2513,155 @@ }, { "name": "Phing Community", - "homepage": "http://www.phing.info/trac/wiki/Development/Contributors" + "homepage": "https://www.phing.info/trac/wiki/Development/Contributors" } ], "description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.", - "homepage": "http://www.phing.info/", + "homepage": "https://www.phing.info/", "keywords": [ "build", + "phing", "task", "tool" ], - "time": "2012-11-29T21:23:47+00:00" + "time": "2018-01-25T13:18:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.5", + "version": "4.3.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2019-04-30T17:48:53+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ + "psr-4": { + "phpDocumentor\\Reflection\\": [ "src/" ] } @@ -2353,10 +2673,10 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2016-01-25T08:17:30+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", @@ -2423,55 +2743,48 @@ }, { "name": "phpunit/dbunit", - "version": "1.3.2", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/dbunit.git", - "reference": "1507040c2541bdffd7fbd71fc792cecdea6a7c61" + "reference": "e77b469c3962b5a563f09a2a989f1c9bd38b8615" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/1507040c2541bdffd7fbd71fc792cecdea6a7c61", - "reference": "1507040c2541bdffd7fbd71fc792cecdea6a7c61", + "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/e77b469c3962b5a563f09a2a989f1c9bd38b8615", + "reference": "e77b469c3962b5a563f09a2a989f1c9bd38b8615", "shasum": "" }, "require": { "ext-pdo": "*", "ext-simplexml": "*", - "php": ">=5.3.3", - "phpunit/phpunit": "~3.7|~4.0", - "symfony/yaml": "~2.1" + "php": "^7.1", + "phpunit/phpunit": "^7.0", + "symfony/yaml": "^3.0 || ^4.0" }, - "bin": [ - "composer/bin/dbunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "DbUnit port for PHP/PHPUnit to support database interaction testing.", + "description": "PHPUnit extension for database interaction testing", "homepage": "https://github.com/sebastianbergmann/dbunit/", "keywords": [ "database", @@ -2479,43 +2792,44 @@ "xunit" ], "abandoned": true, - "time": "2015-03-29T14:23:04+00:00" + "time": "2018-02-07T06:47:59+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.1 || ^4.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -2530,7 +2844,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2541,29 +2855,32 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2018-10-31T16:06:48+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -2578,7 +2895,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2588,7 +2905,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -2633,28 +2950,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b389aebe1b8b0578430bda0c7c95a829608e059", + "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -2669,7 +2986,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2678,33 +2995,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2019-02-20T10:12:59+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.12", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/c99e3be9d3e85f60646f152f9002d46ed7770d18", + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2727,45 +3044,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-12-04T08:55:13+00:00" + "time": "2018-10-30T05:52:18+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.36", + "version": "7.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + "reference": "d7d9cee051d03ed98df6023aad93f7902731a780" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d7d9cee051d03ed98df6023aad93f7902731a780", + "reference": "d7d9cee051d03ed98df6023aad93f7902731a780", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpunit/phpunit-mock-objects": "*" + }, + "require-dev": { + "ext-pdo": "*" }, "suggest": { - "phpunit/php-invoker": "~1.1" + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -2773,7 +3102,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -2799,38 +3128,32 @@ "testing", "xunit" ], - "time": "2017-06-21T08:07:12+00:00" + "time": "2019-05-09T05:06:47+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -2845,149 +3168,39 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" - }, - { - "name": "pimple/pimple", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94", - "reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Pimple": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", - "homepage": "http://pimple.sensiolabs.org", - "keywords": [ - "container", - "dependency injection" - ], - "time": "2013-03-08T08:21:40+00:00" - }, - { - "name": "sami/sami", - "version": "v1.4.1", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/Sami.git", - "reference": "160018bfefffa730dc35a2c606691a45acbf41a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Sami/zipball/160018bfefffa730dc35a2c606691a45acbf41a1", - "reference": "160018bfefffa730dc35a2c606691a45acbf41a1", - "shasum": "" - }, - "require": { - "michelf/php-markdown": "~1.3", - "nikic/php-parser": "0.9.*", - "php": ">=5.3.0", - "pimple/pimple": "1.0.*", - "symfony/console": "~2.1", - "symfony/filesystem": "~2.1", - "symfony/finder": "~2.1", - "symfony/process": "~2.1", - "symfony/yaml": "~2.1", - "twig/twig": "1.*" - }, - "bin": [ - "sami.php" - ], - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-0": { - "Sami": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "sebastian@phpunit.de" } ], - "description": "Sami, an API documentation generator", - "homepage": "http://sami.sensiolabs.org", - "keywords": [ - "phpdoc" - ], - "abandoned": true, - "time": "2015-06-05T03:36:34+00:00" + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3018,38 +3231,39 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3074,34 +3288,40 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2019-02-04T06:01:07+00:00" }, { "name": "sebastian/environment", - "version": "1.3.8", + "version": "4.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -3126,34 +3346,34 @@ "environment", "hhvm" ], - "time": "2016-08-18T05:49:44+00:00" + "time": "2019-05-05T09:05:15+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -3193,27 +3413,27 @@ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -3221,7 +3441,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -3244,32 +3464,124 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.5", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -3297,23 +3609,73 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2018-10-04T04:07:39+00:00" }, { "name": "sebastian/version", - "version": "1.0.6", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, + "require": { + "php": ">=5.6" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -3332,68 +3694,41 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "2.9.2", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", - "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", "shasum": "" }, "require": { "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": ">=5.1.2" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ - "scripts/phpcs", - "scripts/phpcbf" + "bin/phpcs", + "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -3405,34 +3740,34 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], - "time": "2018-11-07T22:31:41+00:00" + "time": "2019-04-10T23:49:02+00:00" }, { "name": "symfony/browser-kit", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "b507697225f32a76a9d333d0766fb46353e9d00d" + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/b507697225f32a76a9d333d0766fb46353e9d00d", - "reference": "b507697225f32a76a9d333d0766fb46353e9d00d", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/7f2b0843d5045468225f9a9b27a0cb171ae81828", + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/dom-crawler": "~2.1|~3.0.0" + "php": "^5.5.9|>=7.0.8", + "symfony/dom-crawler": "~2.8|~3.0|~4.0" }, "require-dev": { - "symfony/css-selector": "^2.0.5|~3.0.0", - "symfony/process": "~2.3.34|^2.7.6|~3.0.0" + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/process": "" @@ -3440,7 +3775,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3467,29 +3802,29 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2018-11-26T06:55:10+00:00" + "time": "2019-04-06T19:33:58+00:00" }, { "name": "symfony/css-selector", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "7b1692e418d7ccac24c373528453bc90e42797de" + "reference": "8ca29297c29b64fb3a1a135e71cb25f67f9fdccf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/7b1692e418d7ccac24c373528453bc90e42797de", - "reference": "7b1692e418d7ccac24c373528453bc90e42797de", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/8ca29297c29b64fb3a1a135e71cb25f67f9fdccf", + "reference": "8ca29297c29b64fb3a1a135e71cb25f67f9fdccf", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3520,29 +3855,29 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-01-16T09:39:14+00:00" }, { "name": "symfony/dom-crawler", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "2cdc7d3909eea6f982a6298d2e9ab7db01b6403c" + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2cdc7d3909eea6f982a6298d2e9ab7db01b6403c", - "reference": "2cdc7d3909eea6f982a6298d2e9ab7db01b6403c", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d40023c057393fb25f7ca80af2a56ed948c45a09", + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0.0" + "symfony/css-selector": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -3550,7 +3885,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3577,29 +3912,29 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-11-24T22:30:19+00:00" + "time": "2019-02-23T15:06:07+00:00" }, { "name": "symfony/process", - "version": "v2.8.49", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8" + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c3591a09c78639822b0b290d44edb69bf9f05dc8", - "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8", + "url": "https://api.github.com/repos/symfony/process/zipball/a9c4dfbf653023b668c282e4e02609d131f4057a", + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3626,7 +3961,98 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2019-04-08T16:15:54+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2019-04-04T09:56:43+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" } ], "aliases": [], @@ -3635,10 +4061,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.4" + "php": ">=7.1", + "ext-json": "*" }, "platform-dev": [], "platform-overrides": { - "php": "5.4.7" + "php": "7.1" } } diff --git a/phpBB/config/default/container/parameters.yml b/phpBB/config/default/container/parameters.yml index 8ecc1428f4..dc46a60268 100644 --- a/phpBB/config/default/container/parameters.yml +++ b/phpBB/config/default/container/parameters.yml @@ -14,6 +14,7 @@ parameters: # List of default password driver types passwords.algorithms: + - passwords.driver.argon2i - passwords.driver.bcrypt_2y - passwords.driver.bcrypt - passwords.driver.salted_md5 diff --git a/phpBB/config/default/container/services_cron.yml b/phpBB/config/default/container/services_cron.yml index d7f6388536..70f70e355d 100644 --- a/phpBB/config/default/container/services_cron.yml +++ b/phpBB/config/default/container/services_cron.yml @@ -3,6 +3,7 @@ services: class: phpbb\cron\manager arguments: - '@cron.task_collection' + - '@routing.helper' - '%core.root_path%' - '%core.php_ext%' @@ -13,6 +14,18 @@ services: - '@config' - '@dbal.conn' + cron.controller: + class: phpbb\cron\controller\cron + + cron.event_listener: + class: phpbb\cron\event\cron_runner_listener + arguments: + - '@cron.lock_db' + - '@cron.manager' + - '@request' + tags: + - { name: kernel.event_subscriber } + # ----- Cron tasks ----- cron.task_collection: class: phpbb\di\service_collection diff --git a/phpBB/config/default/container/services_password.yml b/phpBB/config/default/container/services_password.yml index d5f5fe287b..937f656f7c 100644 --- a/phpBB/config/default/container/services_password.yml +++ b/phpBB/config/default/container/services_password.yml @@ -1,4 +1,7 @@ parameters: + passwords.driver.argon2_memory_cost: 1024 + passwords.driver.argon2_threads: 2 + passwords.driver.argon2_time_cost: 2 passwords.driver.bcrypt_cost: 10 services: @@ -27,6 +30,17 @@ services: tags: - { name: service_collection, tag: passwords.driver } + passwords.driver.argon2i: + class: phpbb\passwords\driver\argon2i + arguments: + - '@config' + - '@passwords.driver_helper' + - '%passwords.driver.argon2_memory_cost%' + - '%passwords.driver.argon2_threads%' + - '%passwords.driver.argon2_time_cost%' + tags: + - { name: passwords.driver } + passwords.driver.bcrypt: class: phpbb\passwords\driver\bcrypt arguments: diff --git a/phpBB/config/default/container/services_routing.yml b/phpBB/config/default/container/services_routing.yml index 3048145a2f..0bf0a33ab4 100644 --- a/phpBB/config/default/container/services_routing.yml +++ b/phpBB/config/default/container/services_routing.yml @@ -12,8 +12,6 @@ services: class: Symfony\Component\HttpKernel\EventListener\RouterListener arguments: - '@router' - - null - - null - '@request_stack' tags: - { name: kernel.event_subscriber } diff --git a/phpBB/config/default/container/services_twig.yml b/phpBB/config/default/container/services_twig.yml index a9b5b6d4cd..ce76a6a5ea 100644 --- a/phpBB/config/default/container/services_twig.yml +++ b/phpBB/config/default/container/services_twig.yml @@ -38,6 +38,7 @@ services: class: phpbb\template\twig\extension arguments: - '@template_context' + - '@template.twig.environment' - '@language' tags: - { name: twig.extension } diff --git a/phpBB/config/default/routing/cron.yml b/phpBB/config/default/routing/cron.yml new file mode 100644 index 0000000000..5a634166fa --- /dev/null +++ b/phpBB/config/default/routing/cron.yml @@ -0,0 +1,3 @@ +phpbb_cron_run: + path: /{cron_type} + defaults: { _controller: cron.controller:handle } diff --git a/phpBB/config/default/routing/routing.yml b/phpBB/config/default/routing/routing.yml index f381f024ad..199c5229b0 100644 --- a/phpBB/config/default/routing/routing.yml +++ b/phpBB/config/default/routing/routing.yml @@ -8,6 +8,10 @@ # instantiate the 'foo_service' service and call the 'method' method. # +phpbb_cron_routing: + resource: cron.yml + prefix: /cron + phpbb_feed_routing: resource: feed.yml prefix: /feed diff --git a/phpBB/config/development/config.yml b/phpBB/config/development/config.yml index f39eb52e73..c782e7a45f 100644 --- a/phpBB/config/development/config.yml +++ b/phpBB/config/development/config.yml @@ -3,11 +3,19 @@ imports: core: require_dev_dependencies: true + allow_install_dir: true debug: exceptions: true + load_time: true + sql_explain: true + memory: true + show_errors: true twig: debug: true auto_reload: true enable_debug_extension: true + + session: + log_errors: true diff --git a/phpBB/config/test/config.yml b/phpBB/config/test/config.yml index 1c17b08931..a603f59dec 100644 --- a/phpBB/config/test/config.yml +++ b/phpBB/config/test/config.yml @@ -3,3 +3,4 @@ imports: core: require_dev_dependencies: true + allow_install_dir: true diff --git a/phpBB/cron.php b/phpBB/cron.php index 2f519947aa..c99b772487 100644 --- a/phpBB/cron.php +++ b/phpBB/cron.php @@ -11,10 +11,11 @@ * */ +use Symfony\Component\HttpFoundation\RedirectResponse; + /** */ define('IN_PHPBB', true); -define('IN_CRON', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); @@ -23,62 +24,14 @@ include($phpbb_root_path . 'common.' . $phpEx); $user->session_begin(false); $auth->acl($user->data); -function output_image() -{ - // Output transparent gif - header('Cache-Control: no-cache'); - header('Content-type: image/gif'); - header('Content-length: 43'); - - echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); - - // Flush here to prevent browser from showing the page as loading while - // running cron. - flush(); -} - -// Thanks to various fatal errors and lack of try/finally, it is quite easy to leave -// the cron lock locked, especially when working on cron-related code. -// -// Attempt to alleviate the problem by doing setup outside of the lock as much as possible. - $cron_type = $request->variable('cron_type', ''); -// Comment this line out for debugging so the page does not return an image. -output_image(); - -/* @var $cron_lock \phpbb\lock\db */ -$cron_lock = $phpbb_container->get('cron.lock_db'); -if ($cron_lock->acquire()) -{ - /* @var $cron \phpbb\cron\manager */ - $cron = $phpbb_container->get('cron.manager'); - - $task = $cron->find_task($cron_type); - if ($task) - { - /** - * This event enables you to catch the task before it runs - * - * @event core.cron_run_before - * @var \phpbb\cron\task\wrapper task Current Cron task - * @since 3.1.8-RC1 - */ - $vars = array( - 'task', - ); - extract($phpbb_dispatcher->trigger_event('core.cron_run_before', compact($vars))); - - if ($task->is_parametrized()) - { - $task->parse_parameters($request); - } - if ($task->is_ready()) - { - $task->run(); - } - } - $cron_lock->release(); -} +$get_params_array = $request->get_super_global(\phpbb\request\request_interface::GET); -garbage_collection(); +/** @var \phpbb\controller\helper $controller_helper */ +$controller_helper = $phpbb_container->get('controller.helper'); +$response = new RedirectResponse( + $controller_helper->route('phpbb_cron_run', $get_params_array, false), + 301 +); +$response->send(); diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index b21c0ca38f..b1d45e7995 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="keywords" content="" /> -<meta name="description" content="phpBB 3.2.x Changelog" /> +<meta name="description" content="phpBB 3.3.x Changelog" /> <title>phpBB • Changelog</title> <link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" /> @@ -21,7 +21,7 @@ <div id="doc-description"> <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> - <h1>phpBB 3.2.x Changelog</h1> + <h1>phpBB 3.3.x Changelog</h1> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> @@ -36,7 +36,7 @@ <!-- BEGIN DOCUMENT --> <p class="paragraph main-description"> - This is a non-exhaustive (but still near complete) changelog for phpBB 3.2.x including release candidate versions. + This is a non-exhaustive (but still near complete) changelog for phpBB 3.3.x including release candidate versions. Our thanks to all those people who've contributed bug reports and code fixes. </p> diff --git a/phpBB/docs/CREDITS.txt b/phpBB/docs/CREDITS.txt index 90e9a31127..337c9cf536 100644 --- a/phpBB/docs/CREDITS.txt +++ b/phpBB/docs/CREDITS.txt @@ -84,10 +84,10 @@ prosilver by subBlue Design, Tom Beddard, (c) 2004 phpBB Limited phpBB contains code from the following applications: -LGPL licenced: +LGPL licensed: Smarty (c) 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/ -GPL licenced: +GPL licensed: phpMyAdmin (c) 2001, 2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/ Jabber Class (c) 2006 Flyspray.org, http://www.flyspray.org/ Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/ @@ -101,7 +101,7 @@ Pear (c) 2001-2004 PHP Group, http://pear.php.net Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff -MIT licenced: +MIT licensed: Symfony2 (c) 2004-2011 Fabien Potencier, https://symfony.com/ Cookie Consent (c) 2015 Silktide Ltd, https://cookieconsent.insites.com diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html index 09ee6c1ddd..fb097911d8 100644 --- a/phpBB/docs/FAQ.html +++ b/phpBB/docs/FAQ.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="keywords" content="" /> -<meta name="description" content="phpBB 3.2.x frequently asked questions" /> +<meta name="description" content="phpBB 3.3.x frequently asked questions" /> <title>phpBB • FAQ</title> <link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" /> @@ -21,8 +21,8 @@ <div id="doc-description"> <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> - <h1>phpBB 3.2.x FAQ</h1> - <p>phpBB 3.2.x frequently asked questions</p> + <h1>phpBB 3.3.x FAQ</h1> + <p>phpBB 3.3.x frequently asked questions</p> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> @@ -249,7 +249,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="content"> -<p>Please read the paragraph about permissions in our extensive <a href="https://www.phpbb.com/support/docs/en/3.2/ug/">online documentation</a>.</p> +<p>Please read the paragraph about permissions in our extensive <a href="https://www.phpbb.com/support/docs/en/3.3/ug/">online documentation</a>.</p> </div> @@ -305,7 +305,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="content"> -<p>Please read our <a href="https://www.phpbb.com/support/docs/en/3.2/ug/">extensive user documentation</a> first, it may just explain what you want to know.</p> +<p>Please read our <a href="https://www.phpbb.com/support/docs/en/3.3/ug/">extensive user documentation</a> first, it may just explain what you want to know.</p> <p>Feel free to search our community forum for the information you require. <strong>PLEASE DO NOT</strong> post your question without having first used search, chances are someone has already asked and answered your question. You can find our board here:</p> diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index 4f7f07d3dc..33609837eb 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="keywords" content="" /> -<meta name="description" content="phpBB 3.2.x Installation, updating and conversion informations" /> +<meta name="description" content="phpBB 3.3.x Installation, updating and conversion informations" /> <title>phpBB • Install</title> <link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" /> @@ -21,8 +21,8 @@ <div id="doc-description"> <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> - <h1>phpBB 3.2.x Install</h1> - <p>phpBB 3.2.x Installation, updating and conversion informations</p> + <h1>phpBB 3.3.x Install</h1> + <p>phpBB 3.3.x Installation, updating and conversion informations</p> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> @@ -44,7 +44,7 @@ <p> A basic overview of running phpBB can be found in the accompanying <a href="README.html">README</a> file. Please ensure you read that document in addition to this! For more detailed information on using, installing, - updating and converting phpBB you should read <a href="https://www.phpbb.com/support/docs/en/3.2/ug/">the documentation</a> + updating and converting phpBB you should read <a href="https://www.phpbb.com/support/docs/en/3.3/ug/">the documentation</a> available online. </p> </div> @@ -59,7 +59,7 @@ <li><a href="#quickinstall">Quick install</a></li> <li><a href="#require">Requirements</a></li> <li><a href="#install">New installation</a></li> - <li><a href="#update">Updating from stable releases of phpBB 3.2.x</a> + <li><a href="#update">Updating from stable releases of phpBB 3.3.x</a> <ol style="list-style-type: lower-roman;"> <li><a href="#update_full">Full package</a></li> <li><a href="#update_files">Changed files</a></li> @@ -68,8 +68,8 @@ <li><a href="#update_all">All package types</a></li> </ol> </li> - <li><a href="#update30_31">Updating from phpBB 3.0.x/3.1.x to phpBB 3.2.x</a></li> - <li><a href="#convert">Conversion from phpBB 2.0.x to phpBB 3.2.x</a> + <li><a href="#update30_31">Updating from phpBB 3.0.x/3.1.x to phpBB 3.2.x or phpBB 3.3.x</a></li> + <li><a href="#convert">Conversion from phpBB 2.0.x to phpBB 3.3.x</a> <ol style="list-style-type: lower-roman;"> <li><a href="#prereq">Requirements before converting</a></li> <li><a href="#conversion">Converting</a></li> @@ -139,7 +139,7 @@ <li>A webserver or web hosting account running on any major Operating System with support for PHP</li> <li>A SQL database system, <strong>one of</strong>: <ul> - <li>MySQL 3.23 or above (MySQLi supported)</li> + <li>MySQL 4.1.3 or above (MySQLi required)</li> <li>MariaDB 5.1 or above</li> <li>PostgreSQL 8.3+</li> <li>SQLite 3.6.15+</li> @@ -147,10 +147,11 @@ <li>Oracle</li> </ul> </li> - <li><strong>PHP 5.4.7+</strong> but less than <strong>PHP 7.3</strong> with support for the database you intend to use.</li> + <li><strong>PHP 7.1.0+</strong> but less than <strong>PHP 7.4</strong> with support for the database you intend to use.</li> <li>The following PHP modules are required: <ul> <li>json</li> + <li>XML support</li> </ul> </li> <li>getimagesize() function must be enabled.</li> @@ -158,13 +159,12 @@ <ul> <li>zlib Compression support</li> <li>Remote FTP support</li> - <li>XML support</li> <li>GD Support</li> </ul> </li> </ul> - <p>If your server or hosting account does not meet the requirements above then you will be unable to install phpBB 3.2.x.</p> + <p>If your server or hosting account does not meet the requirements above then you will be unable to install phpBB 3.3.x.</p> </div> @@ -255,7 +255,7 @@ <hr /> - <a name="update"></a><h2>4. Updating from stable releases of phpBB 3.2.x</h2> + <a name="update"></a><h2>4. Updating from stable releases of phpBB 3.3.x</h2> <div class="paragraph"> <div class="inner"> @@ -280,7 +280,7 @@ <p>This package is meant for those wanting to only replace the files that were changed between a previous version and the latest version.</p> - <p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <strong>3.2.0</strong> you should select the appropriate <code>phpBB-3.2.1-files.zip/tar.bz2</code> file.</p> + <p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <strong>3.3.0</strong> you should select the appropriate <code>phpBB-3.3.1-files.zip/tar.bz2</code> file.</p> <p>The directory structure has been preserved, enabling you (if you wish) to simply upload the uncompressed contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any modifications (MODs) these files will overwrite the originals, possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p> @@ -292,7 +292,7 @@ <p>The patch file is one solution for those with changes in to the phpBB core files and do not want to re-add them back to all the changed files. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application, but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the recommended update method.</p> - <p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <strong>3.2.0</strong>, you need the <code>phpBB-3.2.1-patch.zip/tar.bz2</code> file. Place the correct patch in the parent directory containing the phpBB core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <code>patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]</code> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p> + <p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <strong>3.3.0</strong>, you need the <code>phpBB-3.3.1-patch.zip/tar.bz2</code> file. Place the correct patch in the parent directory containing the phpBB core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <code>patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]</code> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p> <p>If you do get failures, you should look at using the <a href="#update_files">Changed Files</a> package to replace the files which failed to patch. Please note that you will need to manually re-add any MODs to these particular files. Alternatively, if you know how, you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p> @@ -302,7 +302,7 @@ <p>This update method is only recommended for installations with modifications to core phpBB files. This package detects changed files automatically and merges in changes if needed.</p> - <p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.2.0</strong>, you need the <code>phpBB-3.2.0_to_3.2.1.zip/tar.bz2</code> file.</p> + <p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.3.0</strong>, you need the <code>phpBB-3.3.0_to_3.3.1.zip/tar.bz2</code> file.</p> <p>To perform the update, either follow the instructions from the <strong>Administration Control Panel->System</strong> Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.</p> @@ -331,16 +331,16 @@ <hr /> - <a name="update30_31"></a><h2>5. Updating from phpBB 3.0.x/3.1x to phpBB 3.2.x</h2> + <a name="update30_31"></a><h2>5. Updating from phpBB 3.0.x/3.1x to phpBB 3.2.x or phpBB 3.3.x</h2> <div class="paragraph"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> - <p>Updating from phpBB 3.0.x or 3.1.x to 3.2.x is just the same as <a href="#update">updating from stable releases of phpBB 3.2.x</a></p> + <p>Updating from phpBB 3.0.x or 3.1.x to 3.2.x or 3.3.x is just the same as <a href="#update">updating from stable releases of phpBB 3.3.x</a></p> - <p>However you can also start with a new set of phpBB 3.2.x files.</p> + <p>However you can also start with a new set of phpBB 3.3.x files.</p> <ol> <li>Delete all files <strong>EXCEPT</strong> for the following: @@ -353,7 +353,7 @@ <li>(The <code>ext/</code> directory</li> </ul></li> - <li>Upload the contents of the 3.2.x Full Package into your forum's directory. Make sure the root level .htaccess file is included in the upload.</li> + <li>Upload the contents of the 3.3.x Full Package into your forum's directory. Make sure the root level .htaccess file is included in the upload.</li> <li>Browse to <code>/install/app.php/update</code></li> <li>Read the notice <em>Update database only</em> and press <strong>Submit</strong></li> <li>Delete the <code>install/</code> directory</li> @@ -367,7 +367,7 @@ <hr /> - <a name="convert"></a><h2>6. Conversion from phpBB 2.0.x to phpBB 3.2.x</h2> + <a name="convert"></a><h2>6. Conversion from phpBB 2.0.x to phpBB 3.3.x</h2> <div class="paragraph"> <div class="inner"> diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index 8fb9036ad8..ca50fe95be 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="keywords" content="" /> -<meta name="description" content="phpBB 3.2.x Readme" /> +<meta name="description" content="phpBB 3.3.x Readme" /> <title>phpBB • Readme</title> <link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" /> @@ -21,7 +21,7 @@ <div id="doc-description"> <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> - <h1>phpBB 3.2.x Readme</h1> + <h1>phpBB 3.3.x Readme</h1> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> @@ -91,13 +91,13 @@ <div class="content"> <p>Installation, update and conversion instructions can be found in the <a href="INSTALL.html">INSTALL</a> document in this directory. If you are intending on converting from a phpBB 2.0.x or 3.0.x installation we highly recommend that you backup any existing data before proceeding!</p> - <p>Users of phpBB 3.0, 3.1 and 3.2 Beta versions cannot directly update.</p> + <p>Users of phpBB 3.0, 3.1, 3.2, and 3.3 Beta versions cannot directly update.</p> <p>Please note that we don't support the following installation types:</p> <ul> <li>Updates from phpBB Beta versions and lower to phpBB Release Candidates and higher</li> - <li>Conversions from phpBB 2.0.x to phpBB 3.0 Beta, 3.1 Beta and 3.2 Beta versions</li> - <li>phpBB 3.0 Beta, 3.1 Beta or 3.2 beta installations</li> + <li>Conversions from phpBB 2.0.x to phpBB 3.0 Beta, 3.1 Beta, 3.2 Beta, and 3.3 Beta versions</li> + <li>phpBB 3.0 Beta, 3.1 Beta, 3.2 beta, or 3.3 beta installations</li> </ul> <p>We give support for the following installation types:</p> @@ -106,8 +106,8 @@ <li>Updates from phpBB 3.0 RC1, 3.1 RC1 and 3.2 RC1 to the latest version</li> <li>Note: if using the <em>Automatic Update Package</em>, updates are supported from phpBB 3.0.2 onward. To update a pre-3.0.2 installation, first update to 3.0.2 and then update to the current version.</li> <li>Conversions from phpBB 2.0.x to the latest version</li> - <li>New installations of phpBB 3.1.x - only the latest released version</li> <li>New installations of phpBB 3.2.x - only the latest released version</li> + <li>New installations of phpBB 3.3.x - only the latest released version</li> </ul> </div> @@ -184,7 +184,7 @@ <p>Comprehensive documentation is now available on the phpBB website:</p> - <p><a href="https://www.phpbb.com/support/docs/en/3.2/ug/">https://www.phpbb.com/support/docs/en/3.2/ug/</a></p> + <p><a href="https://www.phpbb.com/support/docs/en/3.3/ug/">https://www.phpbb.com/support/docs/en/3.3/ug/</a></p> <p>This covers everything from installation to setting permissions and managing users.</p> @@ -224,7 +224,7 @@ <div class="content"> - <p>This is a stable release of phpBB. The 3.2.x line is feature frozen, with point releases principally including fixes for bugs and security issues. Feature alterations and minor feature additions may be done if deemed absolutely required. The next major release will be phpBB 3.3 which is currently under development. Please do not post questions asking when 3.3 will be available, no release date has been set.</p> + <p>This is a stable release of phpBB. The 3.3.x line is feature frozen, with point releases principally including fixes for bugs and security issues. Feature alterations and minor feature additions may be done if deemed absolutely required. The next major release will be phpBB 3.3 which is currently under development. Please do not post questions asking when 3.3 will be available, no release date has been set.</p> <p>Those interested in the development of phpBB should keep an eye on the development forums to see how things are progressing:</p> @@ -265,7 +265,7 @@ <ul> <li>Your server type/version, e.g. Apache 2.2.3, IIS 7, Sambar, etc.</li> - <li>PHP version and mode of operation, e.g. PHP 5.4.0 as a module, PHP 5.4.0 running as CGI, etc.</li> + <li>PHP version and mode of operation, e.g. PHP 7.1.0 as a module, PHP 7.1.0 running as CGI, etc.</li> <li>DB type/version, e.g. MySQL 5.0.77, PostgreSQL 9.0.6, MSSQL Server 2000 (via ODBC), etc.</li> </ul> @@ -273,7 +273,7 @@ <p>Please be as detailed as you can in your report, and if possible, list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request to our repository <a href="https://github.com/phpbb/phpbb">on GitHub</a>.</p> - <p>If you create a patch, it is very much appreciated (but not required) if you follow the phpBB coding guidelines. Please note that the coding guidelines are somewhat different between different versions of phpBB. For phpBB 3.2.x the coding guidelines may be found here: <a href="http://area51.phpbb.com/docs/32x/coding-guidelines.html">http://area51.phpbb.com/docs/32x/coding-guidelines.html</a></p> + <p>If you create a patch, it is very much appreciated (but not required) if you follow the phpBB coding guidelines. Please note that the coding guidelines are somewhat different between different versions of phpBB. For phpBB 3.3.x the coding guidelines may be found here: <a href="http://area51.phpbb.com/docs/33x/coding-guidelines.html">http://area51.phpbb.com/docs/33x/coding-guidelines.html</a></p> <p>Once a bug has been submitted you will be emailed any follow up comments added to it. <strong>Please</strong> if you are requested to supply additional information, do so! It is frustrating for us to receive bug reports, ask for additional information but get nothing. In these cases we have a policy of closing the bug, which may leave a very real problem in place. Obviously we would rather not have this situation arise.</p> @@ -323,11 +323,11 @@ <div class="content"> - <p>phpBB 3.2.x takes advantage of new features added in PHP 5.4. We recommend that you upgrade to the latest stable release of PHP to run phpBB. The minimum version required is PHP 5.4.7 and the maximum supported version is the latest stable version of PHP.</p> + <p>phpBB 3.3.x takes advantage of new features added in PHP 7.1.0. We recommend that you upgrade to the latest stable release of PHP to run phpBB. The minimum version required is PHP 7.1.0 and the maximum supported version is the latest stable version of PHP.</p> <p>Please remember that running any application on a development (unstable, e.g. a beta release) version of PHP can lead to strange/unexpected results which may appear to be bugs in the application. Therefore, we recommend you upgrade to the newest stable version of PHP before running phpBB. If you are running a development version of PHP please check any bugs you find on a system running a stable release before submitting.</p> - <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MariaDB 5.x, PostgreSQL 8.x, Oracle 8 and SQLite 3. Versions of PHP used range from 5.4.7 above 5.6.x to 7.1.x and 7.2.x without problem.</p> + <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQLi 4.1.3, 4.x, 5.x, MariaDB 5.x, PostgreSQL 8.x, Oracle 8 and SQLite 3. Versions of PHP used range from 7.1.0 to 7.2.x and 7.3.x without issues.</p> <a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3> diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 569ffe680c..72ad115e71 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1184,8 +1184,8 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp; # General Information about this style name = prosilver_duplicate copyright = © phpBB Limited, 2007 -style_version = 3.2.0 -phpbb_version = 3.2.0 +style_version = 3.3.0 +phpbb_version = 3.3.0 # Defining a different template bitfield # template_bitfield = lNg= @@ -1211,7 +1211,7 @@ parent = prosilver</pre> <td class="gensmall">TEST</td> </pre></div> -<p>Try to match text class types with existing useage, e.g. don't use the nav class where viewtopic uses gensmall for example.</p> +<p>Try to match text class types with existing usage, e.g. don't use the nav class where viewtopic uses gensmall for example.</p> <p>Row colours/classes are now defined by the template, use an <code>IF S_ROW_COUNT</code> switch, see viewtopic or viewforum for an example.</p> @@ -1223,7 +1223,7 @@ parent = prosilver</pre> <p>The separate catXXXX and thXXX classes are gone. When defining a header cell just use <code><th></code> rather than <code><th class="thHead"></code> etc. Similarly for cat, don't use <code><td class="catLeft"></code> use <code><td class="cat"></code> etc.</p> -<p>Try to retain consistency of basic layout and class useage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}<br /><span class="gensmall">{L_POST_USERNAME_EXPLAIN}</span></code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule.</p> +<p>Try to retain consistency of basic layout and class usage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}<br /><span class="gensmall">{L_POST_USERNAME_EXPLAIN}</span></code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule.</p> <p>Try to keep template conditional and other statements tabbed in line with the block to which they refer.</p> @@ -1767,7 +1767,7 @@ This may span multiple lines. <p>The <a href="http://en.wikipedia.org/wiki/Universal_Character_Set">Universal Character Set (UCS)</a> described in ISO/IEC 10646 consists of a large amount of characters. Each of them has a unique name and a code point which is an integer number. <a href="http://en.wikipedia.org/wiki/Unicode">Unicode</a> - which is an industry standard - complements the Universal Character Set with further information about the characters' properties and alternative character encodings. More information on Unicode can be found on the <a href="http://www.unicode.org/">Unicode Consortium's website</a>. One of the Unicode encodings is the <a href="http://en.wikipedia.org/wiki/UTF-8">8-bit Unicode Transformation Format (UTF-8)</a>. It encodes characters with up to four bytes aiming for maximum compatibility with the <a href="http://en.wikipedia.org/wiki/ASCII">American Standard Code for Information Interchange</a> which is a 7-bit encoding of a relatively small subset of the UCS.</p> <h4>phpBB's use of Unicode</h4> -<p>Unfortunately PHP does not faciliate the use of Unicode prior to version 6. Most functions simply treat strings as sequences of bytes assuming that each character takes up exactly one byte. This behaviour still allows for storing UTF-8 encoded text in PHP strings but many operations on strings have unexpected results. To circumvent this problem we have created some alternative functions to PHP's native string operations which use code points instead of bytes. These functions can be found in <code>/includes/utf/utf_tools.php</code>. They are also covered in the <a href="http://area51.phpbb.com/docs/code/">phpBB3 Sourcecode Documentation</a>. A lot of native PHP functions still work with UTF-8 as long as you stick to certain restrictions. For example <code>explode</code> still works as long as the first and the last character of the delimiter string are ASCII characters.</p> +<p>Unfortunately PHP does not facilitate the use of Unicode prior to version 6. Most functions simply treat strings as sequences of bytes assuming that each character takes up exactly one byte. This behaviour still allows for storing UTF-8 encoded text in PHP strings but many operations on strings have unexpected results. To circumvent this problem we have created some alternative functions to PHP's native string operations which use code points instead of bytes. These functions can be found in <code>/includes/utf/utf_tools.php</code>. They are also covered in the <a href="http://area51.phpbb.com/docs/code/">phpBB3 Sourcecode Documentation</a>. A lot of native PHP functions still work with UTF-8 as long as you stick to certain restrictions. For example <code>explode</code> still works as long as the first and the last character of the delimiter string are ASCII characters.</p> <p>phpBB only uses the ASCII and the UTF-8 character encodings. Still all Strings are UTF-8 encoded because ASCII is a subset of UTF-8. The only exceptions to this rule are code sections which deal with external systems which use other encodings and character sets. Such external data should be converted to UTF-8 using the <code>utf8_recode()</code> function supplied with phpBB. It supports a variety of other character sets and encodings, a full list can be found below.</p> @@ -1848,7 +1848,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <p>The <abbr title="Internet Engineering Task Force">IETF</abbr> recently published <a href="http://tools.ietf.org/html/rfc4646">RFC 4646</a> for tags used to identify languages, which in combination with <a href="http://tools.ietf.org/html/rfc4647">RFC 4647</a> obseletes the older <a href="http://tools.ietf.org/html/rfc3066">RFC 3006</a> and older-still <a href="http://tools.ietf.org/html/rfc1766">RFC 1766</a>. <a href="http://tools.ietf.org/html/rfc4646">RFC 4646</a> uses <a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO 639-1/ISO 639-2</a>, <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a>, <a href="http://www.unicode.org/iso15924/iso15924-codes.html">ISO 15924</a> and <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a> to define a language tag. Each complete tag is composed of subtags which are not case sensitive and can also be empty.</p> - <p>Ordering of the subtags in the case that they are all non-empty is: <code>language</code>-<code>script</code>-<code>region</code>-<code>variant</code>-<code>extension</code>-<code>privateuse</code>. Should any subtag be empty, its corresponding hyphen would also be ommited. Thus, the language tag for English will be <code>en</code> <strong>and not</strong> <code>en-----</code>.</p> + <p>Ordering of the subtags in the case that they are all non-empty is: <code>language</code>-<code>script</code>-<code>region</code>-<code>variant</code>-<code>extension</code>-<code>privateuse</code>. Should any subtag be empty, its corresponding hyphen would also be omitted. Thus, the language tag for English will be <code>en</code> <strong>and not</strong> <code>en-----</code>.</p> <p>Most language tags consist of a two- or three-letter language subtag (from <a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO 639-1/ISO 639-2</a>). Sometimes, this is followed by a two-letter or three-digit region subtag (from <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> or <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a>). Some examples are:</p> @@ -1902,7 +1902,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <p>The ultimate aim of a language tag is to convey the needed <strong>useful distingushing information</strong>, whilst keeping it as <strong>short as possible</strong>. So for example, use <code>en</code>, <code>fr</code> and <code>ja</code> as opposed to <code>en-GB</code>, <code>fr-FR</code> and <code>ja-JP</code>, since we know English, French and Japanese are the native language of Great Britain, France and Japan respectively.</p> - <p>Next is the <a href="http://www.unicode.org/iso15924/iso15924-codes.html">ISO 15924</a> language script code and when one should or shouldn't use it. For example, whilst <code>en-Latn</code> is syntaxically correct for describing English written with Latin script, real world English writing is <strong>more-or-less exclusively in the Latin script</strong>. For such languages like English that are written in a single script, the <a href="http://www.iana.org/assignments/language-subtag-registry"><abbr title="Internet Assigned Numbers Authority">IANA</abbr> Language Subtag Registry</a> has a "Suppress-Script" field meaning the script code <strong>should be ommitted</strong> unless a specific language tag requires a specific script code. Some languages are <strong>written in more than one script</strong> and in such cases, the script code <strong>is encouraged</strong> since an end-user may be able to read their language in one script, but not the other. Some examples are:</p> + <p>Next is the <a href="http://www.unicode.org/iso15924/iso15924-codes.html">ISO 15924</a> language script code and when one should or shouldn't use it. For example, whilst <code>en-Latn</code> is syntaxically correct for describing English written with Latin script, real world English writing is <strong>more-or-less exclusively in the Latin script</strong>. For such languages like English that are written in a single script, the <a href="http://www.iana.org/assignments/language-subtag-registry"><abbr title="Internet Assigned Numbers Authority">IANA</abbr> Language Subtag Registry</a> has a "Suppress-Script" field meaning the script code <strong>should be omitted</strong> unless a specific language tag requires a specific script code. Some languages are <strong>written in more than one script</strong> and in such cases, the script code <strong>is encouraged</strong> since an end-user may be able to read their language in one script, but not the other. Some examples are:</p> <table> <caption>Examples of using a language subtag in combination with a script subtag</caption> @@ -1967,7 +1967,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) </tbody> </table> - <p>Usage of the three-digit <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a> code over the two-letter <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> code should hapen if a macro-geographical entity is required and/or the <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> is ambiguous.</p> + <p>Usage of the three-digit <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a> code over the two-letter <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> code should happen if a macro-geographical entity is required and/or the <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> is ambiguous.</p> <p>Examples of English using marco-geographical regions:</p> diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 9ee489cef4..6d0796d2c4 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -257,11 +257,6 @@ else $display_cat = ATTACHMENT_CATEGORY_NONE; } - if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash')) - { - $display_cat = ATTACHMENT_CATEGORY_NONE; - } - /** * Event to modify data before sending file to browser * diff --git a/phpBB/feed.php b/phpBB/feed.php index 1480867d6c..e384489ee9 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -36,17 +36,17 @@ $mode = $request->variable('mode', ''); if ($forum_id !== 0) { - $url = $controller_helper->route('phpbb_feed_forum', array('forum_id' => $forum_id)); + $url = $controller_helper->route('phpbb_feed_forum', array('forum_id' => $forum_id), false); } else if ($topic_id !== 0) { - $url = $controller_helper->route('phpbb_feed_topic', array('topic_id' => $topic_id)); + $url = $controller_helper->route('phpbb_feed_topic', array('topic_id' => $topic_id), false); } else { try { - $url = $controller_helper->route('phpbb_feed_overall', array('mode' => $mode)); + $url = $controller_helper->route('phpbb_feed_overall', array('mode' => $mode), false); } catch (InvalidParameterException $e) { diff --git a/phpBB/images/upload_icons/flash.gif b/phpBB/images/upload_icons/flash.gif Binary files differdeleted file mode 100644 index 00ee0f4f72..0000000000 --- a/phpBB/images/upload_icons/flash.gif +++ /dev/null diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 5b1db5c31b..5557ecc835 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -606,7 +606,6 @@ class acp_attachments $cat_lang = array( ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], - ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'], ); $group_id = $request->variable('g', 0); @@ -1385,7 +1384,6 @@ class acp_attachments $types = array( ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], - ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'], ); if ($group_id) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 1f7374a07f..b59f9e3a39 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -451,144 +451,7 @@ class acp_bbcodes function build_regexp(&$bbcode_match, &$bbcode_tpl) { $bbcode_match = trim($bbcode_match); - $bbcode_tpl = trim($bbcode_tpl); - - // Allow unicode characters for URL|LOCAL_URL|RELATIVE_URL|INTTEXT tokens - $utf8 = preg_match('/(URL|LOCAL_URL|RELATIVE_URL|INTTEXT)/', $bbcode_match); - - $fp_match = preg_quote($bbcode_match, '!'); - $fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $bbcode_match); - $fp_replace = preg_replace('#\[/(.*?)\]$#', '[/$1:$uid]', $fp_replace); - - $sp_match = preg_quote($bbcode_match, '!'); - $sp_match = preg_replace('#^\\\\\[(.*?)\\\\\]#', '\[$1:$uid\]', $sp_match); - $sp_match = preg_replace('#\\\\\[/(.*?)\\\\\]$#', '\[/$1:$uid\]', $sp_match); - $sp_replace = $bbcode_tpl; - - // @todo Make sure to change this too if something changed in message parsing - $tokens = array( - 'URL' => array( - '!(?:(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('url')) . ')|(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('www_url')) . '))!ie' => "\$this->bbcode_specialchars(('\$1') ? '\$1' : 'http://\$2')" - ), - 'LOCAL_URL' => array( - '!(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')!e' => "\$this->bbcode_specialchars('$1')" - ), - 'RELATIVE_URL' => array( - '!(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')!e' => "\$this->bbcode_specialchars('$1')" - ), - 'EMAIL' => array( - '!(' . get_preg_expression('email') . ')!ie' => "\$this->bbcode_specialchars('$1')" - ), - 'TEXT' => array( - '!(.*?)!es' => "str_replace(array(\"\\r\\n\", '\\\"', '\\'', '(', ')'), array(\"\\n\", '\"', ''', '(', ')'), trim('\$1'))" - ), - 'SIMPLETEXT' => array( - '!([a-zA-Z0-9-+.,_ ]+)!' => "$1" - ), - 'INTTEXT' => array( - '!([\p{L}\p{N}\-+,_. ]+)!u' => "$1" - ), - 'IDENTIFIER' => array( - '!([a-zA-Z0-9-_]+)!' => "$1" - ), - 'COLOR' => array( - '!([a-z]+|#[0-9abcdef]+)!i' => '$1' - ), - 'NUMBER' => array( - '!([0-9]+)!' => '$1' - ) - ); - - $sp_tokens = array( - 'URL' => '(?i)((?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('url')) . ')|(?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('www_url')) . '))(?-i)', - 'LOCAL_URL' => '(?i)(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')(?-i)', - 'RELATIVE_URL' => '(?i)(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')(?-i)', - 'EMAIL' => '(' . get_preg_expression('email') . ')', - 'TEXT' => '(.*?)', - 'SIMPLETEXT' => '([a-zA-Z0-9-+.,_ ]+)', - 'INTTEXT' => '([\p{L}\p{N}\-+,_. ]+)', - 'IDENTIFIER' => '([a-zA-Z0-9-_]+)', - 'COLOR' => '([a-zA-Z]+|#[0-9abcdefABCDEF]+)', - 'NUMBER' => '([0-9]+)', - ); - - $pad = 0; - $modifiers = 'i'; - $modifiers .= ($utf8) ? 'u' : ''; - - if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $bbcode_match, $m)) - { - foreach ($m[0] as $n => $token) - { - $token_type = $m[1][$n]; - - reset($tokens[strtoupper($token_type)]); - list($match, $replace) = each($tokens[strtoupper($token_type)]); - - // Pad backreference numbers from tokens - if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad)) - { - $repad = $pad + count(array_unique($repad[0])); - $replace = preg_replace_callback('/(?<!\\\\)\$([0-9]+)/', function ($match) use ($pad) { - return '${' . ($match[1] + $pad) . '}'; - }, $replace); - $pad = $repad; - } - - // Obtain pattern modifiers to use and alter the regex accordingly - $regex = preg_replace('/!(.*)!([a-z]*)/', '$1', $match); - $regex_modifiers = preg_replace('/!(.*)!([a-z]*)/', '$2', $match); - - for ($i = 0, $size = strlen($regex_modifiers); $i < $size; ++$i) - { - if (strpos($modifiers, $regex_modifiers[$i]) === false) - { - $modifiers .= $regex_modifiers[$i]; - - if ($regex_modifiers[$i] == 'e') - { - $fp_replace = "'" . str_replace("'", "\\'", $fp_replace) . "'"; - } - } - - if ($regex_modifiers[$i] == 'e') - { - $replace = "'.$replace.'"; - } - } - - $fp_match = str_replace(preg_quote($token, '!'), $regex, $fp_match); - $fp_replace = str_replace($token, $replace, $fp_replace); - - $sp_match = str_replace(preg_quote($token, '!'), $sp_tokens[$token_type], $sp_match); - - // Prepend the board url to local relative links - $replace_prepend = ($token_type === 'LOCAL_URL') ? generate_board_url() . '/' : ''; - - $sp_replace = str_replace($token, $replace_prepend . '${' . ($n + 1) . '}', $sp_replace); - } - - $fp_match = '!' . $fp_match . '!' . $modifiers; - $sp_match = '!' . $sp_match . '!s' . (($utf8) ? 'u' : ''); - - if (strpos($fp_match, 'e') !== false) - { - $fp_replace = str_replace("'.'", '', $fp_replace); - $fp_replace = str_replace(".''.", '.', $fp_replace); - } - } - else - { - // No replacement is present, no need for a second-pass pattern replacement - // A simple str_replace will suffice - $fp_match = '!' . $fp_match . '!' . $modifiers; - $sp_match = $fp_replace; - $sp_replace = ''; - } - - // Lowercase tags $bbcode_tag = preg_replace('/.*?\[([a-z0-9_-]+).*/i', '$1', $bbcode_match); - $bbcode_search = preg_replace('/.*?\[([a-z0-9_-]+).*/i', '$1', $bbcode_match); if (!preg_match('/^[a-zA-Z0-9_-]+$/', $bbcode_tag)) { @@ -596,25 +459,13 @@ class acp_bbcodes trigger_error($user->lang['BBCODE_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); } - $fp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) { - return strtolower($match[0]); - }, $fp_match); - $fp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) { - return strtolower($match[0]); - }, $fp_replace); - $sp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) { - return strtolower($match[0]); - }, $sp_match); - $sp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) { - return strtolower($match[0]); - }, $sp_replace); - return array( 'bbcode_tag' => $bbcode_tag, - 'first_pass_match' => $fp_match, - 'first_pass_replace' => $fp_replace, - 'second_pass_match' => $sp_match, - 'second_pass_replace' => $sp_replace + 'first_pass_match' => '/(?!)/', + 'first_pass_replace' => '', + // Use a non-matching, valid regexp to effectively disable this BBCode + 'second_pass_match' => '/(?!)/', + 'second_pass_replace' => '' ); } } diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index e348c769bd..083bd5adac 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -85,34 +85,25 @@ class acp_board $display_vars = array( 'title' => 'ACP_BOARD_FEATURES', 'vars' => array( - 'legend1' => 'ACP_BOARD_FEATURES', - 'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_pm_report' => array('lang' => 'ALLOW_PM_REPORT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'legend1' => 'ACP_BOARD_FEATURES', + 'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_pm_report' => array('lang' => 'ALLOW_PM_REPORT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_board_notifications' => array('lang' => 'ALLOW_BOARD_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'display_last_subject' => array('lang' => 'DISPLAY_LAST_SUBJECT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true), - - 'legend2' => 'ACP_LOAD_SETTINGS', - 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'load_cpf_pm' => array('lang' => 'LOAD_CPF_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'display_last_subject' => array('lang' => 'DISPLAY_LAST_SUBJECT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true), - 'legend3' => 'ACP_SUBMIT_CHANGES', + 'legend2' => 'ACP_SUBMIT_CHANGES', ) ); break; diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index a1cb2108e7..2929de3c4f 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -38,7 +38,7 @@ class acp_extensions private $phpbb_container; private $php_ini; - function main() + function main($id, $mode) { // Start the page global $config, $user, $template, $request, $phpbb_extension_manager, $phpbb_root_path, $phpbb_log, $phpbb_dispatcher, $phpbb_container; @@ -182,13 +182,19 @@ class acp_extensions redirect($this->u_action); } - $this->tpl_name = 'acp_ext_enable'; - - $this->template->assign_vars(array( - 'PRE' => true, - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), - 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name), - )); + if (confirm_box(true)) + { + redirect($this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name)); + } + else + { + confirm_box(false, $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'action' => 'enable_pre', + 'ext_name' => $ext_name, + ))); + } break; case 'enable': @@ -215,9 +221,8 @@ class acp_extensions // Are we approaching the time limit? If so we want to pause the update and continue after refreshing if ((time() - $start_time) >= $safe_time_limit) { - $this->template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name)); + trigger_error('EXTENSION_ENABLE_IN_PROGRESS', E_USER_NOTICE); } } @@ -233,14 +238,22 @@ class acp_extensions } catch (\phpbb\db\migration\exception $e) { - $this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user)); + trigger_error($this->user->lang('MIGRATION_EXCEPTION_ERROR', $e->getLocalisedMessage($this->user)), E_USER_WARNING); } - $this->tpl_name = 'acp_ext_enable'; - - $this->template->assign_vars(array( - 'U_RETURN' => $this->u_action . '&action=list', - )); + if ($this->request->is_ajax()) + { + $actions = $this->output_actions('enabled', [ + 'DISABLE' => $this->u_action . '&action=disable_pre&ext_name=' . urlencode($ext_name), + ]); + + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'EXT_ENABLE_SUCCESS' => true, + 'ACTIONS' => $actions, + )); + } + trigger_error($this->user->lang('EXTENSION_ENABLE_SUCCESS') . adm_back_link($this->u_action), E_USER_NOTICE); break; case 'disable_pre': @@ -249,13 +262,19 @@ class acp_extensions redirect($this->u_action); } - $this->tpl_name = 'acp_ext_disable'; - - $this->template->assign_vars(array( - 'PRE' => true, - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), - 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name), - )); + if (confirm_box(true)) + { + redirect($this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name)); + } + else + { + confirm_box(false, $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'action' => 'disable_pre', + 'ext_name' => $ext_name, + ))); + } break; case 'disable': @@ -272,15 +291,25 @@ class acp_extensions $this->template->assign_var('S_NEXT_STEP', true); meta_refresh(0, $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name)); + trigger_error('EXTENSION_DISABLE_IN_PROGRESS', E_USER_NOTICE); } } $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_DISABLE', time(), array($ext_name)); - $this->tpl_name = 'acp_ext_disable'; - - $this->template->assign_vars(array( - 'U_RETURN' => $this->u_action . '&action=list', - )); + if ($this->request->is_ajax()) + { + $actions = $this->output_actions('disabled', [ + 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($ext_name), + 'DELETE_DATA' => $this->u_action . '&action=delete_data_pre&ext_name=' . urlencode($ext_name), + ]); + + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'EXT_DISABLE_SUCCESS' => true, + 'ACTIONS' => $actions, + )); + } + trigger_error($this->user->lang('EXTENSION_DISABLE_SUCCESS') . adm_back_link($this->u_action), E_USER_NOTICE); break; case 'delete_data_pre': @@ -288,13 +317,20 @@ class acp_extensions { redirect($this->u_action); } - $this->tpl_name = 'acp_ext_delete_data'; - $this->template->assign_vars(array( - 'PRE' => true, - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), - 'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name), - )); + if (confirm_box(true)) + { + redirect($this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name)); + } + else + { + confirm_box(false, $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'action' => 'delete_data_pre', + 'ext_name' => $ext_name, + ))); + } break; case 'delete_data': @@ -313,20 +349,29 @@ class acp_extensions $this->template->assign_var('S_NEXT_STEP', true); meta_refresh(0, $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name)); + trigger_error('EXTENSION_DELETE_DATA_IN_PROGRESS', E_USER_NOTICE); } } $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_PURGE', time(), array($ext_name)); } catch (\phpbb\db\migration\exception $e) { - $this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user)); + trigger_error($this->user->lang('MIGRATION_EXCEPTION_ERROR', $e->getLocalisedMessage($this->user)), E_USER_WARNING); } - $this->tpl_name = 'acp_ext_delete_data'; - - $this->template->assign_vars(array( - 'U_RETURN' => $this->u_action . '&action=list', - )); + if ($this->request->is_ajax()) + { + $actions = $this->output_actions('disabled', [ + 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($ext_name), + ]); + + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'EXT_DELETE_DATA_SUCCESS' => true, + 'ACTIONS' => $actions, + )); + } + trigger_error($this->user->lang('EXTENSION_DELETE_DATA_SUCCESS') . adm_back_link($this->u_action), E_USER_NOTICE); break; case 'details': @@ -605,17 +650,37 @@ class acp_extensions * * @param string $block * @param array $actions + * @return array List of actions to be performed on the extension */ private function output_actions($block, $actions) { - foreach ($actions as $lang => $url) + $vars_ary = array(); + foreach ($actions as $lang => $options) { - $this->template->assign_block_vars($block . '.actions', array( + $url = $options; + if (is_array($options)) + { + $url = $options['url']; + } + + $vars = array( 'L_ACTION' => $this->user->lang('EXTENSION_' . $lang), 'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $lang . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $lang . '_EXPLAIN') : '', 'U_ACTION' => $url, - )); + 'ACTION_AJAX' => 'ext_' . strtolower($lang), + ); + + if (isset($options['color'])) + { + $vars['COLOR'] = $options['color']; + } + + $this->template->assign_block_vars($block . '.actions', $vars); + + $vars_ary[] = $vars; } + + return $vars_ary; } /** diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 8f169d15a7..27fac54777 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -657,7 +657,7 @@ class acp_main } // Warn if install is still present - if (file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) + if (!defined('IN_INSTALL') && !$phpbb_container->getParameter('allow_install_dir') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) { $template->assign_var('S_REMOVE_INSTALL', true); } diff --git a/phpBB/includes/compatibility_globals.php b/phpBB/includes/compatibility_globals.php index ad394e3782..15880d4bc8 100644 --- a/phpBB/includes/compatibility_globals.php +++ b/phpBB/includes/compatibility_globals.php @@ -18,6 +18,14 @@ if (!defined('IN_PHPBB')) exit; } +// +// Deprecated globals +// +define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming - @deprecated 3.2 +define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming - @deprecated 3.2 +define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files - @deprecated 3.2 +define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files - @deprecated 3.3 + /** * Sets compatibility globals in the global scope * diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 89d056f2e1..9f7a325a2b 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -28,7 +28,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -@define('PHPBB_VERSION', '3.2.8-dev'); +@define('PHPBB_VERSION', '3.3.0-b1-dev'); // QA-related // define('PHPBB_QA', 1); @@ -171,11 +171,7 @@ define('CONFIRM_REPORT', 4); // Categories - Attachments define('ATTACHMENT_CATEGORY_NONE', 0); define('ATTACHMENT_CATEGORY_IMAGE', 1); // Inline Images -define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming - @deprecated 3.2 -define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming - @deprecated 3.2 define('ATTACHMENT_CATEGORY_THUMB', 4); // Not used within the database, only while displaying posts -define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files -define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files - @deprecated 3.2 // BBCode UID length define('BBCODE_UID_LEN', 8); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 5234c3472d..c3108f6f8e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -52,18 +52,6 @@ function phpbb_load_extensions_autoloaders($phpbb_root_path) } /** -* Casts a variable to the given type. -* -* @deprecated -*/ -function set_var(&$result, $var, $type, $multibyte = false) -{ - // no need for dependency injection here, if you have the object, call the method yourself! - $type_cast_helper = new \phpbb\request\type_cast_helper(); - $type_cast_helper->set_var($result, $var, $type, $multibyte); -} - -/** * Generates an alphanumeric random string of given length * * @param int $num_chars Length of random string, defaults to 8. @@ -3332,6 +3320,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) { global $cache, $db, $auth, $template, $config, $user, $request; global $phpbb_root_path, $msg_title, $msg_long_text, $phpbb_log; + global $phpbb_container; // Do not display notices if we suppress them via @ if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE) @@ -3352,7 +3341,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) // Check the error reporting level and return if the error level does not match // If DEBUG is defined the default level is E_ALL - if (($errno & ((defined('DEBUG')) ? E_ALL : error_reporting())) == 0) + if (($errno & ($phpbb_container->getParameter('debug.show_errors') ? E_ALL : error_reporting())) == 0) { return; } @@ -3410,7 +3399,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) $log_text .= '<br /><br />BACKTRACE<br />' . $backtrace; } - if (defined('IN_INSTALL') || defined('DEBUG') || isset($auth) && $auth->acl_get('a_')) + if (defined('IN_INSTALL') || $phpbb_container->getParameter('debug.show_errors') || isset($auth) && $auth->acl_get('a_')) { $msg_text = $log_text; @@ -4298,7 +4287,8 @@ function page_header($page_title = '', $display_online_list = false, $item_id = } else { - $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'); + $redirect = $request->variable('redirect', rawurlencode($user->page['page'])); + $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login&redirect=' . $redirect); $l_login_logout = $user->lang['LOGIN']; } @@ -4640,7 +4630,9 @@ function page_header($page_title = '', $display_online_list = false, $item_id = */ function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $request, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db) { - if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG')) + global $phpbb_container; + + if ($phpbb_container->getParameter('debug.sql_explain') && $request->variable('explain', false) && $auth->acl_get('a_')) { $db->sql_report('display'); } @@ -4658,19 +4650,22 @@ function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $re */ function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\user $user, \phpbb\event\dispatcher_interface $phpbb_dispatcher) { + global $phpbb_container; + $debug_info = array(); // Output page creation time - if (defined('PHPBB_DISPLAY_LOAD_TIME')) + if ($phpbb_container->getParameter('debug.load_time')) { if (isset($GLOBALS['starttime'])) { $totaltime = microtime(true) - $GLOBALS['starttime']; $debug_info[] = sprintf('<span title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</span>', $db->get_sql_time(), ($totaltime - $db->get_sql_time()), $totaltime); } + } - $debug_info[] = sprintf('<span title="Cached: %d">Queries: %d</span>', $db->sql_num_queries(true), $db->sql_num_queries()); - + if ($phpbb_container->getParameter('debug.memory')) + { $memory_usage = memory_get_peak_usage(); if ($memory_usage) { @@ -4678,16 +4673,18 @@ function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \php $debug_info[] = 'Peak Memory Usage: ' . $memory_usage; } - } - if (defined('DEBUG')) - { $debug_info[] = 'GZIP: ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off'); if ($user->load) { $debug_info[] = 'Load: ' . $user->load; } + } + + if ($phpbb_container->getParameter('debug.sql_explain')) + { + $debug_info[] = sprintf('<span title="Cached: %d">Queries: %d</span>', $db->sql_num_queries(true), $db->sql_num_queries()); if ($auth->acl_get('a_')) { diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index c19d48b0be..1f3fe1c8e8 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1161,28 +1161,6 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = } /** -* Delete Attachments -* -* @deprecated 3.2.0-a1 (To be removed: 3.4.0) -* -* @param string $mode can be: post|message|topic|attach|user -* @param mixed $ids can be: post_ids, message_ids, topic_ids, attach_ids, user_ids -* @param bool $resync set this to false if you are deleting posts or topics -*/ -function delete_attachments($mode, $ids, $resync = true) -{ - global $phpbb_container; - - /** @var \phpbb\attachment\manager $attachment_manager */ - $attachment_manager = $phpbb_container->get('attachment.manager'); - $num_deleted = $attachment_manager->delete($mode, $ids, $resync); - - unset($attachment_manager); - - return $num_deleted; -} - -/** * Deletes shadow topics pointing to a specified forum. * * @param int $forum_id The forum id @@ -1294,23 +1272,6 @@ function update_posted_info(&$topic_ids) } /** -* Delete attached file -* -* @deprecated 3.2.0-a1 (To be removed: 3.4.0) -*/ -function phpbb_unlink($filename, $mode = 'file', $entry_removed = false) -{ - global $phpbb_container; - - /** @var \phpbb\attachment\manager $attachment_manager */ - $attachment_manager = $phpbb_container->get('attachment.manager'); - $unlink = $attachment_manager->unlink($filename, $mode, $entry_removed); - unset($attachment_manager); - - return $unlink; -} - -/** * All-encompasing sync function * * Exaples: diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index e95fa40a58..b5b60e118e 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -22,7 +22,7 @@ if (!defined('IN_PHPBB')) /** * Get user avatar * -* @deprecated 3.1.0-a1 (To be removed: 3.3.0) +* @deprecated 3.1.0-a1 (To be removed: 4.0.0) * * @param string $avatar Users assigned avatar name * @param int $avatar_type Type of avatar @@ -50,7 +50,7 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $ /** * Hash the password * -* @deprecated 3.1.0-a2 (To be removed: 3.3.0) +* @deprecated 3.1.0-a2 (To be removed: 4.0.0) * * @param string $password Password to be hashed * @@ -68,7 +68,7 @@ function phpbb_hash($password) /** * Check for correct password * -* @deprecated 3.1.0-a2 (To be removed: 3.3.0) +* @deprecated 3.1.0-a2 (To be removed: 4.0.0) * * @param string $password The password in plain text * @param string $hash The stored password hash @@ -92,7 +92,7 @@ function phpbb_check_hash($password, $hash) * @param string $path Path to clean * @return string Cleaned path * -* @deprecated 3.1.0 (To be removed: 3.3.0) +* @deprecated 3.1.0 (To be removed: 4.0.0) */ function phpbb_clean_path($path) { @@ -136,7 +136,7 @@ function phpbb_clean_path($path) * * @return string Returns the options for timezone selector only * -* @deprecated 3.1.0 (To be removed: 3.3.0) +* @deprecated 3.1.0 (To be removed: 4.0.0) */ function tz_select($default = '', $truncate = false) { @@ -150,7 +150,7 @@ function tz_select($default = '', $truncate = false) * via admin_permissions. Changes of usernames and group names * must be carried through for the moderators table. * -* @deprecated 3.1.0 (To be removed: 3.3.0) +* @deprecated 3.1.0 (To be removed: 4.0.0) * @return null */ function cache_moderators() @@ -162,7 +162,7 @@ function cache_moderators() /** * Removes moderators and administrators from foe lists. * -* @deprecated 3.1.0 (To be removed: 3.3.0) +* @deprecated 3.1.0 (To be removed: 4.0.0) * @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore * @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore * @return null @@ -182,7 +182,7 @@ function update_foes($group_id = false, $user_id = false) * @param string &$rank_img the rank image as full img tag is stored here after execution * @param string &$rank_img_src the rank image source is stored here after execution * -* @deprecated 3.1.0-RC5 (To be removed: 3.3.0) +* @deprecated 3.1.0-RC5 (To be removed: 4.0.0) * * Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false */ @@ -232,7 +232,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port * * @return int|bool Returns the log_id, if the entry was added to the database, false otherwise. * - * @deprecated 3.1.0 (To be removed: 3.3.0) + * @deprecated 3.1.0 (To be removed: 4.0.0) */ function add_log() { @@ -280,7 +280,7 @@ function add_log() * * @return null * - * @deprecated 3.1.0 (To be removed: 3.3.0) + * @deprecated 3.1.0 (To be removed: 4.0.0) */ function set_config($config_name, $config_value, $is_dynamic = false, \phpbb\config\config $set_config = null) { @@ -310,7 +310,7 @@ function set_config($config_name, $config_value, $is_dynamic = false, \phpbb\con * * @return null * - * @deprecated 3.1.0 (To be removed: 3.3.0) + * @deprecated 3.1.0 (To be removed: 4.0.0) */ function set_config_count($config_name, $increment, $is_dynamic = false, \phpbb\config\config $set_config = null) { @@ -331,7 +331,7 @@ function set_config_count($config_name, $increment, $is_dynamic = false, \phpbb\ * See {@link \phpbb\request\request_interface::variable \phpbb\request\request_interface::variable} for * documentation of this function's use. * - * @deprecated 3.1.0 (To be removed: 3.3.0) + * @deprecated 3.1.0 (To be removed: 4.0.0) * @param mixed $var_name The form variable's name from which data shall be retrieved. * If the value is an array this may be an array of indizes which will give * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a") @@ -389,7 +389,7 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $ /** * Get tables of a database * - * @deprecated 3.1.0 (To be removed: 3.3.0) + * @deprecated 3.1.0 (To be removed: 4.0.0) */ function get_tables($db) { @@ -492,7 +492,7 @@ function phpbb_realpath($path) * @param $number int|float The number we want to get the plural case for. Float numbers are floored. * @return int The plural-case we need to use for the number plural-rule combination * - * @deprecated 3.2.0-dev (To be removed: 3.3.0) + * @deprecated 3.2.0-dev (To be removed: 4.0.0) */ function phpbb_get_plural_form($rule, $number) { @@ -511,3 +511,93 @@ function phpbb_pcre_utf8_support() { return true; } + +/** + * Casts a variable to the given type. + * + * @deprecated 3.1 (To be removed 4.0.0) + */ +function set_var(&$result, $var, $type, $multibyte = false) +{ + // no need for dependency injection here, if you have the object, call the method yourself! + $type_cast_helper = new \phpbb\request\type_cast_helper(); + $type_cast_helper->set_var($result, $var, $type, $multibyte); +} + +/** + * Delete Attachments + * + * @deprecated 3.2.0-a1 (To be removed: 4.0.0) + * + * @param string $mode can be: post|message|topic|attach|user + * @param mixed $ids can be: post_ids, message_ids, topic_ids, attach_ids, user_ids + * @param bool $resync set this to false if you are deleting posts or topics + */ +function delete_attachments($mode, $ids, $resync = true) +{ + global $phpbb_container; + + /** @var \phpbb\attachment\manager $attachment_manager */ + $attachment_manager = $phpbb_container->get('attachment.manager'); + $num_deleted = $attachment_manager->delete($mode, $ids, $resync); + + unset($attachment_manager); + + return $num_deleted; +} + +/** + * Delete attached file + * + * @deprecated 3.2.0-a1 (To be removed: 4.0.0) + */ +function phpbb_unlink($filename, $mode = 'file', $entry_removed = false) +{ + global $phpbb_container; + + /** @var \phpbb\attachment\manager $attachment_manager */ + $attachment_manager = $phpbb_container->get('attachment.manager'); + $unlink = $attachment_manager->unlink($filename, $mode, $entry_removed); + unset($attachment_manager); + + return $unlink; +} + +/** + * Display reasons + * + * @deprecated 3.2.0-dev (To be removed: 4.0.0) + */ +function display_reasons($reason_id = 0) +{ + global $phpbb_container; + + $phpbb_container->get('phpbb.report.report_reason_list_provider')->display_reasons($reason_id); +} + +/** + * Upload Attachment - filedata is generated here + * Uses upload class + * + * @deprecated 3.2.0-a1 (To be removed: 4.0.0) + * + * @param string $form_name The form name of the file upload input + * @param int $forum_id The id of the forum + * @param bool $local Whether the file is local or not + * @param string $local_storage The path to the local file + * @param bool $is_message Whether it is a PM or not + * @param array $local_filedata A filespec object created for the local file + * + * @return array File data array + */ +function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false) +{ + global $phpbb_container; + + /** @var \phpbb\attachment\manager $attachment_manager */ + $attachment_manager = $phpbb_container->get('attachment.manager'); + $file = $attachment_manager->upload($form_name, $forum_id, $local, $local_storage, $is_message, $local_filedata); + unset($attachment_manager); + + return $file; +} diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index e86da77b38..56d64d37fb 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -305,8 +305,8 @@ class compress_zip extends compress } } } - // This is a directory, we are not writting files - continue; + // This is a directory, we are not writing files + continue 2; } else { diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index a15a03f966..05e9233240 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1245,11 +1245,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a $display_cat = ATTACHMENT_CATEGORY_NONE; } - if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash')) - { - $display_cat = ATTACHMENT_CATEGORY_NONE; - } - $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']); $l_downloaded_viewed = 'VIEWED_COUNTS'; @@ -1281,21 +1276,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a $update_count_ary[] = $attachment['attach_id']; break; - // Macromedia Flash Files - case ATTACHMENT_CATEGORY_FLASH: - list($width, $height) = @getimagesize($filename); - - $block_array += array( - 'S_FLASH_FILE' => true, - 'WIDTH' => $width, - 'HEIGHT' => $height, - 'U_VIEW_LINK' => $download_link . '&view=1', - ); - - // Viewed/Heared File ... update the download count - $update_count_ary[] = $attachment['attach_id']; - break; - default: $l_downloaded_viewed = 'DOWNLOAD_COUNTS'; diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 792467019f..7fa32ce217 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -783,25 +783,25 @@ function generate_forum_nav(&$forum_data_ary) } $navlinks_parents[] = array( - 'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false, - 'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false, - 'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false, - 'FORUM_NAME' => $parent_name, - 'FORUM_ID' => $parent_forum_id, - 'MICRODATA' => $microdata_attr . '="' . $parent_forum_id . '"', - 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id), + 'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false, + 'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false, + 'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false, + 'BREADCRUMB_NAME' => $parent_name, + 'FORUM_ID' => $parent_forum_id, + 'MICRODATA' => $microdata_attr . '="' . $parent_forum_id . '"', + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id), ); } } $navlinks = array( - 'S_IS_CAT' => ($forum_data_ary['forum_type'] == FORUM_CAT) ? true : false, - 'S_IS_LINK' => ($forum_data_ary['forum_type'] == FORUM_LINK) ? true : false, - 'S_IS_POST' => ($forum_data_ary['forum_type'] == FORUM_POST) ? true : false, - 'FORUM_NAME' => $forum_data_ary['forum_name'], - 'FORUM_ID' => $forum_data_ary['forum_id'], - 'MICRODATA' => $microdata_attr . '="' . $forum_data_ary['forum_id'] . '"', - 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data_ary['forum_id']), + 'S_IS_CAT' => ($forum_data_ary['forum_type'] == FORUM_CAT) ? true : false, + 'S_IS_LINK' => ($forum_data_ary['forum_type'] == FORUM_LINK) ? true : false, + 'S_IS_POST' => ($forum_data_ary['forum_type'] == FORUM_POST) ? true : false, + 'BREADCRUMB_NAME' => $forum_data_ary['forum_name'], + 'FORUM_ID' => $forum_data_ary['forum_id'], + 'MICRODATA' => $microdata_attr . '="' . $forum_data_ary['forum_id'] . '"', + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data_ary['forum_id']), ); $forum_template_data = array( @@ -1149,18 +1149,6 @@ function display_custom_bbcodes() } /** -* Display reasons -* -* @deprecated 3.2.0-dev -*/ -function display_reasons($reason_id = 0) -{ - global $phpbb_container; - - $phpbb_container->get('phpbb.report.report_reason_list_provider')->display_reasons($reason_id); -} - -/** * Display user activity (action forum/topic) */ function display_user_activity(&$userdata_ary) diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 7be12baa13..447e89c3bc 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -206,28 +206,20 @@ function send_file_to_browser($attachment, $upload_dir, $category) header('X-Content-Type-Options: nosniff'); } - if ($category == ATTACHMENT_CATEGORY_FLASH && $request->variable('view', 0) === 1) + if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7))) { - // We use content-disposition: inline for flash files and view=1 to let it correctly play with flash player 10 - any other disposition will fail to play inline - header('Content-Disposition: inline'); + header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename']))); + if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false)) + { + header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); + } } else { - if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7))) - { - header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename']))); - if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false)) - { - header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); - } - } - else + header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename']))); + if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0)) { - header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename']))); - if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0)) - { - header('X-Download-Options: noopen'); - } + header('X-Download-Options: noopen'); } } diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 88dafc4300..510d98ec11 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -123,7 +123,7 @@ class p_master // We "could" build a true tree with this function - maybe mod authors want to use this... // Functions for traversing and manipulating the tree are not available though - // We might re-structure the module system to use true trees in 3.2.x... + // We might re-structure the module system to use true trees in 4.0 // $tree = $this->build_tree($this->module_cache['modules'], $this->module_cache['parents']); // Clean up module cache array to only let survive modules the user can access @@ -933,6 +933,14 @@ class p_master 'U_TITLE' => $u_title ); + if (isset($this->module_cache['parents'][$item_ary['id']]) || $item_ary['id'] == $this->p_id) + { + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $item_ary['lang'], + 'U_BREADCRUMB' => $u_title, + )); + } + $template->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER))); } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 3640f543d9..60ec54909c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -397,34 +397,6 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) // // Attachment related functions // - -/** -* Upload Attachment - filedata is generated here -* Uses upload class -* -* @deprecated 3.2.0-a1 (To be removed: 3.4.0) -* -* @param string $form_name The form name of the file upload input -* @param int $forum_id The id of the forum -* @param bool $local Whether the file is local or not -* @param string $local_storage The path to the local file -* @param bool $is_message Whether it is a PM or not -* @param array $local_filedata A filespec object created for the local file -* -* @return array File data array -*/ -function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false) -{ - global $phpbb_container; - - /** @var \phpbb\attachment\manager $attachment_manager */ - $attachment_manager = $phpbb_container->get('attachment.manager'); - $file = $attachment_manager->upload($form_name, $forum_id, $local, $local_storage, $is_message, $local_filedata); - unset($attachment_manager); - - return $file; -} - /** * Calculate the needed size for Thumbnail */ @@ -641,12 +613,6 @@ function create_thumbnail($source, $destination, $mimetype) imagecopyresampled($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); } - // If we are in safe mode create the destination file prior to using the gd functions to circumvent a PHP bug - if (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') - { - @touch($destination); - } - switch ($type['format']) { case IMG_GIF: diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php index 2f80582918..f5a56fda82 100644 --- a/phpBB/includes/questionnaire/questionnaire.php +++ b/phpBB/includes/questionnaire/questionnaire.php @@ -110,7 +110,6 @@ class phpbb_questionnaire_php_data_provider 'version' => PHP_VERSION, 'sapi' => PHP_SAPI, 'int_size' => defined('PHP_INT_SIZE') ? PHP_INT_SIZE : '', - 'safe_mode' => (int) @ini_get('safe_mode'), 'open_basedir' => (int) @ini_get('open_basedir'), 'memory_limit' => @ini_get('memory_limit'), 'allow_url_fopen' => (int) @ini_get('allow_url_fopen'), @@ -121,8 +120,6 @@ class phpbb_questionnaire_php_data_provider 'disable_functions' => @ini_get('disable_functions'), 'disable_classes' => @ini_get('disable_classes'), 'enable_dl' => (int) @ini_get('enable_dl'), - 'magic_quotes_gpc' => (int) @ini_get('magic_quotes_gpc'), - 'register_globals' => (int) @ini_get('register_globals'), 'filter.default' => @ini_get('filter.default'), 'zend.ze1_compatibility_mode' => (int) @ini_get('zend.ze1_compatibility_mode'), 'unicode.semantics' => (int) @ini_get('unicode.semantics'), diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php index 66f85657a5..d42ae58c42 100644 --- a/phpBB/includes/startup.php +++ b/phpBB/includes/startup.php @@ -23,11 +23,11 @@ $level = E_ALL & ~E_NOTICE & ~E_DEPRECATED; error_reporting($level); /** -* Minimum Requirement: PHP 5.4.0 +* Minimum Requirement: PHP 7.1.0 */ -if (version_compare(PHP_VERSION, '5.4') < 0) +if (version_compare(PHP_VERSION, '7.1') < 0) { - die('You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2'); + die('You are running an unsupported PHP version. Please upgrade to PHP 7.1.0 or higher before trying to install or update to phpBB 3.3'); } // Register globals and magic quotes have been dropped in PHP 5.4 so no need for extra checks diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 0e673cb692..0e3ff50268 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -451,6 +451,9 @@ class ucp_register { $message = $user->lang['ACCOUNT_ADDED']; $email_template = 'user_welcome'; + + // Autologin after registration + $user->session_create($user_id, 0, false, 1); } if ($config['email_enable']) @@ -599,6 +602,31 @@ class ucp_register break; } + /* @var $provider_collection \phpbb\auth\provider_collection */ + $provider_collection = $phpbb_container->get('auth.provider_collection'); + $auth_provider = $provider_collection->get_provider(); + + $auth_provider_data = $auth_provider->get_login_data(); + if ($auth_provider_data) + { + if (isset($auth_provider_data['VARS'])) + { + $template->assign_vars($auth_provider_data['VARS']); + } + + if (isset($auth_provider_data['BLOCK_VAR_NAME'])) + { + foreach ($auth_provider_data['BLOCK_VARS'] as $block_vars) + { + $template->assign_block_vars($auth_provider_data['BLOCK_VAR_NAME'], $block_vars); + } + } + + $template->assign_vars(array( + 'PROVIDER_TEMPLATE_FILE' => $auth_provider_data['TEMPLATE_FILE'], + )); + } + // Assign template vars for timezone select phpbb_timezone_select($template, $user, $data['tz'], true); diff --git a/phpBB/install/app.php b/phpBB/install/app.php index 710f49570b..9d04ec2156 100644 --- a/phpBB/install/app.php +++ b/phpBB/install/app.php @@ -20,9 +20,9 @@ define('PHPBB_ENVIRONMENT', 'production'); $phpbb_root_path = '../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -if (version_compare(PHP_VERSION, '5.4.7', '<') || version_compare(PHP_VERSION, '7.3-dev', '>=')) +if (version_compare(PHP_VERSION, '7.1') < 0) { - die('You are running an unsupported PHP version. Please upgrade to PHP equal to or greater than 5.4.7 but less than 7.3-dev in order to install or update to phpBB 3.2'); + die('You are running an unsupported PHP version. Please upgrade to PHP 7.1.0 or higher before trying to install or update to phpBB 3.3'); } $startup_new_path = $phpbb_root_path . 'install/update/update/new/install/startup.' . $phpEx; diff --git a/phpBB/install/convert/convertor.php b/phpBB/install/convert/convertor.php index 5118651b71..e79ad64012 100644 --- a/phpBB/install/convert/convertor.php +++ b/phpBB/install/convert/convertor.php @@ -63,7 +63,7 @@ class convertor { global $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache, $auth; global $convert, $convert_row, $message_parser, $skip_rows, $language; - global $request, $phpbb_dispatcher; + global $request, $phpbb_dispatcher, $phpbb_container; $phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); extract($phpbb_config_php_file->get_all()); @@ -687,7 +687,7 @@ class convertor $this->template->assign_block_vars('checks', array( 'TITLE' => "skip_rows = $skip_rows", - 'RESULT' => $rows . ((defined('DEBUG') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] : ''), + 'RESULT' => $rows . (($phpbb_container->getParameter('debug.memory') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] : ''), )); $mtime = explode(' ', microtime()); @@ -920,6 +920,7 @@ class convertor { global $user, $db, $phpbb_root_path, $phpEx, $config, $cache; global $convert; + global $phpbb_container; include_once ($phpbb_root_path . 'includes/functions_admin.' . $phpEx); @@ -959,7 +960,7 @@ class convertor sync('topic', 'range', 'topic_id BETWEEN ' . $sync_batch . ' AND ' . $end, true, true); $this->template->assign_block_vars('checks', array( - 'TITLE' => sprintf($user->lang['SYNC_TOPIC_ID'], $sync_batch, ($sync_batch + $batch_size)) . ((defined('DEBUG') && function_exists('memory_get_usage')) ? ' [' . ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] . ']' : ''), + 'TITLE' => sprintf($user->lang['SYNC_TOPIC_ID'], $sync_batch, ($sync_batch + $batch_size)) . (($phpbb_container->getParameter('debug.memory') && function_exists('memory_get_usage')) ? ' [' . ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] . ']' : ''), 'RESULT' => $user->lang['DONE'], )); diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 230b999c87..c4d2be5a28 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -38,7 +38,7 @@ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.3', - 'phpbb_version' => '3.2.7', + 'phpbb_version' => '3.3.0', 'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>', 'dbms' => $dbms, 'dbhost' => $dbhost, diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 2da901d3de..69dc7bb4bc 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -1399,10 +1399,6 @@ function phpbb_attachment_category($cat_id) case 2: return ATTACHMENT_CATEGORY_WM; break; - - case 3: - return ATTACHMENT_CATEGORY_FLASH; - break; } return ATTACHMENT_CATEGORY_NONE; diff --git a/phpBB/install/phpbbcli.php b/phpBB/install/phpbbcli.php index 217f1dfbd4..51fa9f51ed 100755 --- a/phpBB/install/phpbbcli.php +++ b/phpBB/install/phpbbcli.php @@ -23,7 +23,7 @@ if (php_sapi_name() !== 'cli') define('IN_PHPBB', true); define('IN_INSTALL', true); define('PHPBB_ENVIRONMENT', 'production'); -define('PHPBB_VERSION', '3.2.7'); +define('PHPBB_VERSION', '3.3.0-b1'); $phpbb_root_path = __DIR__ . '/../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 71000e64d7..2854f71606 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -279,7 +279,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0 INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.8-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.3.0-b1-dev'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); @@ -724,7 +724,6 @@ INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mo INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('ARCHIVES', 0, 1, 1, '', 0, ''); INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('PLAIN_TEXT', 0, 0, 1, '', 0, ''); INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('DOCUMENTS', 0, 0, 1, '', 0, ''); -INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('FLASH_FILES', 5, 0, 1, '', 0, ''); INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('DOWNLOADABLE_FILES', 0, 0, 1, '', 0, ''); # -- extensions @@ -781,13 +780,11 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ods'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odt'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'rtf'); -INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'swf'); - -INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'mp3'); -INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'mpeg'); -INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'mpg'); -INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'ogg'); -INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'ogm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'mp3'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'mpeg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'mpg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'ogg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'ogm'); # Add default profile fields INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_location', 'profilefields.type.string', 'phpbb_location', '20', '2', '100', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, '', ''); diff --git a/phpBB/install/startup.php b/phpBB/install/startup.php index 9a4f9bfe39..50758f5b98 100644 --- a/phpBB/install/startup.php +++ b/phpBB/install/startup.php @@ -120,6 +120,7 @@ $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relati $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path; // Include files +phpbb_require_updated('includes/compatibility_globals.' . $phpEx, $phpbb_root_path); phpbb_require_updated('includes/functions.' . $phpEx, $phpbb_root_path); phpbb_require_updated('includes/functions_content.' . $phpEx, $phpbb_root_path); phpbb_include_updated('includes/functions_compatibility.' . $phpEx, $phpbb_root_path); diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php index 86430f46bd..67454f8b76 100644 --- a/phpBB/language/en/acp/attachments.php +++ b/phpBB/language/en/acp/attachments.php @@ -68,7 +68,6 @@ $lang = array_merge($lang, array( 'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments for the whole board, with 0 being unlimited.', 'ATTACH_TO_POST' => 'Attach file to post', - 'CAT_FLASH_FILES' => 'Flash files', 'CAT_IMAGES' => 'Images', 'CHECK_CONTENT' => 'Check attachment files', 'CHECK_CONTENT_EXPLAIN' => 'Some browsers can be tricked to assume an incorrect mimetype for uploaded files. This option ensures that such files likely to cause this are rejected.', @@ -99,7 +98,6 @@ $lang = array_merge($lang, array( 'EXT_GROUP_ARCHIVES' => 'Archives', 'EXT_GROUP_DOCUMENTS' => 'Documents', 'EXT_GROUP_DOWNLOADABLE_FILES' => 'Downloadable Files', - 'EXT_GROUP_FLASH_FILES' => 'Flash Files', 'EXT_GROUP_IMAGES' => 'Images', 'EXT_GROUP_PLAIN_TEXT' => 'Plain Text', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 9b45ffa45b..b92710b178 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -437,7 +437,7 @@ $lang = array_merge($lang, array( 'AUTH_PROVIDER_OAUTH_TITLE' => 'OAuth', 'AUTH_PROVIDER_OAUTH_SECRET' => 'Secret', - 'APACHE_SETUP_BEFORE_USE' => 'You have to setup apache authentication before you switch phpBB to this authentication method. Keep in mind that the username you use for apache authentication has to be the same as your phpBB username. Apache authentication can only be used with mod_php (not with a CGI version) and safe_mode disabled.', + 'APACHE_SETUP_BEFORE_USE' => 'You have to setup apache authentication before you switch phpBB to this authentication method. Keep in mind that the username you use for apache authentication has to be the same as your phpBB username. Apache authentication can only be used with mod_php (not with a CGI version).', 'LDAP' => 'LDAP', 'LDAP_DN' => 'LDAP base <var>dn</var>', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 1c2253542c..5ac4b445dc 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -226,16 +226,6 @@ $lang = array_merge($lang, array( 'BACK' => 'Back', - 'CANNOT_CHANGE_FILE_GROUP' => 'Unable to change file group', - 'CANNOT_CHANGE_FILE_PERMISSIONS' => 'Unable to change file permissions', - 'CANNOT_COPY_FILES' => 'Unable to copy files', - 'CANNOT_CREATE_SYMLINK' => 'Unable to create a symlink', - 'CANNOT_DELETE_FILES' => 'Unable to delete files from the system', - 'CANNOT_DUMP_FILE' => 'Unable to dump file', - 'CANNOT_MIRROR_DIRECTORY' => 'Unable to mirror directory', - 'CANNOT_RENAME_FILE' => 'Unable to rename a file from the system', - 'CANNOT_TOUCH_FILES' => 'Unable to determine if the file exists', - 'CONTAINER_EXCEPTION' => 'phpBB encountered an error building the container due to an installed extension. For this reason, all extensions have been temporarily disabled. Please try purging your forum cache. All extensions will automatically be re-enabled once the container error is resolved. If this error continues, please visit <a href="https://www.phpbb.com/support">phpBB.com</a> for support.', 'EXCEPTION' => 'Exception', @@ -373,7 +363,7 @@ $lang = array_merge($lang, array( 'DATABASE_SERVER_INFO' => 'Database server', 'DATABASE_SIZE' => 'Database size', - // Enviroment configuration checks, mbstring related + // Environment configuration checks, mbstring related 'ERROR_MBSTRING_FUNC_OVERLOAD' => 'Function overloading is improperly configured', 'ERROR_MBSTRING_FUNC_OVERLOAD_EXPLAIN' => '<var>mbstring.func_overload</var> must be set to either 0 or 4. You can check the current value on the <samp>PHP information</samp> page.', 'ERROR_MBSTRING_ENCODING_TRANSLATION' => 'Transparent character encoding is improperly configured', diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 54d968cdaa..875e424906 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -54,7 +54,7 @@ $lang = array_merge($lang, array( <br /> - <p>For further information on setting up and managing permissions on your phpBB3 board, please see the section on <a href="https://www.phpbb.com/support/docs/en/3.2/ug/quickstart/permissions/">Setting permissions of our Quick Start Guide</a>.</p> + <p>For further information on setting up and managing permissions on your phpBB3 board, please see the section on <a href="https://www.phpbb.com/support/docs/en/3.3/ug/quickstart/permissions/">Setting permissions of our Quick Start Guide</a>.</p> ', 'ACL_NEVER' => 'Never', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 835030762c..8a2767e564 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -266,6 +266,17 @@ $lang = array_merge($lang, array( 'FSOCK_DISABLED' => 'The operation could not be completed because the <var>fsockopen</var> function has been disabled or the server being queried could not be found.', 'FSOCK_TIMEOUT' => 'A timeout occurred while reading from the network stream.', + 'FILESYSTEM_CANNOT_CHANGE_FILE_GROUP' => 'Unable to change file group', + 'FILESYSTEM_CANNOT_CHANGE_FILE_PERMISSIONS' => 'Unable to change file permissions', + 'FILESYSTEM_CANNOT_COPY_FILES' => 'Unable to copy files', + 'FILESYSTEM_CANNOT_CREATE_SYMLINK' => 'Unable to create a symlink', + 'FILESYSTEM_CANNOT_CREATE_DIRECTORY' => 'Unable to create directory', + 'FILESYSTEM_CANNOT_DELETE_FILES' => 'Unable to delete files from the system', + 'FILESYSTEM_CANNOT_DUMP_FILE' => 'Unable to dump file', + 'FILESYSTEM_CANNOT_MIRROR_DIRECTORY' => 'Unable to mirror directory', + 'FILESYSTEM_CANNOT_RENAME_FILE' => 'Unable to rename a file from the system', + 'FILESYSTEM_CANNOT_TOUCH_FILES' => 'Unable to determine if the file exists', + 'FTP_FSOCK_HOST' => 'FTP host', 'FTP_FSOCK_HOST_EXPLAIN' => 'FTP server used to connect your site.', 'FTP_FSOCK_PASSWORD' => 'FTP password', @@ -483,7 +494,7 @@ $lang = array_merge($lang, array( 'NOTIFICATION_TOPIC_IN_QUEUE' => '<strong>Topic approval</strong> request by %1$s:', 'NOTIFICATION_TYPE_NOT_EXIST' => 'The notification type "%s" is missing from the file system.', 'NOTIFICATION_ADMIN_ACTIVATE_USER' => '<strong>Activation required</strong> for deactivated or newly registered user: “%1$s”', - // Used in conjuction with NOTIFICATION_BOOKMARK and NOTIFICATION_POST. + // Used in conjunction with NOTIFICATION_BOOKMARK and NOTIFICATION_POST. 'NOTIFICATION_MANY_OTHERS' => 'others', 'NOTIFICATION_X_OTHERS' => array( 2 => '%d others', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 9bceeccde7..2fd2cfd89f 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -49,7 +49,7 @@ $lang = array_merge($lang, array( // Support page 'SUPPORT_TITLE' => 'Support', - 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=486">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>Extensions / Styles</h2><p>For issues relating to Extensions, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=451">Extensions Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=471">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/docs/en/3.2/ug/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, follow us on <a href="https://www.twitter.com/phpbb/">Twitter</a> and <a href="https://www.facebook.com/phpbb/">Facebook</a><br /><br />', + 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=486">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>Extensions / Styles</h2><p>For issues relating to Extensions, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=451">Extensions Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=471">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/docs/en/3.3/ug/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, follow us on <a href="https://www.twitter.com/phpbb/">Twitter</a> and <a href="https://www.facebook.com/phpbb/">Facebook</a><br /><br />', // License 'LICENSE_TITLE' => 'General Public License', @@ -70,7 +70,7 @@ $lang = array_merge($lang, array( <p>phpBB3 supports the following databases:</p> <ul> - <li>MySQL 3.23 or above (MySQLi supported)</li> + <li>MySQL 4.1.3 or above (MySQLi required)</li> <li>PostgreSQL 8.3+</li> <li>SQLite 3.6.15+</li> <li>MS SQL Server 2000 or above (directly or via ODBC)</li> @@ -105,7 +105,7 @@ $lang = array_merge($lang, array( // Server requirements 'PHP_VERSION_REQD' => 'PHP version', - 'PHP_VERSION_REQD_EXPLAIN' => 'phpBB requires PHP version 5.4.0 or higher.', + 'PHP_VERSION_REQD_EXPLAIN' => 'phpBB requires PHP version 7.1.0 or higher.', 'PHP_GETIMAGESIZE_SUPPORT' => 'PHP getimagesize() function is required', 'PHP_GETIMAGESIZE_SUPPORT_EXPLAIN' => 'In order for phpBB to function correctly, the getimagesize function needs to be available.', 'PCRE_UTF_SUPPORT' => 'PCRE UTF-8 support', @@ -220,7 +220,7 @@ $lang = array_merge($lang, array( 'UPDATE_INCOMPLETE_MORE' => 'Please read the information below in order to fix this error.', 'UPDATE_INCOMPLETE_EXPLAIN' => '<h1>Incomplete update</h1> - <p>We noticed that the last update of your phpBB installation hasn’t been completed. Visit the <a href="%1$s" title="%1$s">database updater</a>, ensure <em>Update database only</em> is selected and click on <strong>Submit</strong>. Don\'t forget to delete the "install"-directory after you have updated the database sucessfully.</p>', + <p>We noticed that the last update of your phpBB installation hasn’t been completed. Visit the <a href="%1$s" title="%1$s">database updater</a>, ensure <em>Update database only</em> is selected and click on <strong>Submit</strong>. Don\'t forget to delete the "install"-directory after you have updated the database successfully.</p>', // // Server data @@ -565,7 +565,7 @@ $lang = array_merge($lang, array( // Finish conversion 'CONVERT_COMPLETE' => 'Conversion completed', - 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.2. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="https://www.phpbb.com/support/docs/en/3.2/ug/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">support forums</a>.', + 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.3. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="https://www.phpbb.com/support/docs/en/3.2/ug/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">support forums</a>.', 'CONV_ERROR_ATTACH_FTP_DIR' => 'FTP upload for attachments is enabled at the old board. Please disable the FTP upload option and make sure a valid upload directory is specified, then copy all attachment files to this new web accessible directory. Once you have done this, restart the convertor.', 'CONV_ERROR_CONFIG_EMPTY' => 'There is no configuration information available for the conversion.', diff --git a/phpBB/language/en/migrator.php b/phpBB/language/en/migrator.php index 8a82d40be5..03802549d2 100644 --- a/phpBB/language/en/migrator.php +++ b/phpBB/language/en/migrator.php @@ -46,7 +46,7 @@ $lang = array_merge($lang, array( 'MIGRATION_DATA_IN_PROGRESS' => 'Installing Data: %1$s; Time: %2$.2f seconds', 'MIGRATION_DATA_RUNNING' => 'Installing Data: %s.', 'MIGRATION_EFFECTIVELY_INSTALLED' => 'Migration already effectively installed (skipped): %s', - 'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.', + 'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors:<br><br>%s', 'MIGRATION_NOT_FULFILLABLE' => 'The migration "%1$s" is not fulfillable, missing migration "%2$s".', 'MIGRATION_NOT_INSTALLED' => 'The migration "%s" is not installed.', 'MIGRATION_NOT_VALID' => '%s is not a valid migration.', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 11ea6483e1..9157f407dd 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -265,7 +265,6 @@ $lang = array_merge($lang, array( 'TOPIC_BUMPED' => 'Topic has been bumped successfully.', 'UNAUTHORISED_BBCODE' => 'You cannot use certain BBCodes: %s.', - 'UNGLOBALISE_EXPLAIN' => 'To switch this topic back from being global to a normal topic, you need to select the forum you wish this topic to be displayed.', 'UNSUPPORTED_CHARACTERS_MESSAGE' => 'Your message contains the following unsupported characters:<br />%s', 'UNSUPPORTED_CHARACTERS_SUBJECT' => 'Your subject contains the following unsupported characters:<br />%s', 'UPDATE_COMMENT' => 'Update comment', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 2622fb57b7..12b0bad182 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -62,7 +62,7 @@ $lang = array_merge($lang, array( 'ACCOUNT_ACTIVE' => 'Your account has now been activated. Thank you for registering.', 'ACCOUNT_ACTIVE_ADMIN' => 'The account has now been activated.', 'ACCOUNT_ACTIVE_PROFILE' => 'Your account has now been successfully reactivated.', - 'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password.', + 'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created.', 'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.', 'ACCOUNT_EMAIL_CHANGED' => 'Your account has been updated. However, this board requires account reactivation on email changes. An activation key has been sent to the new email address you provided. Please check your email for further information.', 'ACCOUNT_EMAIL_CHANGED_ADMIN' => 'Your account has been updated. However, this board requires account reactivation by the administrators on email changes. An email has been sent to them and you will be informed when your account has been reactivated.', @@ -449,6 +449,7 @@ $lang = array_merge($lang, array( 'RECIPIENT' => 'Recipient', 'RECIPIENTS' => 'Recipients', 'REGISTRATION' => 'Registration', + 'OAUTH_REGISTRATION' => 'Registration using external services', 'RELEASE_MESSAGES' => '%sRelease all on-hold messages%s… they will be re-sorted into the appropriate folder if enough space is made available.', 'REMOVE_ADDRESS' => 'Remove address', 'REMOVE_SELECTED_BOOKMARKS' => 'Remove selected bookmarks', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index c4a8a66c18..6215a675b4 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -308,6 +308,11 @@ $vars = array( ); extract($phpbb_dispatcher->trigger_event('core.modify_mcp_modules_display_option', compact($vars))); +$template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $user->lang('MCP'), + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}mcp.$phpEx"), +)); + // Load and execute the relevant module $module->load_active(); diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b26d7c8f94..2f2c823feb 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -364,6 +364,11 @@ switch ($mode) } } + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $page_title, + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=team"), + )); + $template->assign_vars(array( 'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE'])) ); @@ -461,6 +466,11 @@ switch ($mode) break; } + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $page_title, + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=$action&u=$user_id"), + )); + // Send vars to the template $template->assign_vars(array( 'IM_CONTACT' => $row[$sql_field], @@ -865,6 +875,15 @@ switch ($mode) $page_title = sprintf($user->lang['VIEWING_PROFILE'], $member['username']); $template_html = 'memberlist_view.html'; + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $user->lang('MEMBERLIST'), + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), + )); + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $member['username'], + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$user_id"), + )); + break; case 'contactadmin': @@ -914,6 +933,41 @@ switch ($mode) $template_html = $form->get_template_file(); $form->render($template); + if ($user_id) + { + $navlink_name = $user->lang('SEND_EMAIL'); + $navlink_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$user_id"); + } + else if ($topic_id) + { + $sql = 'SELECT f.parent_id, f.forum_parents, f.left_id, f.right_id, f.forum_type, f.forum_name, f.forum_id, f.forum_desc, f.forum_desc_uid, f.forum_desc_bitfield, f.forum_desc_options, f.forum_options, t.topic_title + FROM ' . FORUMS_TABLE . ' as f, + ' . TOPICS_TABLE . ' as t + WHERE t.forum_id = f.forum_id'; + $result = $db->sql_query($sql); + $topic_data = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + generate_forum_nav($topic_data); + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $topic_data['topic_title'], + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id"), + )); + + $navlink_name = $user->lang('EMAIL_TOPIC'); + $navlink_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&t=$topic_id"); + } + else if ($mode === 'contactadmin') + { + $navlink_name = $user->lang('CONTACT_ADMIN'); + $navlink_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contactadmin"); + } + + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $navlink_name, + 'U_BREADCRUMB' => $navlink_url, + )); + break; case 'livesearch': @@ -951,6 +1005,11 @@ switch ($mode) $page_title = $user->lang['MEMBERLIST']; $template_html = 'memberlist_body.html'; + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $page_title, + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), + )); + /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); @@ -1256,6 +1315,11 @@ switch ($mode) unset($module); } + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $group_helper->get_name($group_row['group_name']), + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&g=$group_id"), + )); + $template->assign_vars(array( 'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']), 'GROUP_NAME' => $group_helper->get_name($group_row['group_name']), diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 93419d2915..5e8cb3dea8 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -423,7 +423,7 @@ class oauth extends \phpbb\auth\provider\base if ($credentials['key'] && $credentials['secret']) { $actual_name = str_replace('auth.provider.oauth.service.', '', $service_name); - $redirect_url = build_url(false) . '&login=external&oauth_service=' . $actual_name; + $redirect_url = generate_board_url() . '/ucp.' . $this->php_ext . '?mode=login&login=external&oauth_service=' . $actual_name; $login_data['BLOCK_VARS'][$service_name] = array( 'REDIRECT_URL' => redirect($redirect_url, true), 'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)], diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index a012bb15b6..a5b704b4ff 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -84,6 +84,7 @@ class upload extends \phpbb\avatar\driver\driver $template->assign_vars(array( 'S_UPLOAD_AVATAR_URL' => ($this->config['allow_avatar_remote_upload']) ? true : false, 'AVATAR_UPLOAD_SIZE' => $this->config['avatar_filesize'], + 'AVATAR_ALLOWED_EXTENSIONS' => implode(',', preg_replace('/^/', '.', $this->allowed_extensions)), )); return true; diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php index eba9549877..956936bf6f 100644 --- a/phpBB/phpbb/cache/driver/memory.php +++ b/phpBB/phpbb/cache/driver/memory.php @@ -25,7 +25,7 @@ abstract class memory extends \phpbb\cache\driver\base */ function __construct() { - global $phpbb_root_path, $dbname, $table_prefix, $phpbb_container; + global $dbname, $table_prefix, $phpbb_container; $this->cache_dir = $phpbb_container->getParameter('core.cache_dir'); $this->key_prefix = substr(md5($dbname . $table_prefix), 0, 8) . '_'; diff --git a/phpBB/phpbb/class_loader.php b/phpBB/phpbb/class_loader.php index cfdcc2af0b..a4b69311ca 100644 --- a/phpBB/phpbb/class_loader.php +++ b/phpBB/phpbb/class_loader.php @@ -64,7 +64,7 @@ class class_loader /** * Provide the class loader with a cache to store paths. If set to null, the - * the class loader will resolve paths by checking for the existance of every + * the class loader will resolve paths by checking for the existence of every * directory in the class name every time. * * @param \phpbb\cache\driver\driver_interface $cache An implementation of the phpBB cache interface. diff --git a/phpBB/phpbb/config/config.php b/phpBB/phpbb/config/config.php index aaad333006..c619cae2fd 100644 --- a/phpBB/phpbb/config/config.php +++ b/phpBB/phpbb/config/config.php @@ -148,6 +148,25 @@ class config implements \ArrayAccess, \IteratorAggregate, \Countable } /** + * Checks configuration option's value only if the new_value matches the + * current configuration value and the configuration value does exist.Called + * only after set_atomic has been called. + * + * @param string $key The configuration option's name + * @param string $new_value New configuration value + * @throws \phpbb\exception\http_exception when config value is set and not equal to new_value. + * @return bool True if the value was changed, false otherwise. + */ + public function ensure_lock($key, $new_value) + { + if (isset($this->config[$key]) && $this->config[$key] == $new_value) + { + return true; + } + throw new \phpbb\exception\http_exception(500, 'Failure while aqcuiring locks.'); + } + + /** * Increments an integer configuration value. * * @param string $key The configuration option's name diff --git a/phpBB/phpbb/console/command/cron/run.php b/phpBB/phpbb/console/command/cron/run.php index dea6493007..df8bcf44f9 100644 --- a/phpBB/phpbb/console/command/cron/run.php +++ b/phpBB/phpbb/console/command/cron/run.php @@ -73,7 +73,7 @@ class run extends \phpbb\console\command\command * @param InputInterface $input The input stream used to get the argument and verboe option. * @param OutputInterface $output The output stream, used for printing verbose-mode and error information. * - * @return int 0 if all is ok, 1 if a lock error occured and 2 if no task matching the argument was found. + * @return int 0 if all is ok, 1 if a lock error occurred and 2 if no task matching the argument was found. */ protected function execute(InputInterface $input, OutputInterface $output) { diff --git a/phpBB/phpbb/console/command/update/check.php b/phpBB/phpbb/console/command/update/check.php index 9ced651e8b..85c6cf7379 100644 --- a/phpBB/phpbb/console/command/update/check.php +++ b/phpBB/phpbb/console/command/update/check.php @@ -77,7 +77,7 @@ class check extends \phpbb\console\command\command * * @param InputInterface $input Input stream, used to get the options. * @param OutputInterface $output Output stream, used to print messages. - * @return int 0 if the board is up to date, 1 if it is not and 2 if an error occured. + * @return int 0 if the board is up to date, 1 if it is not and 2 if an error occurred. * @throws \RuntimeException */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php index f023e0742c..704ec6badb 100644 --- a/phpBB/phpbb/content_visibility.php +++ b/phpBB/phpbb/content_visibility.php @@ -684,7 +684,7 @@ class content_visibility * @param $time int Timestamp when the action is performed * @param $reason string Reason why the visibilty was changed. * @param $force_update_all bool Force to update all posts within the topic - * @return array Changed topic data, empty array if an error occured. + * @return array Changed topic data, empty array if an error occurred. */ public function set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all = false) { diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php index 664b4f4e0f..58a4a492f8 100644 --- a/phpBB/phpbb/controller/helper.php +++ b/phpBB/phpbb/controller/helper.php @@ -121,7 +121,7 @@ class helper * @param int $code The error code (e.g. 404, 500, 503, etc.) * @return Response A Response instance * - * @deprecated 3.1.3 (To be removed: 3.3.0) Use exceptions instead. + * @deprecated 3.1.3 (To be removed: 4.0.0) Use exceptions instead. */ public function error($message, $code = 500) { diff --git a/phpBB/phpbb/cron/controller/cron.php b/phpBB/phpbb/cron/controller/cron.php new file mode 100644 index 0000000000..6f0e35e4cd --- /dev/null +++ b/phpBB/phpbb/cron/controller/cron.php @@ -0,0 +1,40 @@ +<?php +/** + * + * This file is part of the phpBB Forum Software package. + * + * @copyright (c) phpBB Limited <https://www.phpbb.com> + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\cron\controller; + +use Symfony\Component\HttpFoundation\Response; + +/** + * Controller for running cron jobs + */ +class cron +{ + /** + * Handles CRON requests + * + * @param string $cron_type + * + * @return Response + */ + public function handle($cron_type) + { + $response = new Response(); + $response->headers->set('Cache-Control', 'no-cache'); + $response->headers->set('Content-type', 'image/gif'); + $response->headers->set('Content-length', '43'); + $response->setContent(base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==')); + + return $response; + } +} diff --git a/phpBB/phpbb/cron/event/cron_runner_listener.php b/phpBB/phpbb/cron/event/cron_runner_listener.php new file mode 100644 index 0000000000..9e9ecf0d47 --- /dev/null +++ b/phpBB/phpbb/cron/event/cron_runner_listener.php @@ -0,0 +1,103 @@ +<?php +/** + * + * This file is part of the phpBB Forum Software package. + * + * @copyright (c) phpBB Limited <https://www.phpbb.com> + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\cron\event; + +use phpbb\cron\manager; +use phpbb\lock\db; +use phpbb\request\request_interface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Event\PostResponseEvent; + +/** + * Event listener that executes cron tasks, after the response was served + */ +class cron_runner_listener implements EventSubscriberInterface +{ + /** + * @var \phpbb\lock\db + */ + private $cron_lock; + + /** + * @var \phpbb\cron\manager + */ + private $cron_manager; + + /** + * @var \phpbb\request\request_interface + */ + private $request; + + /** + * Constructor + * + * @param db $lock + * @param manager $manager + * @param request_interface $request + */ + public function __construct(db $lock, manager $manager, request_interface $request) + { + $this->cron_lock = $lock; + $this->cron_manager = $manager; + $this->request = $request; + } + + /** + * Runs the cron job after the response was sent + * + * @param PostResponseEvent $event The event + */ + public function on_kernel_terminate(PostResponseEvent $event) + { + $request = $event->getRequest(); + $controller_name = $request->get('_route'); + + if ($controller_name !== 'phpbb_cron_run') + { + return; + } + + $cron_type = $request->get('cron_type'); + + if ($this->cron_lock->acquire()) + { + $task = $this->cron_manager->find_task($cron_type); + if ($task) + { + if ($task->is_parametrized()) + { + $task->parse_parameters($this->request); + } + + if ($task->is_ready()) + { + $task->run(); + } + + $this->cron_lock->release(); + } + } + } + + /** + * {@inheritdoc} + */ + static public function getSubscribedEvents() + { + return array( + KernelEvents::TERMINATE => 'on_kernel_terminate', + ); + } +} diff --git a/phpBB/phpbb/cron/manager.php b/phpBB/phpbb/cron/manager.php index 9bd30a0a5b..59ee693074 100644 --- a/phpBB/phpbb/cron/manager.php +++ b/phpBB/phpbb/cron/manager.php @@ -13,6 +13,9 @@ namespace phpbb\cron; +use phpbb\cron\task\wrapper; +use phpbb\routing\helper; + /** * Cron manager class. * @@ -21,6 +24,11 @@ namespace phpbb\cron; class manager { /** + * @var helper + */ + protected $routing_helper; + + /** * Set of \phpbb\cron\task\wrapper objects. * Array holding all tasks that have been found. * @@ -28,18 +36,27 @@ class manager */ protected $tasks = array(); + /** + * @var string + */ protected $phpbb_root_path; + + /** + * @var string + */ protected $php_ext; /** * Constructor. Loads all available tasks. * * @param array|\Traversable $tasks Provides an iterable set of task names + * @param helper $routing_helper Routing helper * @param string $phpbb_root_path Relative path to phpBB root * @param string $php_ext PHP file extension */ - public function __construct($tasks, $phpbb_root_path, $php_ext) + public function __construct($tasks, helper $routing_helper, $phpbb_root_path, $php_ext) { + $this->routing_helper = $routing_helper; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; @@ -142,6 +159,6 @@ class manager */ public function wrap_task(\phpbb\cron\task\task $task) { - return new \phpbb\cron\task\wrapper($task, $this->phpbb_root_path, $this->php_ext); + return new wrapper($task, $this->routing_helper, $this->phpbb_root_path, $this->php_ext); } } diff --git a/phpBB/phpbb/cron/task/wrapper.php b/phpBB/phpbb/cron/task/wrapper.php index 8a4a8b1f0c..4dc3a7fb95 100644 --- a/phpBB/phpbb/cron/task/wrapper.php +++ b/phpBB/phpbb/cron/task/wrapper.php @@ -13,14 +13,32 @@ namespace phpbb\cron\task; +use phpbb\routing\helper; + /** * Cron task wrapper class. * Enhances cron tasks with convenience methods that work identically for all tasks. */ class wrapper { + /** + * @var helper + */ + protected $routing_helper; + + /** + * @var task + */ protected $task; + + /** + * @var string + */ protected $phpbb_root_path; + + /** + * @var string + */ protected $php_ext; /** @@ -28,13 +46,15 @@ class wrapper * * Wraps a task $task, which must implement cron_task interface. * - * @param \phpbb\cron\task\task $task The cron task to wrap. - * @param string $phpbb_root_path Relative path to phpBB root - * @param string $php_ext PHP file extension + * @param task $task The cron task to wrap. + * @param helper $routing_helper Routing helper for route generation + * @param string $phpbb_root_path Relative path to phpBB root + * @param string $php_ext PHP file extension */ - public function __construct(\phpbb\cron\task\task $task, $phpbb_root_path, $php_ext) + public function __construct(task $task, helper $routing_helper, $phpbb_root_path, $php_ext) { $this->task = $task; + $this->routing_helper = $routing_helper; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; } @@ -49,7 +69,7 @@ class wrapper */ public function is_parametrized() { - return $this->task instanceof \phpbb\cron\task\parametrized; + return $this->task instanceof parametrized; } /** @@ -76,22 +96,13 @@ class wrapper */ public function get_url() { - $name = $this->get_name(); + $params['cron_type'] = $this->get_name(); if ($this->is_parametrized()) { - $params = $this->task->get_parameters(); - $extra = ''; - foreach ($params as $key => $value) - { - $extra .= '&' . $key . '=' . urlencode($value); - } + $params = array_merge($params, $this->task->get_parameters()); } - else - { - $extra = ''; - } - $url = append_sid($this->phpbb_root_path . 'cron.' . $this->php_ext, 'cron_type=' . $name . $extra); - return $url; + + return $this->routing_helper->route('phpbb_cron_run', $params); } /** diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index a36ce8c0d7..93f0a749e5 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -76,6 +76,16 @@ abstract class driver implements driver_interface const SUBQUERY_BUILD = 5; /** + * @var bool + */ + protected $debug_load_time = false; + + /** + * @var bool + */ + protected $debug_sql_explain = false; + + /** * Constructor */ function __construct() @@ -98,6 +108,22 @@ abstract class driver implements driver_interface /** * {@inheritdoc} */ + public function set_debug_load_time($value) + { + $this->debug_load_time = $value; + } + + /** + * {@inheritdoc} + */ + public function set_debug_sql_explain($value) + { + $this->debug_sql_explain = $value; + } + + /** + * {@inheritdoc} + */ public function get_sql_layer() { return $this->sql_layer; @@ -955,7 +981,7 @@ abstract class driver implements driver_interface // Show complete SQL error and path to administrators only // Additionally show complete error on installation or if extended debug mode is enabled // The DEBUG constant is for development only! - if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG')) + if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || $this->debug_sql_explain) { $message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : ''; } diff --git a/phpBB/phpbb/db/driver/driver_interface.php b/phpBB/phpbb/db/driver/driver_interface.php index 8b487c5d42..05ff5ef066 100644 --- a/phpBB/phpbb/db/driver/driver_interface.php +++ b/phpBB/phpbb/db/driver/driver_interface.php @@ -16,6 +16,20 @@ namespace phpbb\db\driver; interface driver_interface { /** + * Set value for load_time debug parameter + * + * @param bool $value + */ + public function set_debug_load_time($value); + + /** + * Set value for sql_explain debug parameter + * + * @param bool $value + */ + public function set_debug_sql_explain($value); + + /** * Gets the name of the sql layer. * * @return string diff --git a/phpBB/phpbb/db/driver/factory.php b/phpBB/phpbb/db/driver/factory.php index fb3a826254..bb6e7a2682 100644 --- a/phpBB/phpbb/db/driver/factory.php +++ b/phpBB/phpbb/db/driver/factory.php @@ -68,6 +68,22 @@ class factory implements driver_interface /** * {@inheritdoc} */ + public function set_debug_load_time($value) + { + $this->get_driver()->set_debug_load_time($value); + } + + /** + * {@inheritdoc} + */ + public function set_debug_sql_explain($value) + { + $this->get_driver()->set_debug_sql_explain($value); + } + + /** + * {@inheritdoc} + */ public function get_sql_layer() { return $this->get_driver()->get_sql_layer(); diff --git a/phpBB/phpbb/db/driver/mssql_odbc.php b/phpBB/phpbb/db/driver/mssql_odbc.php index 9d9ad603e0..06cdce7a15 100644 --- a/phpBB/phpbb/db/driver/mssql_odbc.php +++ b/phpBB/phpbb/db/driver/mssql_odbc.php @@ -151,12 +151,11 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base { global $cache; - // EXPLAIN only in extra debug mode - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('start', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->curtime = microtime(true); } @@ -172,11 +171,11 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base $this->sql_error($query); } - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('stop', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->sql_time += microtime(true) - $this->curtime; } @@ -196,7 +195,7 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG')) + else if ($this->debug_sql_explain) { $this->sql_report('fromcache', $query); } diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php index a4dcac5966..30ef9d9bc4 100644 --- a/phpBB/phpbb/db/driver/mssqlnative.php +++ b/phpBB/phpbb/db/driver/mssqlnative.php @@ -123,12 +123,11 @@ class mssqlnative extends \phpbb\db\driver\mssql_base { global $cache; - // EXPLAIN only in extra debug mode - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('start', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->curtime = microtime(true); } @@ -146,11 +145,11 @@ class mssqlnative extends \phpbb\db\driver\mssql_base // reset options for next query $this->query_options = array(); - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('stop', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->sql_time += microtime(true) - $this->curtime; } @@ -170,7 +169,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG')) + else if ($this->debug_sql_explain) { $this->sql_report('fromcache', $query); } diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php index a94e88b331..8ce70444c2 100644 --- a/phpBB/phpbb/db/driver/mysql.php +++ b/phpBB/phpbb/db/driver/mysql.php @@ -171,12 +171,11 @@ class mysql extends \phpbb\db\driver\mysql_base { global $cache; - // EXPLAIN only in extra debug mode - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('start', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->curtime = microtime(true); } @@ -191,11 +190,11 @@ class mysql extends \phpbb\db\driver\mysql_base $this->sql_error($query); } - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('stop', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->sql_time += microtime(true) - $this->curtime; } @@ -215,7 +214,7 @@ class mysql extends \phpbb\db\driver\mysql_base $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG')) + else if ($this->debug_sql_explain) { $this->sql_report('fromcache', $query); } @@ -390,7 +389,7 @@ class mysql extends \phpbb\db\driver\mysql_base { static $test_prof; - // current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING + // current detection method, might just switch to see the existence of INFORMATION_SCHEMA.PROFILING if ($test_prof === null) { $test_prof = false; diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index d43e201526..df8b88c315 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -173,12 +173,11 @@ class mysqli extends \phpbb\db\driver\mysql_base { global $cache; - // EXPLAIN only in extra debug mode - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('start', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->curtime = microtime(true); } @@ -193,11 +192,11 @@ class mysqli extends \phpbb\db\driver\mysql_base $this->sql_error($query); } - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('stop', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->sql_time += microtime(true) - $this->curtime; } @@ -212,7 +211,7 @@ class mysqli extends \phpbb\db\driver\mysql_base $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl); } } - else if (defined('DEBUG')) + else if ($this->debug_sql_explain) { $this->sql_report('fromcache', $query); } @@ -373,7 +372,7 @@ class mysqli extends \phpbb\db\driver\mysql_base { static $test_prof; - // current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING + // current detection method, might just switch to see the existence of INFORMATION_SCHEMA.PROFILING if ($test_prof === null) { $test_prof = false; diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php index 5fd14709f8..f2a0bb557a 100644 --- a/phpBB/phpbb/db/driver/oracle.php +++ b/phpBB/phpbb/db/driver/oracle.php @@ -246,12 +246,11 @@ class oracle extends \phpbb\db\driver\driver { global $cache; - // EXPLAIN only in extra debug mode - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('start', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->curtime = microtime(true); } @@ -428,11 +427,11 @@ class oracle extends \phpbb\db\driver\driver } } - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('stop', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->sql_time += microtime(true) - $this->curtime; } @@ -452,7 +451,7 @@ class oracle extends \phpbb\db\driver\driver $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG')) + else if ($this->debug_sql_explain) { $this->sql_report('fromcache', $query); } diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php index 44476612c3..ed330bc540 100644 --- a/phpBB/phpbb/db/driver/postgres.php +++ b/phpBB/phpbb/db/driver/postgres.php @@ -173,12 +173,11 @@ class postgres extends \phpbb\db\driver\driver { global $cache; - // EXPLAIN only in extra debug mode - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('start', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->curtime = microtime(true); } @@ -194,11 +193,11 @@ class postgres extends \phpbb\db\driver\driver $this->sql_error($query); } - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('stop', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->sql_time += microtime(true) - $this->curtime; } @@ -218,7 +217,7 @@ class postgres extends \phpbb\db\driver\driver $this->open_queries[(int) $this->query_result] = $this->query_result; } } - else if (defined('DEBUG')) + else if ($this->debug_sql_explain) { $this->sql_report('fromcache', $query); } diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php index 0508500c52..43906f1b58 100644 --- a/phpBB/phpbb/db/driver/sqlite3.php +++ b/phpBB/phpbb/db/driver/sqlite3.php @@ -118,12 +118,11 @@ class sqlite3 extends \phpbb\db\driver\driver { global $cache; - // EXPLAIN only in extra debug mode - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('start', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->curtime = microtime(true); } @@ -156,11 +155,11 @@ class sqlite3 extends \phpbb\db\driver\driver } } - if (defined('DEBUG')) + if ($this->debug_sql_explain) { $this->sql_report('stop', $query); } - else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + else if ($this->debug_load_time) { $this->sql_time += microtime(true) - $this->curtime; } @@ -175,7 +174,7 @@ class sqlite3 extends \phpbb\db\driver\driver $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl); } } - else if (defined('DEBUG')) + else if ($this->debug_sql_explain) { $this->sql_report('fromcache', $query); } diff --git a/phpBB/phpbb/db/extractor/mysql_extractor.php b/phpBB/phpbb/db/extractor/mysql_extractor.php index 34e309c19e..534e8b7653 100644 --- a/phpBB/phpbb/db/extractor/mysql_extractor.php +++ b/phpBB/phpbb/db/extractor/mysql_extractor.php @@ -300,7 +300,7 @@ class mysql_extractor extends base_extractor } /** - * Extracts database table structure (for MySQL verisons older than 3.23.20) + * Extracts database table structure (for MySQL versions older than 3.23.20) * * @param string $table_name name of the database table * @return null diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php index 10343438b3..247ccc7a76 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php @@ -117,7 +117,7 @@ class release_3_0_4_rc1 extends \phpbb\db\migration\migration } else { - // equivelant to "none", which is the "Display in user control panel" option + // equivalent to "none", which is the "Display in user control panel" option $sql_ary['field_show_profile'] = 1; } diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php index b1e7486e24..877cdc2fa3 100644 --- a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php @@ -132,7 +132,7 @@ class softdelete_p1 extends \phpbb\db\migration\migration /* * Using sql_case here to avoid "BIGINT UNSIGNED value is out of range" errors. * As we update all topics in 2 queries, one broken topic would stop the conversion - * for all topics and the surpressed error will cause the admin to not even notice it. + * for all topics and the suppressed error will cause the admin to not even notice it. */ $sql = 'UPDATE ' . $this->table_prefix . 'topics SET topic_posts_approved = topic_replies + 1, diff --git a/phpBB/phpbb/db/migration/data/v330/dev.php b/phpBB/phpbb/db/migration/data/v330/dev.php new file mode 100644 index 0000000000..209f9fc7ec --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/dev.php @@ -0,0 +1,36 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v330; + +class dev extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.3.0-dev', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v327', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.3.0-dev')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php new file mode 100644 index 0000000000..11dc43483b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php @@ -0,0 +1,84 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v330; + +class remove_attachment_flash extends \phpbb\db\migration\migration +{ + // Following constants were deprecated in 3.3 + // and moved from constants.php to compatibility_globals.php, + // thus define them as class constants + const ATTACHMENT_CATEGORY_FLASH = 5; + + protected $cat_id = array( + self::ATTACHMENT_CATEGORY_FLASH, + ); + + public function update_data() + { + return array( + array('custom', array(array($this, 'remove_flash_group'))), + ); + } + + public function remove_flash_group() + { + // select group ids of outdated media + $sql = 'SELECT group_id + FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE ' . $this->db->sql_in_set('cat_id', $this->cat_id); + $result = $this->db->sql_query($sql); + + $group_ids = array(); + while ($group_id = (int) $this->db->sql_fetchfield('group_id')) + { + $group_ids[] = $group_id; + } + $this->db->sql_freeresult($result); + + // nothing to do, admin has removed all the outdated media extension groups + if (empty($group_ids)) + { + return true; + } + + // get the group id of downloadable files + $sql = 'SELECT group_id + FROM ' . EXTENSION_GROUPS_TABLE . " + WHERE group_name = 'DOWNLOADABLE_FILES'"; + $result = $this->db->sql_query($sql); + $download_id = (int) $this->db->sql_fetchfield('group_id'); + $this->db->sql_freeresult($result); + + if (empty($download_id)) + { + $sql = 'UPDATE ' . EXTENSIONS_TABLE . ' + SET group_id = 0 + WHERE ' . $this->db->sql_in_set('group_id', $group_ids); + } + else + { + // move outdated media extensions to downloadable files + $sql = 'UPDATE ' . EXTENSIONS_TABLE . " + SET group_id = $download_id" . ' + WHERE ' . $this->db->sql_in_set('group_id', $group_ids); + } + + $this->db->sql_query($sql); + + // delete the now empty, outdated media extension groups + $sql = 'DELETE FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE ' . $this->db->sql_in_set('group_id', $group_ids); + $this->db->sql_query($sql); + } +} diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index e5133c8152..93c338437e 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -509,7 +509,7 @@ class module implements \phpbb\db\migration\tool\tool_interface * Get parent module id * * @param string|int $parent_id The parent module_id|module_langname - * @param int|string|array $data The module_id, module_langname for existance checking or module data array for adding + * @param int|string|array $data The module_id, module_langname for existence checking or module data array for adding * @param bool $throw_exception The flag indicating if exception should be thrown on error * @return mixed The int parent module_id, an array of int parent module_id values or false * @throws \phpbb\db\migration\exception diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 2b0c66fc58..3a1ee758cf 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -784,7 +784,7 @@ class migrator { return array( $parameters[0], - array($last_result), + isset($parameters[1]) ? array_merge($parameters[1], array($last_result)) : array($last_result), ); } break; diff --git a/phpBB/phpbb/db/tools/mssql.php b/phpBB/phpbb/db/tools/mssql.php index cbedf9a5c4..29f816a869 100644 --- a/phpBB/phpbb/db/tools/mssql.php +++ b/phpBB/phpbb/db/tools/mssql.php @@ -194,7 +194,7 @@ class mssql extends tools $primary_key_gen = isset($prepared_column['primary_key_set']) && $prepared_column['primary_key_set']; } - // create sequence DDL based off of the existance of auto incrementing columns + // create sequence DDL based off of the existence of auto incrementing columns if (!$create_sequence && isset($prepared_column['auto_increment']) && $prepared_column['auto_increment']) { $create_sequence = $column_name; diff --git a/phpBB/phpbb/db/tools/postgres.php b/phpBB/phpbb/db/tools/postgres.php index 077d6e06f9..276ac135be 100644 --- a/phpBB/phpbb/db/tools/postgres.php +++ b/phpBB/phpbb/db/tools/postgres.php @@ -141,7 +141,7 @@ class postgres extends tools $primary_key_gen = isset($prepared_column['primary_key_set']) && $prepared_column['primary_key_set']; } - // create sequence DDL based off of the existance of auto incrementing columns + // create sequence DDL based off of the existence of auto incrementing columns if (!$create_sequence && isset($prepared_column['auto_increment']) && $prepared_column['auto_increment']) { $create_sequence = $column_name; diff --git a/phpBB/phpbb/db/tools/tools.php b/phpBB/phpbb/db/tools/tools.php index d21d34b8a9..ccba63a5d3 100644 --- a/phpBB/phpbb/db/tools/tools.php +++ b/phpBB/phpbb/db/tools/tools.php @@ -335,7 +335,7 @@ class tools implements tools_interface $primary_key_gen = isset($prepared_column['primary_key_set']) && $prepared_column['primary_key_set']; } - // create sequence DDL based off of the existance of auto incrementing columns + // create sequence DDL based off of the existence of auto incrementing columns if (!$create_sequence && isset($prepared_column['auto_increment']) && $prepared_column['auto_increment']) { $create_sequence = $column_name; diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php index 8c1ce8bde2..f2708e6de6 100644 --- a/phpBB/phpbb/di/container_builder.php +++ b/phpBB/phpbb/di/container_builder.php @@ -481,7 +481,7 @@ class container_builder $cached_container_dump = $dumper->dump(array( 'class' => 'phpbb_cache_container', - 'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder', + 'base_class' => 'Symfony\\Component\\DependencyInjection\\Container', )); $cache->write($cached_container_dump, $this->container->getResources()); diff --git a/phpBB/phpbb/di/extension/container_configuration.php b/phpBB/phpbb/di/extension/container_configuration.php index 4585d6509e..57e7ef6ca6 100644 --- a/phpBB/phpbb/di/extension/container_configuration.php +++ b/phpBB/phpbb/di/extension/container_configuration.php @@ -31,10 +31,15 @@ class container_configuration implements ConfigurationInterface $rootNode ->children() ->booleanNode('require_dev_dependencies')->defaultValue(false)->end() + ->booleanNode('allow_install_dir')->defaultValue(false)->end() ->arrayNode('debug') ->addDefaultsIfNotSet() ->children() ->booleanNode('exceptions')->defaultValue(false)->end() + ->booleanNode('load_time')->defaultValue(false)->end() + ->booleanNode('sql_explain')->defaultValue(false)->end() + ->booleanNode('memory')->defaultValue(false)->end() + ->booleanNode('show_errors')->defaultValue(false)->end() ->end() ->end() ->arrayNode('twig') @@ -45,6 +50,12 @@ class container_configuration implements ConfigurationInterface ->booleanNode('enable_debug_extension')->defaultValue(false)->end() ->end() ->end() + ->arrayNode('session') + ->addDefaultsIfNotSet() + ->children() + ->booleanNode('log_errors')->defaultValue(false)->end() + ->end() + ->end() ->end() ; return $treeBuilder; diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php index 67150f0103..0497c90e2a 100644 --- a/phpBB/phpbb/di/extension/core.php +++ b/phpBB/phpbb/di/extension/core.php @@ -71,6 +71,8 @@ class core extends Extension } } + $container->setParameter('allow_install_dir', $config['allow_install_dir']); + // Set the Twig options if defined in the environment $definition = $container->getDefinition('template.twig.environment'); $twig_environment_options = $definition->getArgument(static::TWIG_OPTIONS_POSITION); @@ -97,6 +99,12 @@ class core extends Extension { $container->setParameter('debug.' . $name, $value); } + + // Set the log options + foreach ($config['session'] as $name => $value) + { + $container->setParameter('session.' . $name, $value); + } } /** diff --git a/phpBB/phpbb/di/service_collection.php b/phpBB/phpbb/di/service_collection.php index 8e9175e204..8c1c172e36 100644 --- a/phpBB/phpbb/di/service_collection.php +++ b/phpBB/phpbb/di/service_collection.php @@ -103,4 +103,35 @@ class service_collection extends \ArrayObject { return $this->service_classes; } + + /** + * Returns the service associated to a class + * + * @return mixed + * @throw \RuntimeException if the + */ + public function get_by_class($class) + { + $service_id = null; + + foreach ($this->service_classes as $id => $service_class) + { + if ($service_class === $class) + { + if ($service_id !== null) + { + throw new \RuntimeException('More than one service definitions found for class "'.$class.'" in collection.'); + } + + $service_id = $id; + } + } + + if ($service_id === null) + { + throw new \RuntimeException('No service found for class "'.$class.'" in collection.'); + } + + return $this->offsetGet($service_id); + } } diff --git a/phpBB/phpbb/feed/topics_active.php b/phpBB/phpbb/feed/topics_active.php index ea9ee97b9d..ee7fe177f5 100644 --- a/phpBB/phpbb/feed/topics_active.php +++ b/phpBB/phpbb/feed/topics_active.php @@ -17,7 +17,7 @@ namespace phpbb\feed; * Active Topics feed * * This will give you the last {$this->num_items} topics - * with replies made withing the last {$this->sort_days} days + * with replies made within the last {$this->sort_days} days * including the last post. */ class topics_active extends topic_base diff --git a/phpBB/phpbb/files/filespec.php b/phpBB/phpbb/files/filespec.php index 6847bca4cb..1e6771a3a4 100644 --- a/phpBB/phpbb/files/filespec.php +++ b/phpBB/phpbb/files/filespec.php @@ -420,7 +420,7 @@ class filespec return false; } - $upload_mode = ($this->php_ini->getBool('open_basedir') || $this->php_ini->getBool('safe_mode')) ? 'move' : 'copy'; + $upload_mode = ($this->php_ini->getBool('open_basedir')) ? 'move' : 'copy'; $upload_mode = ($this->local) ? 'local' : $upload_mode; $this->destination_file = $this->destination_path . '/' . utf8_basename($this->realname); diff --git a/phpBB/phpbb/filesystem.php b/phpBB/phpbb/filesystem.php index af56d78845..6ac9459331 100644 --- a/phpBB/phpbb/filesystem.php +++ b/phpBB/phpbb/filesystem.php @@ -14,7 +14,7 @@ namespace phpbb; /** - * @deprecated 3.2.0-dev (To be removed 3.3.0) use \phpbb\filesystem\filesystem instead + * @deprecated 3.2.0-dev (To be removed 4.0.0) use \phpbb\filesystem\filesystem instead */ class filesystem extends \phpbb\filesystem\filesystem { diff --git a/phpBB/phpbb/filesystem/filesystem.php b/phpBB/phpbb/filesystem/filesystem.php index bfafdf5ddd..943bce3910 100644 --- a/phpBB/phpbb/filesystem/filesystem.php +++ b/phpBB/phpbb/filesystem/filesystem.php @@ -67,7 +67,7 @@ class filesystem implements filesystem_interface $error = trim($e->getMessage()); $file = substr($error, strrpos($error, ' ')); - throw new filesystem_exception('CANNOT_CHANGE_FILE_GROUP', $file, array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_CHANGE_FILE_GROUP', $file, array(), $e); } } @@ -124,14 +124,14 @@ class filesystem implements filesystem_interface { if (true !== @chmod($file, $dir_perm)) { - throw new filesystem_exception('CANNOT_CHANGE_FILE_PERMISSIONS', $file, array()); + throw new filesystem_exception('FILESYSTEM_CANNOT_CHANGE_FILE_PERMISSIONS', $file, array()); } } else if (is_file($file)) { if (true !== @chmod($file, $file_perm)) { - throw new filesystem_exception('CANNOT_CHANGE_FILE_PERMISSIONS', $file, array()); + throw new filesystem_exception('FILESYSTEM_CANNOT_CHANGE_FILE_PERMISSIONS', $file, array()); } } } @@ -153,7 +153,7 @@ class filesystem implements filesystem_interface $error = trim($e->getMessage()); $file = substr($error, strrpos($error, ' ')); - throw new filesystem_exception('CANNOT_CHANGE_FILE_GROUP', $file, array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_CHANGE_FILE_GROUP', $file, array(), $e); } } @@ -195,7 +195,7 @@ class filesystem implements filesystem_interface } catch (\Symfony\Component\Filesystem\Exception\IOException $e) { - throw new filesystem_exception('CANNOT_COPY_FILES', '', array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_COPY_FILES', '', array(), $e); } } @@ -210,7 +210,7 @@ class filesystem implements filesystem_interface } catch (\Symfony\Component\Filesystem\Exception\IOException $e) { - throw new filesystem_exception('CANNOT_DUMP_FILE', $filename, array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_DUMP_FILE', $filename, array(), $e); } } @@ -322,7 +322,7 @@ class filesystem implements filesystem_interface $msg = $e->getMessage(); $filename = substr($msg, strpos($msg, '"'), strrpos($msg, '"')); - throw new filesystem_exception('CANNOT_MIRROR_DIRECTORY', $filename, array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_MIRROR_DIRECTORY', $filename, array(), $e); } } @@ -340,7 +340,7 @@ class filesystem implements filesystem_interface $msg = $e->getMessage(); $filename = substr($msg, strpos($msg, '"'), strrpos($msg, '"')); - throw new filesystem_exception('CANNOT_CREATE_DIRECTORY', $filename, array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_CREATE_DIRECTORY', $filename, array(), $e); } } @@ -525,7 +525,7 @@ class filesystem implements filesystem_interface $error = trim($e->getMessage()); $file = substr($error, strrpos($error, ' ')); - throw new filesystem_exception('CANNOT_DELETE_FILES', $file, array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_DELETE_FILES', $file, array(), $e); } } @@ -543,7 +543,7 @@ class filesystem implements filesystem_interface $msg = $e->getMessage(); $filename = substr($msg, strpos($msg, '"'), strrpos($msg, '"')); - throw new filesystem_exception('CANNOT_RENAME_FILE', $filename, array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_RENAME_FILE', $filename, array(), $e); } } @@ -558,7 +558,7 @@ class filesystem implements filesystem_interface } catch (\Symfony\Component\Filesystem\Exception\IOException $e) { - throw new filesystem_exception('CANNOT_CREATE_SYMLINK', $origin_dir, array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_CREATE_SYMLINK', $origin_dir, array(), $e); } } @@ -578,7 +578,7 @@ class filesystem implements filesystem_interface $error = trim($e->getMessage()); $file = substr($error, strrpos($error, ' ')); - throw new filesystem_exception('CANNOT_TOUCH_FILES', $file, array(), $e); + throw new filesystem_exception('FILESYSTEM_CANNOT_TOUCH_FILES', $file, array(), $e); } } diff --git a/phpBB/phpbb/filesystem/filesystem_interface.php b/phpBB/phpbb/filesystem/filesystem_interface.php index 1093be2499..39ae0c3954 100644 --- a/phpBB/phpbb/filesystem/filesystem_interface.php +++ b/phpBB/phpbb/filesystem/filesystem_interface.php @@ -204,7 +204,7 @@ interface filesystem_interface * This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions. * The function determines owner and group from common.php file and sets the same to the provided file. * The function uses bit fields to build the permissions. - * The function sets the appropiate execute bit on directories. + * The function sets the appropriate execute bit on directories. * * Supported constants representing bit fields are: * diff --git a/phpBB/phpbb/finder.php b/phpBB/phpbb/finder.php index 1f1d931880..0a2b67a034 100644 --- a/phpBB/phpbb/finder.php +++ b/phpBB/phpbb/finder.php @@ -80,7 +80,7 @@ class finder /** * Set the array of extensions * - * @param array $extensions A list of extensions that should be searched aswell + * @param array $extensions A list of extensions that should be searched as well * @param bool $replace_list Should the list be emptied before adding the extensions * @return \phpbb\finder This object for chaining calls */ @@ -237,7 +237,7 @@ class finder } /** - * Removes occurances of /./ and makes sure path ends without trailing slash + * Removes occurrences of /./ and makes sure path ends without trailing slash * * @param string $directory A directory pattern * @return string A cleaned up directory pattern diff --git a/phpBB/phpbb/help/controller/bbcode.php b/phpBB/phpbb/help/controller/bbcode.php index e16f99023d..560b0c02ce 100644 --- a/phpBB/phpbb/help/controller/bbcode.php +++ b/phpBB/phpbb/help/controller/bbcode.php @@ -25,6 +25,11 @@ class bbcode extends controller { $this->language->add_lang('help/bbcode'); + $this->template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $this->language->lang('BBCODE_GUIDE'), + 'U_BREADCRUMB' => $this->helper->route('phpbb_help_bbcode_controller'), + )); + $this->manager->add_block( 'HELP_BBCODE_BLOCK_INTRO', false, diff --git a/phpBB/phpbb/help/controller/faq.php b/phpBB/phpbb/help/controller/faq.php index 5e45cfe667..0f63be5b56 100644 --- a/phpBB/phpbb/help/controller/faq.php +++ b/phpBB/phpbb/help/controller/faq.php @@ -25,6 +25,11 @@ class faq extends controller { $this->language->add_lang('help/faq'); + $this->template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $this->language->lang('FAQ_EXPLAIN'), + 'U_BREADCRUMB' => $this->helper->route('phpbb_help_faq_controller'), + )); + $this->manager->add_block( 'HELP_FAQ_BLOCK_LOGIN', false, diff --git a/phpBB/phpbb/install/helper/container_factory.php b/phpBB/phpbb/install/helper/container_factory.php index 9e372fecde..655760270a 100644 --- a/phpBB/phpbb/install/helper/container_factory.php +++ b/phpBB/phpbb/install/helper/container_factory.php @@ -181,7 +181,7 @@ class container_factory $this->request->disable_super_globals(); } - // Get compatibilty globals and constants + // Get compatibility globals and constants $this->update_helper->include_file('includes/compatibility_globals.' . $this->php_ext); register_compatibility_globals(); diff --git a/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php b/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php index 440748901c..3df9a91936 100644 --- a/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php +++ b/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php @@ -31,7 +31,7 @@ interface iohandler_interface * @param string $name Name of the input variable to obtain * @param mixed $default A default value that is returned if the variable was not set. * This function will always return a value of the same type as the default. - * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters + * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks * * @return mixed Value of the input variable diff --git a/phpBB/phpbb/install/installer_configuration.php b/phpBB/phpbb/install/installer_configuration.php index 805140338c..dfafc40b4b 100644 --- a/phpBB/phpbb/install/installer_configuration.php +++ b/phpBB/phpbb/install/installer_configuration.php @@ -48,9 +48,9 @@ class installer_configuration implements ConfigurationInterface ->cannotBeEmpty() ->end() ->scalarNode('description') - ->defaultValue('My amazing new phpBB board') - ->cannotBeEmpty() - ->end() + ->defaultValue('My amazing new phpBB board') + ->cannotBeEmpty() + ->end() ->end() ->end() ->arrayNode('database') @@ -128,12 +128,11 @@ class installer_configuration implements ConfigurationInterface ->integerNode('server_port') ->defaultValue(80) ->min(1) - ->cannotBeEmpty() ->end() ->scalarNode('script_path') ->defaultValue('/') ->cannotBeEmpty() - ->end() + ->end() ->end() ->end() ->arrayNode('extensions') diff --git a/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php b/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php index 5bc425b929..900d5b94bc 100644 --- a/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php +++ b/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php @@ -165,7 +165,7 @@ class create_config_file extends \phpbb\install\task_base protected function get_config_data($debug = false, $debug_container = false, $environment = null) { $config_content = "<?php\n"; - $config_content .= "// phpBB 3.2.x auto-generated configuration file\n// Do not change anything in this file!\n"; + $config_content .= "// phpBB 3.3.x auto-generated configuration file\n// Do not change anything in this file!\n"; $dbms = $this->install_config->get('dbms'); $db_driver = $this->db_helper->get_available_dbms($dbms); @@ -191,7 +191,6 @@ class create_config_file extends \phpbb\install\task_base } $config_content .= "\n@define('PHPBB_INSTALLED', true);\n"; - $config_content .= "// @define('PHPBB_DISPLAY_LOAD_TIME', true);\n"; if ($environment) { diff --git a/phpBB/phpbb/install/module/requirements/task/check_server_environment.php b/phpBB/phpbb/install/module/requirements/task/check_server_environment.php index 29f9777747..4607ce9ec2 100644 --- a/phpBB/phpbb/install/module/requirements/task/check_server_environment.php +++ b/phpBB/phpbb/install/module/requirements/task/check_server_environment.php @@ -98,7 +98,7 @@ class check_server_environment extends \phpbb\install\task_base { $php_version = PHP_VERSION; - if (version_compare($php_version, '5.4') < 0) + if (version_compare($php_version, '7.1') < 0) { $this->response_helper->add_error_message('PHP_VERSION_REQD', 'PHP_VERSION_REQD_EXPLAIN'); diff --git a/phpBB/phpbb/lock/db.php b/phpBB/phpbb/lock/db.php index 85ba9a7aa3..eea919f8f7 100644 --- a/phpBB/phpbb/lock/db.php +++ b/phpBB/phpbb/lock/db.php @@ -110,6 +110,13 @@ class db // process we failed to acquire the lock. $this->locked = $this->config->set_atomic($this->config_name, $lock_value, $this->unique_id, false); + if ($this->locked == true) + { + if ($this->config->ensure_lock($this->config_name, $this->unique_id)) + { + return true; + } + } return $this->locked; } diff --git a/phpBB/phpbb/lock/flock.php b/phpBB/phpbb/lock/flock.php index df88e1490a..af051afb56 100644 --- a/phpBB/phpbb/lock/flock.php +++ b/phpBB/phpbb/lock/flock.php @@ -101,7 +101,10 @@ class flock if ($this->lock_fp) { - @flock($this->lock_fp, LOCK_EX); + if (!@flock($this->lock_fp, LOCK_EX)) + { + throw new \phpbb\exception\http_exception(500, 'Failure while aqcuiring locks.'); + } } return (bool) $this->lock_fp; diff --git a/phpBB/phpbb/mimetype/guesser.php b/phpBB/phpbb/mimetype/guesser.php index 8baa77089b..f8cbffe8f5 100644 --- a/phpBB/phpbb/mimetype/guesser.php +++ b/phpBB/phpbb/mimetype/guesser.php @@ -76,7 +76,7 @@ class guesser * should be used first and vice versa. usort() orders the array values * from low to high depending on what the comparison function returns * to it. Return value should be smaller than 0 if value a is smaller - * than value b. This has been reversed in the comparision function in + * than value b. This has been reversed in the comparison function in * order to sort the guessers from high to low. * Method has been set to public in order to allow proper testing. * diff --git a/phpBB/phpbb/notification/type/approve_post.php b/phpBB/phpbb/notification/type/approve_post.php index e4b111e4da..1e8afec3f9 100644 --- a/phpBB/phpbb/notification/type/approve_post.php +++ b/phpBB/phpbb/notification/type/approve_post.php @@ -94,7 +94,7 @@ class approve_post extends \phpbb\notification\type\post * * @param array $post Post data from submit_post * @param array $notify_users Notify users list - * Formated from find_users_for_notification() + * Formatted from find_users_for_notification() * @return array Whatever you want to send to create_insert_array(). */ public function pre_create_insert_array($post, $notify_users) diff --git a/phpBB/phpbb/notification/type/approve_topic.php b/phpBB/phpbb/notification/type/approve_topic.php index f8a3fdec6f..f0bbf3f6b0 100644 --- a/phpBB/phpbb/notification/type/approve_topic.php +++ b/phpBB/phpbb/notification/type/approve_topic.php @@ -94,7 +94,7 @@ class approve_topic extends \phpbb\notification\type\topic * * @param array $post Post data from submit_post * @param array $notify_users Notify users list - * Formated from find_users_for_notification() + * Formatted from find_users_for_notification() * @return array Whatever you want to send to create_insert_array(). */ public function pre_create_insert_array($post, $notify_users) diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index 77ed7f2b09..e4600add11 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -336,7 +336,7 @@ abstract class base implements \phpbb\notification\type\type_interface } /** - * Get the reference of the notifcation (fall back) + * Get the reference of the notification (fall back) * * @return string */ @@ -356,7 +356,7 @@ abstract class base implements \phpbb\notification\type\type_interface } /** - * Get the reason for the notifcation (fall back) + * Get the reason for the notification (fall back) * * @return string */ diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 254f4c07b3..f0e938d3ce 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -352,7 +352,7 @@ class post extends \phpbb\notification\type\base * * @param array $post Post data from submit_post * @param array $notify_users Notify users list - * Formated from find_users_for_notification() + * Formatted from find_users_for_notification() * @return array Whatever you want to send to create_insert_array(). */ public function pre_create_insert_array($post, $notify_users) diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php index 5c42afa8c8..2535cdaed6 100644 --- a/phpBB/phpbb/notification/type/topic.php +++ b/phpBB/phpbb/notification/type/topic.php @@ -256,7 +256,7 @@ class topic extends \phpbb\notification\type\base * * @param array $post Post data from submit_post * @param array $notify_users Notify users list - * Formated from find_users_for_notification() + * Formatted from find_users_for_notification() * @return array Whatever you want to send to create_insert_array(). */ public function pre_create_insert_array($post, $notify_users) diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php index f9f832bdda..ed77335ce5 100644 --- a/phpBB/phpbb/notification/type/type_interface.php +++ b/phpBB/phpbb/notification/type/type_interface.php @@ -170,7 +170,7 @@ interface type_interface * * @param array $type_data The type specific data * @param array $notify_users Notify users list - * Formated from find_users_for_notification() + * Formatted from find_users_for_notification() * @return array Whatever you want to send to create_insert_array(). */ public function pre_create_insert_array($type_data, $notify_users); diff --git a/phpBB/phpbb/passwords/driver/argon2i.php b/phpBB/phpbb/passwords/driver/argon2i.php new file mode 100644 index 0000000000..0ae4cea03a --- /dev/null +++ b/phpBB/phpbb/passwords/driver/argon2i.php @@ -0,0 +1,101 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\passwords\driver; + +class argon2i extends base +{ + const PREFIX = '$argon2i$'; + + /** @var int Maximum memory (in bytes) that may be used to compute the Argon2 hash */ + protected $memory_cost; + + /** @var int Number of threads to use for computing the Argon2 hash */ + protected $threads; + + /** @var int Maximum amount of time it may take to compute the Argon2 hash */ + protected $time_cost; + + /** + * Constructor of passwords driver object + * + * @param \phpbb\config\config $config phpBB config + * @param \phpbb\passwords\driver\helper $helper Password driver helper + * @param int $memory_cost Maximum memory (optional) + * @param int $threads Number of threads to use (optional) + * @param int $time_cost Maximum amount of time (optional) + */ + public function __construct(\phpbb\config\config $config, helper $helper, $memory_cost = 1024, $threads = 2, $time_cost = 2) + { + parent::__construct($config, $helper); + + // Don't allow cost factors to be below default settings + $this->memory_cost = max($memory_cost, 1024); + $this->threads = max($threads, 2); + $this->time_cost = max($time_cost, 2); + } + + /** + * {@inheritdoc} + */ + public function check($password, $hash, $user_row = []) + { + return password_verify($password, $hash); + } + + /** + * Return the options set for this driver instance + * + * @return array + */ + public function get_options() + { + return [ + 'memory_cost' => $this->memory_cost, + 'time_cost' => $this->time_cost, + 'threads' => $this->threads + ]; + } + + /** + * {@inheritdoc} + */ + public function get_prefix() + { + return self::PREFIX; + } + + /** + * {@inheritdoc} + */ + public function hash($password) + { + return password_hash($password, PASSWORD_ARGON2I, $this->get_options()); + } + + /** + * {@inheritdoc} + */ + public function is_supported() + { + return defined('PASSWORD_ARGON2I') && function_exists('password_hash') && function_exists('password_needs_rehash') && function_exists('password_verify'); + } + + /** + * {@inheritdoc} + */ + public function needs_rehash($hash) + { + return password_needs_rehash($hash, PASSWORD_ARGON2I, $this->get_options()); + } +} diff --git a/phpBB/phpbb/passwords/manager.php b/phpBB/phpbb/passwords/manager.php index fad76a9fe5..54e6dce4be 100644 --- a/phpBB/phpbb/passwords/manager.php +++ b/phpBB/phpbb/passwords/manager.php @@ -250,7 +250,7 @@ class manager /** * Check supplied password against hash and set convert_flag if password - * needs to be converted to different format (preferrably newer one) + * needs to be converted to different format (preferably newer one) * * @param string $password Password that should be checked * @param string $hash Stored hash diff --git a/phpBB/phpbb/report/report_handler.php b/phpBB/phpbb/report/report_handler.php index 854318c559..97acc1763e 100644 --- a/phpBB/phpbb/report/report_handler.php +++ b/phpBB/phpbb/report/report_handler.php @@ -51,7 +51,7 @@ abstract class report_handler implements report_handler_interface protected $report_data; /** - * Construtor + * Constructor * * @param \phpbb\db\driver\driver_interface $db * @param \phpbb\event\dispatcher_interface $dispatcher diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php index a0267d1370..5c30f9b062 100644 --- a/phpBB/phpbb/request/request.php +++ b/phpBB/phpbb/request/request.php @@ -179,7 +179,7 @@ class request implements \phpbb\request\request_interface * then specifying array("var", 1) as the name will return "a". * @param mixed $default A default value that is returned if the variable was not set. * This function will always return a value of the same type as the default. - * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters + * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * Specifies which super global should be used @@ -203,7 +203,7 @@ class request implements \phpbb\request\request_interface * then specifying array("var", 1) as the name will return "a". * @param mixed $default A default value that is returned if the variable was not set. * This function will always return a value of the same type as the default. - * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters + * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * Specifies which super global should be used @@ -395,7 +395,7 @@ class request implements \phpbb\request\request_interface * then specifying array("var", 1) as the name will return "a". * @param mixed $default A default value that is returned if the variable was not set. * This function will always return a value of the same type as the default. - * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters + * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * Specifies which super global should be used diff --git a/phpBB/phpbb/request/request_interface.php b/phpBB/phpbb/request/request_interface.php index 3bfa8bb424..54dd8cef15 100644 --- a/phpBB/phpbb/request/request_interface.php +++ b/phpBB/phpbb/request/request_interface.php @@ -54,7 +54,7 @@ interface request_interface * then specifying array("var", 1) as the name will return "a". * @param mixed $default A default value that is returned if the variable was not set. * This function will always return a value of the same type as the default. - * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters + * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global * Specifies which super global should be used diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php index 137ed7433d..4e881e5f0c 100644 --- a/phpBB/phpbb/search/fulltext_mysql.php +++ b/phpBB/phpbb/search/fulltext_mysql.php @@ -150,7 +150,7 @@ class fulltext_mysql extends \phpbb\search\base /** * Checks for correct MySQL version and stores min/max word length in the config * - * @return string|bool Language key of the error/incompatiblity occurred + * @return string|bool Language key of the error/incompatibility occurred */ public function init() { diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index c83de75eed..ecebbd37cd 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -351,7 +351,7 @@ class fulltext_native extends \phpbb\search\base $this->db->sql_freeresult($result); } - // Handle +, - without preceeding whitespace character + // Handle +, - without preceding whitespace character $match = array('#(\S)\+#', '#(\S)-#'); $replace = array('$1 +', '$1 +'); diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index 2f387e791e..6241f21fcf 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -173,7 +173,7 @@ class fulltext_postgres extends \phpbb\search\base /** * Checks for correct PostgreSQL version and stores min/max word length in the config * - * @return string|bool Language key of the error/incompatiblity occurred + * @return string|bool Language key of the error/incompatibility occurred */ public function init() { diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index 2c2eb84dc7..d8331d3815 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -18,7 +18,7 @@ define('SPHINX_CONNECT_RETRIES', 3); define('SPHINX_CONNECT_WAIT_TIME', 300); /** -* Fulltext search based on the sphinx search deamon +* Fulltext search based on the sphinx search daemon */ class fulltext_sphinx { @@ -210,7 +210,7 @@ class fulltext_sphinx /** * Checks permissions and paths, if everything is correct it generates the config file * - * @return string|bool Language key of the error/incompatiblity encountered, or false if successful + * @return string|bool Language key of the error/incompatibility encountered, or false if successful */ public function init() { diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 31f32af7c4..38e40ba29e 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -250,7 +250,7 @@ class session $ips = explode(' ', $this->forwarded_for); foreach ($ips as $ip) { - // check IPv4 first, the IPv6 is hopefully only going to be used very seldomly + // check IPv4 first, the IPv6 is hopefully only going to be used very seldom if (!empty($ip) && !preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip)) { // contains invalid data, don't use the forwarded for header @@ -478,8 +478,8 @@ class session } else { - // Added logging temporarly to help debug bugs... - if (defined('DEBUG') && $this->data['user_id'] != ANONYMOUS) + // Added logging temporarily to help debug bugs... + if ($phpbb_container->getParameter('session.log_errors') && $this->data['user_id'] != ANONYMOUS) { if ($referer_valid) { @@ -1336,7 +1336,7 @@ class session * Only IPv4 (rbldns does not support AAAA records/IPv6 lookups) * * @author satmd (from the php manual) - * @param string $mode register/post - spamcop for example is ommitted for posting + * @param string $mode register/post - spamcop for example is omitted for posting * @param string|false $ip the IPv4 address to check * * @return false if ip is not blacklisted, else an array([checked server], [lookup]) @@ -1395,7 +1395,7 @@ class session /** * Check if URI is blacklisted - * This should be called only where absolutly necessary, for example on the submitted website field + * This should be called only where absolutely necessary, for example on the submitted website field * This function is not in use at the moment and is only included for testing purposes, it may not work at all! * This means it is untested at the moment and therefore commented out * diff --git a/phpBB/phpbb/template/asset.php b/phpBB/phpbb/template/asset.php index cb00f16549..d6b46234f0 100644 --- a/phpBB/phpbb/template/asset.php +++ b/phpBB/phpbb/template/asset.php @@ -45,13 +45,6 @@ class asset */ public function set_url($url) { - if (version_compare(PHP_VERSION, '5.4.7') < 0 && substr($url, 0, 2) === '//') - { - // Workaround for PHP 5.4.6 and older bug #62844 - add fake scheme and then remove it - $this->components = parse_url('http:' . $url); - $this->components['scheme'] = ''; - return; - } $this->components = parse_url($url); } diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php index 202e29ce00..f059c327c1 100644 --- a/phpBB/phpbb/template/context.php +++ b/phpBB/phpbb/template/context.php @@ -87,7 +87,7 @@ class context } /** - * Retreive a single scalar value from a single key. + * Retrieve a single scalar value from a single key. * * @param string $varname Variable name * @return mixed Variable value, or null if not set @@ -149,7 +149,7 @@ class context { // If the key name is lowercase and the data is an array, // it could be a template loop. So we set the S_NUM_ROWS there - // aswell. + // as well. if ($sub_block_name === strtolower($sub_block_name) && is_array($sub_block)) { $this->set_num_rows($sub_block); diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php index df83d5bc43..6634c28d02 100644 --- a/phpBB/phpbb/template/template.php +++ b/phpBB/phpbb/template/template.php @@ -136,7 +136,7 @@ interface template public function retrieve_vars(array $vararray); /** - * Retreive a single scalar value from a single key. + * Retrieve a single scalar value from a single key. * * @param string $varname Variable name * @return mixed Variable value, or null if not set diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index f6f8e03ca2..c5b3db1aaf 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -18,6 +18,9 @@ class extension extends \Twig_Extension /** @var \phpbb\template\context */ protected $context; + /** @var \phpbb\template\twig\environment */ + protected $environment; + /** @var \phpbb\language\language */ protected $language; @@ -25,12 +28,14 @@ class extension extends \Twig_Extension * Constructor * * @param \phpbb\template\context $context + * @param \phpbb\template\twig\environment $environment * @param \phpbb\language\language $language * @return \phpbb\template\twig\extension */ - public function __construct(\phpbb\template\context $context, $language) + public function __construct(\phpbb\template\context $context, \phpbb\template\twig\environment $environment, $language) { $this->context = $context; + $this->environment = $environment; $this->language = $language; } @@ -56,9 +61,9 @@ class extension extends \Twig_Extension new \phpbb\template\twig\tokenparser\includeparser, new \phpbb\template\twig\tokenparser\includejs, new \phpbb\template\twig\tokenparser\includecss, - new \phpbb\template\twig\tokenparser\event, - new \phpbb\template\twig\tokenparser\includephp, - new \phpbb\template\twig\tokenparser\php, + new \phpbb\template\twig\tokenparser\event($this->environment), + new \phpbb\template\twig\tokenparser\includephp($this->environment), + new \phpbb\template\twig\tokenparser\php($this->environment), ); } @@ -85,6 +90,7 @@ class extension extends \Twig_Extension { return array( new \Twig_SimpleFunction('lang', array($this, 'lang')), + new \Twig_SimpleFunction('lang_defined', array($this, 'lang_defined')), ); } @@ -136,7 +142,7 @@ class extension extends \Twig_Extension * * @return mixed The sliced variable */ - function loop_subset(\Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false) + public function loop_subset(\Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false) { // We do almost the same thing as Twig's slice (array_slice), except when $end is positive if ($end >= 1) @@ -165,7 +171,7 @@ class extension extends \Twig_Extension * * @return string */ - function lang() + public function lang() { $args = func_get_args(); $key = $args[0]; @@ -182,4 +188,14 @@ class extension extends \Twig_Extension return call_user_func_array(array($this->language, 'lang'), $args); } + + /** + * Check if a language variable exists + * + * @return bool + */ + public function lang_defined($key) + { + return call_user_func_array([$this->language, 'is_set'], [$key]); + } } diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index d0bcfa615e..6615a46067 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -15,20 +15,10 @@ namespace phpbb\template\twig; class lexer extends \Twig_Lexer { - public function set_environment(\Twig_Environment $env) + public function tokenize(\Twig_Source $source) { - $this->env = $env; - } - - public function tokenize($code, $filename = null) - { - // Handle \Twig_Source format input - if ($code instanceof \Twig_Source) - { - $source = $code; - $code = $source->getCode(); - $filename = $source->getName(); - } + $code = $source->getCode(); + $filename = $source->getName(); // Our phpBB tags // Commented out tokens are handled separately from the main replace diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php index c13e3ee298..0f193dbe59 100644 --- a/phpBB/phpbb/template/twig/loader.php +++ b/phpBB/phpbb/template/twig/loader.php @@ -35,7 +35,7 @@ class loader extends \Twig_Loader_Filesystem { $this->filesystem = $filesystem; - parent::__construct($paths, $this->filesystem->realpath(dirname(__FILE__))); + parent::__construct($paths, __DIR__); } /** @@ -116,7 +116,7 @@ class loader extends \Twig_Loader_Filesystem * Override for Twig_Loader_Filesystem::findTemplate to add support * for loading from safe directories. */ - protected function findTemplate($name) + protected function findTemplate($name, $throw = true) { $name = (string) $name; @@ -132,12 +132,12 @@ class loader extends \Twig_Loader_Filesystem // First, find the template name. The override above of validateName // causes the validateName process to be skipped for this call - $file = parent::findTemplate($name); + $file = parent::findTemplate($name, $throw); try { // Try validating the name (which may throw an exception) - parent::validateName($name); + $this->validateName($name); } catch (\Twig_Error_Loader $e) { diff --git a/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php index ddbd151d20..1c51596916 100644 --- a/phpBB/phpbb/template/twig/node/definenode.php +++ b/phpBB/phpbb/template/twig/node/definenode.php @@ -16,7 +16,7 @@ namespace phpbb\template\twig\node; class definenode extends \Twig_Node { - public function __construct($capture, \Twig_NodeInterface $name, \Twig_NodeInterface $value, $lineno, $tag = null) + public function __construct($capture, \Twig_Node $name, \Twig_Node $value, $lineno, $tag = null) { parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag); } diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php index 12034b7820..69bfd58803 100644 --- a/phpBB/phpbb/template/twig/node/includeasset.php +++ b/phpBB/phpbb/template/twig/node/includeasset.php @@ -15,15 +15,11 @@ namespace phpbb\template\twig\node; abstract class includeasset extends \Twig_Node { - /** @var \Twig_Environment */ - protected $environment; - - public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null) + public function __construct(\Twig_Node_Expression $expr, $lineno, $tag = null) { - $this->environment = $environment; - parent::__construct(array('expr' => $expr), array(), $lineno, $tag); } + /** * Compiles the node to PHP. * @@ -33,20 +29,18 @@ abstract class includeasset extends \Twig_Node { $compiler->addDebugInfo($this); - $config = $this->environment->get_phpbb_config(); - $compiler ->write("\$asset_file = ") ->subcompile($this->getNode('expr')) ->raw(";\n") - ->write("\$asset = new \phpbb\\template\\asset(\$asset_file, \$this->getEnvironment()->get_path_helper(), \$this->getEnvironment()->get_filesystem());\n") + ->write("\$asset = new \phpbb\\template\\asset(\$asset_file, \$this->env->get_path_helper(), \$this->env->get_filesystem());\n") ->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n") ->indent() ->write("\$asset_path = \$asset->get_path();") - ->write("\$local_file = \$this->getEnvironment()->get_phpbb_root_path() . \$asset_path;\n") + ->write("\$local_file = \$this->env->get_phpbb_root_path() . \$asset_path;\n") ->write("if (!file_exists(\$local_file)) {\n") ->indent() - ->write("\$local_file = \$this->getEnvironment()->findTemplate(\$asset_path);\n") + ->write("\$local_file = \$this->env->findTemplate(\$asset_path);\n") ->write("\$asset->set_path(\$local_file, true);\n") ->outdent() ->write("}\n") @@ -55,10 +49,10 @@ abstract class includeasset extends \Twig_Node ->write("\n") ->write("if (\$asset->is_relative()) {\n") ->indent() - ->write("\$asset->add_assets_version('{$config['assets_version']}');\n") + ->write("\$asset->add_assets_version(\$this->env->get_phpbb_config()['assets_version']);\n") ->outdent() ->write("}\n") - ->write("\$this->getEnvironment()->get_assets_bag()->add_{$this->get_setters_name()}(\$asset);") + ->write("\$this->env->get_assets_bag()->add_{$this->get_setters_name()}(\$asset);") ; } diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index 76182c2f84..0cf95abe99 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -63,15 +63,15 @@ class includephp extends \Twig_Node // Absolute path specified ->write("require(\$location);\n") ->outdent() - ->write("} else if (file_exists(\$this->getEnvironment()->get_phpbb_root_path() . \$location)) {\n") + ->write("} else if (file_exists(\$this->env->get_phpbb_root_path() . \$location)) {\n") ->indent() // PHP file relative to phpbb_root_path - ->write("require(\$this->getEnvironment()->get_phpbb_root_path() . \$location);\n") + ->write("require(\$this->env->get_phpbb_root_path() . \$location);\n") ->outdent() ->write("} else {\n") ->indent() // Local path (behaves like INCLUDE) - ->write("require(\$this->getEnvironment()->getLoader()->getCacheKey(\$location));\n") + ->write("require(\$this->env->getLoader()->getCacheKey(\$location));\n") ->outdent() ->write("}\n") ; diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index b755836ccd..6285091e94 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -21,7 +21,7 @@ class defineparser extends \Twig_TokenParser * * @param \Twig_Token $token A Twig_Token instance * - * @return \Twig_NodeInterface A Twig_NodeInterface instance + * @return \Twig_Node A Twig_Node instance * @throws \Twig_Error_Syntax * @throws \phpbb\template\twig\node\definenode */ @@ -41,7 +41,7 @@ class defineparser extends \Twig_TokenParser { // This would happen if someone improperly formed their DEFINE syntax // e.g. <!-- DEFINE $VAR = foo --> - throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getFilename()); + throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getStream()->getSourceContext()->getPath()); } $stream->expect(\Twig_Token::BLOCK_END_TYPE); diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php index f73ef4ae25..92ecff4a74 100644 --- a/phpBB/phpbb/template/twig/tokenparser/event.php +++ b/phpBB/phpbb/template/twig/tokenparser/event.php @@ -15,12 +15,25 @@ namespace phpbb\template\twig\tokenparser; class event extends \Twig_TokenParser { + /** @var \phpbb\template\twig\environment */ + protected $environment; + + /** + * Constructor + * + * @param \phpbb\template\twig\environment $environment + */ + public function __construct(\phpbb\template\twig\environment $environment) + { + $this->environment = $environment; + } + /** * Parses a token and returns a node. * * @param \Twig_Token $token A Twig_Token instance * - * @return \Twig_NodeInterface A Twig_NodeInterface instance + * @return \Twig_Node A Twig_Node instance */ public function parse(\Twig_Token $token) { @@ -29,7 +42,7 @@ class event extends \Twig_TokenParser $stream = $this->parser->getStream(); $stream->expect(\Twig_Token::BLOCK_END_TYPE); - return new \phpbb\template\twig\node\event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag()); + return new \phpbb\template\twig\node\event($expr, $this->environment, $token->getLine(), $this->getTag()); } /** diff --git a/phpBB/phpbb/template/twig/tokenparser/includecss.php b/phpBB/phpbb/template/twig/tokenparser/includecss.php index 1f30811754..f7e55a46fb 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includecss.php +++ b/phpBB/phpbb/template/twig/tokenparser/includecss.php @@ -20,7 +20,7 @@ class includecss extends \Twig_TokenParser * * @param \Twig_Token $token A Twig_Token instance * - * @return \Twig_NodeInterface A Twig_NodeInterface instance + * @return \Twig_Node A Twig_Node instance */ public function parse(\Twig_Token $token) { @@ -29,7 +29,7 @@ class includecss extends \Twig_TokenParser $stream = $this->parser->getStream(); $stream->expect(\Twig_Token::BLOCK_END_TYPE); - return new \phpbb\template\twig\node\includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag()); + return new \phpbb\template\twig\node\includecss($expr, $token->getLine(), $this->getTag()); } /** diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php index 4b67d2c468..598ea0a70d 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includejs.php +++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php @@ -20,7 +20,7 @@ class includejs extends \Twig_TokenParser * * @param \Twig_Token $token A Twig_Token instance * - * @return \Twig_NodeInterface A Twig_NodeInterface instance + * @return \Twig_Node A Twig_Node instance */ public function parse(\Twig_Token $token) { @@ -29,7 +29,7 @@ class includejs extends \Twig_TokenParser $stream = $this->parser->getStream(); $stream->expect(\Twig_Token::BLOCK_END_TYPE); - return new \phpbb\template\twig\node\includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag()); + return new \phpbb\template\twig\node\includejs($expr, $token->getLine(), $this->getTag()); } /** diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php index aa7236aaa6..2fba4ac4c4 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includeparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php @@ -21,7 +21,7 @@ class includeparser extends \Twig_TokenParser_Include * * @param \Twig_Token $token A Twig_Token instance * - * @return \Twig_NodeInterface A Twig_NodeInterface instance + * @return \Twig_Node A Twig_Node instance */ public function parse(\Twig_Token $token) { diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index 3992636f8c..2fdf396452 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -16,12 +16,25 @@ namespace phpbb\template\twig\tokenparser; class includephp extends \Twig_TokenParser { + /** @var \phpbb\template\twig\environment */ + protected $environment; + + /** + * Constructor + * + * @param \phpbb\template\twig\environment $environment + */ + public function __construct(\phpbb\template\twig\environment $environment) + { + $this->environment = $environment; + } + /** * Parses a token and returns a node. * * @param \Twig_Token $token A Twig_Token instance * - * @return \Twig_NodeInterface A Twig_NodeInterface instance + * @return \Twig_Node A Twig_Node instance */ public function parse(\Twig_Token $token) { @@ -40,7 +53,7 @@ class includephp extends \Twig_TokenParser $stream->expect(\Twig_Token::BLOCK_END_TYPE); - return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $token->getLine(), $ignoreMissing, $this->getTag()); + return new \phpbb\template\twig\node\includephp($expr, $this->environment, $token->getLine(), $ignoreMissing, $this->getTag()); } /** diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php index f11ce35896..3007912b47 100644 --- a/phpBB/phpbb/template/twig/tokenparser/php.php +++ b/phpBB/phpbb/template/twig/tokenparser/php.php @@ -15,12 +15,25 @@ namespace phpbb\template\twig\tokenparser; class php extends \Twig_TokenParser { + /** @var \phpbb\template\twig\environment */ + protected $environment; + + /** + * Constructor + * + * @param \phpbb\template\twig\environment $environment + */ + public function __construct(\phpbb\template\twig\environment $environment) + { + $this->environment = $environment; + } + /** * Parses a token and returns a node. * * @param \Twig_Token $token A Twig_Token instance * - * @return \Twig_NodeInterface A Twig_NodeInterface instance + * @return \Twig_Node A Twig_Node instance */ public function parse(\Twig_Token $token) { @@ -32,7 +45,7 @@ class php extends \Twig_TokenParser $stream->expect(\Twig_Token::BLOCK_END_TYPE); - return new \phpbb\template\twig\node\php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag()); + return new \phpbb\template\twig\node\php($body, $this->environment, $token->getLine(), $this->getTag()); } public function decideEnd(\Twig_Token $token) diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 7363290e11..5a06becb52 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -110,7 +110,7 @@ class user extends \phpbb\session function setup($lang_set = false, $style_id = false) { global $db, $request, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache; - global $phpbb_dispatcher; + global $phpbb_dispatcher, $phpbb_container; $this->language->set_default_language($config['default_lang']); @@ -327,8 +327,8 @@ class user extends \phpbb\session } // Disable board if the install/ directory is still present - // For the brave development army we do not care about this, else we need to comment out this everytime we develop locally - if (!defined('DEBUG') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) + // For the brave development army we do not care about this, else we need to comment out this every time we develop locally + if (!$phpbb_container->getParameter('allow_install_dir') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) { // Adjust the message slightly according to the permissions if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) @@ -446,7 +446,7 @@ class user extends \phpbb\session * @return int|bool The plural-case we need to use for the number plural-rule combination, false if $force_rule * was invalid. * - * @deprecated: 3.2.0-dev (To be removed: 3.3.0) + * @deprecated: 3.2.0-dev (To be removed: 4.0.0) */ function get_plural_form($number, $force_rule = false) { @@ -457,8 +457,8 @@ class user extends \phpbb\session * Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion) * * @param mixed $lang_set specifies the language entries to include - * @param bool $use_db internal variable for recursion, do not use @deprecated 3.2.0-dev (To be removed: 3.3.0) - * @param bool $use_help internal variable for recursion, do not use @deprecated 3.2.0-dev (To be removed: 3.3.0) + * @param bool $use_db internal variable for recursion, do not use @deprecated 3.2.0-dev (To be removed: 4.0.0) + * @param bool $use_help internal variable for recursion, do not use @deprecated 3.2.0-dev (To be removed: 4.0.0) * @param string $ext_name The extension to load language from, or empty for core files * * Examples: @@ -473,7 +473,7 @@ class user extends \phpbb\session * Note: $use_db and $use_help should be removed. The old function was kept for BC purposes, * so the BC logic is handled here. * - * @deprecated: 3.2.0-dev (To be removed: 3.3.0) + * @deprecated: 3.2.0-dev (To be removed: 4.0.0) */ function add_lang($lang_set, $use_db = false, $use_help = false, $ext_name = '') { @@ -514,7 +514,7 @@ class user extends \phpbb\session /** * BC function for loading language files * - * @deprecated 3.2.0-dev (To be removed: 3.3.0) + * @deprecated 3.2.0-dev (To be removed: 4.0.0) */ private function set_lang($lang_set, $use_help, $ext_name) { @@ -550,7 +550,7 @@ class user extends \phpbb\session * * Note: $use_db and $use_help should be removed. Kept for BC purposes. * - * @deprecated: 3.2.0-dev (To be removed: 3.3.0) + * @deprecated: 3.2.0-dev (To be removed: 4.0.0) */ function add_lang_ext($ext_name, $lang_set, $use_db = false, $use_help = false) { @@ -752,7 +752,7 @@ class user extends \phpbb\session } /** - * Funtion to make the user leave the NEWLY_REGISTERED system group. + * Function to make the user leave the NEWLY_REGISTERED system group. * @access public */ function leave_newly_registered() diff --git a/phpBB/phpbb/user_loader.php b/phpBB/phpbb/user_loader.php index 9297450f3e..3dacf07ff5 100644 --- a/phpBB/phpbb/user_loader.php +++ b/phpBB/phpbb/user_loader.php @@ -123,7 +123,7 @@ class user_loader /** * Get a user row from our users cache * - * @param int $user_id User ID of the user you want to retreive + * @param int $user_id User ID of the user you want to retrieve * @param bool $query Should we query the database if this user has not yet been loaded? * Typically this should be left as false and you should make sure * you load users ahead of time with load_users() @@ -150,7 +150,7 @@ class user_loader /** * Get username * - * @param int $user_id User ID of the user you want to retreive the username for + * @param int $user_id User ID of the user you want to retrieve the username for * @param string $mode The mode to load (same as get_username_string). One of the following: * profile (for getting an url to the profile) * username (for obtaining the username) @@ -204,7 +204,7 @@ class user_loader /** * Get rank * - * @param int $user_id User ID of the user you want to retreive the rank for + * @param int $user_id User ID of the user you want to retrieve the rank for * @param bool $query Should we query the database if this user has not yet been loaded? * Typically this should be left as false and you should make sure * you load users ahead of time with load_users() diff --git a/phpBB/posting.php b/phpBB/posting.php index 75085a5635..eba4d9f0a9 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -40,7 +40,7 @@ $load = (isset($_POST['load'])) ? true : false; $confirm = $request->is_set_post('confirm'); $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false; -$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load || $preview); +$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || $save || $load || $preview); $submit = $request->is_set_post('post') && !$refresh && !$preview; $mode = $request->variable('mode', ''); diff --git a/phpBB/report.php b/phpBB/report.php index bb26b972aa..d0d7b3776a 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -35,7 +35,7 @@ $controller_helper = $phpbb_container->get('controller.helper'); $response = new RedirectResponse( $controller_helper->route($redirect_route_name, array( 'id' => ($pm_id === 0) ? $post_id : $pm_id, - )), + ), false), 301 ); $response->send(); diff --git a/phpBB/search.php b/phpBB/search.php index 97a8f320d4..4f4a14109b 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -129,6 +129,11 @@ $phpbb_content_visibility = $phpbb_container->get('content.visibility'); /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); +$template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $user->lang('SEARCH'), + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}search.$phpEx"), +)); + /** * This event allows you to alter the above parameters, such as keywords and submit * @@ -511,6 +516,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) $l_search_title = $user->lang['SEARCH_SELF']; break; } + + $template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $l_search_title, + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}search.$phpEx", "search_id=$search_id"), + )); } /** diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg index 4485b17945..cdf67d5a0c 100644 --- a/phpBB/styles/prosilver/style.cfg +++ b/phpBB/styles/prosilver/style.cfg @@ -21,8 +21,8 @@ # General Information about this style name = prosilver copyright = © phpBB Limited, 2007 -style_version = 3.2.7 -phpbb_version = 3.2.7 +style_version = 3.3.0-b1 +phpbb_version = 3.3.0-b1 # Defining a different template bitfield # template_bitfield = //g= diff --git a/phpBB/styles/prosilver/template/attachment.html b/phpBB/styles/prosilver/template/attachment.html index 0978d9189e..49c49f52a0 100644 --- a/phpBB/styles/prosilver/template/attachment.html +++ b/phpBB/styles/prosilver/template/attachment.html @@ -29,19 +29,6 @@ </dl> <!-- ENDIF --> - <!-- IF _file.S_FLASH_FILE --> - <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{_file.WIDTH}" height="{_file.HEIGHT}"> - <param name="movie" value="{_file.U_VIEW_LINK}" /> - <param name="play" value="true" /> - <param name="loop" value="true" /> - <param name="quality" value="high" /> - <param name="allowScriptAccess" value="never" /> - <param name="allowNetworking" value="internal" /> - <embed src="{_file.U_VIEW_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never" allownetworking="internal"></embed> - </object> - <p><a href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a> [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</p> - <!-- ENDIF --> - <!-- EVENT attachment_file_append --> <!-- ENDIF --> <!-- END _file --> diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 3f28f8a326..2e393657e8 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -460,7 +460,7 @@ function parseDocument($container) { $linksLast = $linksNotSkip.filter(filterLast), // The items that will be hidden last persistent = $this.attr('id') === 'nav-main', // Does this list already have a menu (such as quick-links)? html = '<li class="responsive-menu hidden"><a href="javascript:void(0);" class="js-responsive-menu-link responsive-menu-link"><i class="icon fa-bars fa-fw" aria-hidden="true"></i></a><div class="dropdown"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>', - slack = 3; // Vertical slack space (in pixels). Determines how sensitive the script is in determining whether a line-break has occured. + slack = 3; // Vertical slack space (in pixels). Determines how sensitive the script is in determining whether a line-break has occurred. // Add a hidden drop-down menu to each links list (except those that already have one) if (!persistent) { diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html index dc29285922..9584aaf415 100644 --- a/phpBB/styles/prosilver/template/navbar_header.html +++ b/phpBB/styles/prosilver/template/navbar_header.html @@ -189,8 +189,10 @@ <span class="crumb" {$MICRODATA}><a href="{U_INDEX}" itemtype="https://schema.org/Thing" itemprop="item" accesskey="h" data-navbar-reference="index"><!-- IF not U_SITE_HOME --><i class="icon fa-home fa-fw"></i><!-- ENDIF --><span itemprop="name">{L_INDEX}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span> <!-- BEGIN navlinks --> + {% set NAVLINK_NAME = navlinks.BREADCRUMB_NAME | default(navlinks.FORUM_NAME) %} + {% set NAVLINK_LINK = navlinks.U_BREADCRUMB | default(navlinks.U_VIEW_FORUM) %} <!-- EVENT overall_header_navlink_prepend --> - <span class="crumb" {$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{navlinks.U_VIEW_FORUM}" itemtype="https://schema.org/Thing" itemprop="item"><span itemprop="name">{navlinks.FORUM_NAME}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span> + <span class="crumb" {$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{{ NAVLINK_LINK }}" itemtype="https://schema.org/Thing" itemprop="item"><span itemprop="name">{{ NAVLINK_NAME }}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span> <!-- EVENT overall_header_navlink_append --> <!-- END navlinks --> <!-- EVENT overall_header_breadcrumb_append --> diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html index 122afdf978..fb395fb291 100644 --- a/phpBB/styles/prosilver/template/posting_buttons.html +++ b/phpBB/styles/prosilver/template/posting_buttons.html @@ -52,7 +52,7 @@ <div id="colour_palette" style="display: none;"> <dl style="clear: left;"> <dt><label>{L_FONT_COLOR}{L_COLON}</label></dt> - <dd id="color_palette_placeholder" class="color_palette_placeholder" data-orientation="h" data-height="12" data-width="15" data-bbcode="true"></dd> + <dd id="color_palette_placeholder" class="color_palette_placeholder" data-color-palette="h" data-height="12" data-width="15" data-bbcode="true"></dd> </dl> </div> diff --git a/phpBB/styles/prosilver/template/posting_layout.html b/phpBB/styles/prosilver/template/posting_layout.html index bca9195f0e..7c9deb5369 100644 --- a/phpBB/styles/prosilver/template/posting_layout.html +++ b/phpBB/styles/prosilver/template/posting_layout.html @@ -38,27 +38,6 @@ <!-- IF S_POST_REVIEW --><!-- INCLUDE posting_review.html --><!-- ENDIF --> -<!-- IF S_UNGLOBALISE --> - <div class="panel bg3"> - <div class="inner"> - <fieldset class="fields1"> - <h2>{L_SELECT_DESTINATION_FORUM}</h2> - <p>{L_UNGLOBALISE_EXPLAIN}</p> - <dl> - <dt><label for="to_forum_id">{L_MOVE}{L_COLON}</label></dt> - <dd><select id="to_forum_id" name="to_forum_id">{S_FORUM_SELECT}</select></dd> - </dl> - - <dl> - <dt> </dt> - <dd><input class="button1" type="submit" name="post" value="{L_CONFIRM}" /> <input class="button2" type="submit" name="cancel_unglobalise" value="{L_CANCEL}" /></dd> - </dl> - </fieldset> - - </div> - </div> -<!-- ENDIF --> - <!-- IF S_DISPLAY_PREVIEW --><!-- INCLUDE posting_preview.html --><!-- ENDIF --> <div class="panel" id="postingbox"> diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html b/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html index 63a734ea7d..666950e0ae 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options_upload.html @@ -1,6 +1,6 @@ <dl> <dt><label for="avatar_upload_file">{L_UPLOAD_AVATAR_FILE}{L_COLON}</label></dt> - <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_UPLOAD_SIZE}" /><input type="file" name="avatar_upload_file" id="avatar_upload_file" class="inputbox autowidth" /></dd> + <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_UPLOAD_SIZE}" /><input type="file" name="avatar_upload_file" id="avatar_upload_file" class="inputbox autowidth" accept="{{ AVATAR_ALLOWED_EXTENSIONS }}" /></dd> </dl> <!-- IF S_UPLOAD_AVATAR_URL --> diff --git a/phpBB/styles/prosilver/template/ucp_groups_manage.html b/phpBB/styles/prosilver/template/ucp_groups_manage.html index f2b4f003e0..adc8c614e6 100644 --- a/phpBB/styles/prosilver/template/ucp_groups_manage.html +++ b/phpBB/styles/prosilver/template/ucp_groups_manage.html @@ -58,7 +58,7 @@ <input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" class="inputbox narrow" /> <span style="background-color: #{GROUP_COLOUR};"> </span> [ <a href="#" id="color_palette_toggle">{L_COLOUR_SWATCH}</a> ] - <div id="color_palette_placeholder" class="color_palette_placeholder hidden" data-orientation="h" data-height="12" data-width="15" data-target="#group_colour"></div> + <div id="color_palette_placeholder" class="color_palette_placeholder hidden" data-color-palette="h" data-height="12" data-width="15" data-target="#group_colour"></div> </dd> </dl> <dl> diff --git a/phpBB/styles/prosilver/template/ucp_register.html b/phpBB/styles/prosilver/template/ucp_register.html index bf39990c35..ee8aa319bc 100644 --- a/phpBB/styles/prosilver/template/ucp_register.html +++ b/phpBB/styles/prosilver/template/ucp_register.html @@ -12,6 +12,17 @@ } </script> +<div class="panel"> + <div class="inner"> + + <h2>{{ SITENAME }} - {{ lang('OAUTH_REGISTRATION') }}</h2> + + {% if PROVIDER_TEMPLATE_FILE %} + {% include PROVIDER_TEMPLATE_FILE %} + {% endif %} + </div> +</div> + <form id="register" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}> <div class="panel"> diff --git a/phpBB/styles/prosilver/theme/icons.css b/phpBB/styles/prosilver/theme/icons.css index 6643f12d06..3ac598486c 100644 --- a/phpBB/styles/prosilver/theme/icons.css +++ b/phpBB/styles/prosilver/theme/icons.css @@ -5,7 +5,7 @@ /* Global module setup --------------------------------*/ -/* Renamed version of .fa class for agnostic useage of icon fonts. +/* Renamed version of .fa class for agnostic usage of icon fonts. * Just change the name of the font after the 14/1 to the name of * the font you wish to use. */ diff --git a/phpBB/styles/prosilver/theme/print.css b/phpBB/styles/prosilver/theme/print.css index 9445279773..ee916dce51 100644 --- a/phpBB/styles/prosilver/theme/print.css +++ b/phpBB/styles/prosilver/theme/print.css @@ -90,7 +90,7 @@ hr { font-size: 75%; } -/* Dont want to print url for names or titles in content area */ +/* Don't want to print url for names or titles in content area */ .postbody .author a:link, .postbody .author a:visited, html>body .postbody .author a:link:after, html>body .postbody .author a:visited:after, diff --git a/phpBB/styles/prosilver/theme/stylesheet.css b/phpBB/styles/prosilver/theme/stylesheet.css index 45eb5b6fc9..c402d563c6 100644 --- a/phpBB/styles/prosilver/theme/stylesheet.css +++ b/phpBB/styles/prosilver/theme/stylesheet.css @@ -1,21 +1,21 @@ /* phpBB3 Style Sheet -------------------------------------------------------------- - Style name: prosilver (the default phpBB 3.2.x style) + Style name: prosilver (the default phpBB 3.3.x style) Based on style: Original author: Tom Beddard ( http://www.subblue.com/ ) Modified by: phpBB Limited ( https://www.phpbb.com/ ) -------------------------------------------------------------- */ -@import url("normalize.css?v=3.2"); -@import url("base.css?v=3.2"); -@import url("utilities.css?v=3.2"); -@import url("common.css?v=3.2"); -@import url("links.css?v=3.2"); -@import url("content.css?v=3.2"); -@import url("buttons.css?v=3.2"); -@import url("cp.css?v=3.2"); -@import url("forms.css?v=3.2"); -@import url("icons.css?v=3.2"); -@import url("colours.css?v=3.2"); -@import url("responsive.css?v=3.2"); +@import url("normalize.css?v=3.3"); +@import url("base.css?v=3.3"); +@import url("utilities.css?v=3.3"); +@import url("common.css?v=3.3"); +@import url("links.css?v=3.3"); +@import url("content.css?v=3.3"); +@import url("buttons.css?v=3.3"); +@import url("cp.css?v=3.3"); +@import url("forms.css?v=3.3"); +@import url("icons.css?v=3.3"); +@import url("colours.css?v=3.3"); +@import url("responsive.css?v=3.3"); diff --git a/phpBB/ucp.php b/phpBB/ucp.php index 96a3efea97..c60d9930fc 100644 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -393,6 +393,11 @@ if (!$config['allow_topic_notify'] && !$config['allow_forum_notify']) $vars = array('module', 'id', 'mode'); extract($phpbb_dispatcher->trigger_event('core.ucp_display_module_before', compact($vars))); +$template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $user->lang('UCP'), + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}ucp.$phpEx"), +)); + // Select the active module $module->set_active($id, $mode); diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index d5ddb0ba13..1b28750a0b 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -487,6 +487,11 @@ $start = $pagination->validate_start($start, $config['topics_per_page'], $counte $base_url = append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir"); $pagination->generate_template_pagination($base_url, 'pagination', 'start', $counter, $config['topics_per_page'], $start); +$template->assign_block_vars('navlinks', array( + 'BREADCRUMB_NAME' => $user->lang('WHO_IS_ONLINE'), + 'U_BREADCRUMB' => append_sid("{$phpbb_root_path}viewonline.$phpEx"), +)); + // Send data to template $template->assign_vars(array( 'TOTAL_REGISTERED_USERS_ONLINE' => $user->lang('REG_USERS_ONLINE', (int) $logged_visible_online, $user->lang('HIDDEN_USERS_ONLINE', (int) $logged_hidden_online)), diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c6e539b7ba..e5b074cf16 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,14 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="true" - backupStaticAttributes="true" + backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" bootstrap="tests/bootstrap.php" > <testsuites> @@ -25,8 +24,7 @@ <file>./tests/lint_test.php</file> </testsuite> <testsuite name="phpBB UI Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" - phpVersionOperator=">=">./tests/ui</directory> + <directory suffix="_test.php">./tests/ui</directory> </testsuite> </testsuites> diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md index 12ae7fa687..56f2818078 100644 --- a/tests/RUNNING_TESTS.md +++ b/tests/RUNNING_TESTS.md @@ -52,7 +52,7 @@ By default all tests requiring a database connection will use sqlite. If you do not have sqlite installed the tests will be skipped. If you wish to run the tests on a different database you have to create a test_config.php file within your tests directory following the same format as phpBB's config.php. Testing -makes use of a seperate database defined in this config file and before running +makes use of a separate database defined in this config file and before running the tests each time this database is deleted. An example for mysqli can be found below. More information on configuration options can be found on the wiki (see below). diff --git a/tests/acp_board/select_auth_method_test.php b/tests/acp_board/select_auth_method_test.php index 16e5954c64..3cb8ea7cd6 100644 --- a/tests/acp_board/select_auth_method_test.php +++ b/tests/acp_board/select_auth_method_test.php @@ -27,7 +27,7 @@ class phpbb_acp_board_select_auth_method_test extends phpbb_test_case ); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/attachment/delete_test.php b/tests/attachment/delete_test.php index f1835dd37a..59669c87e9 100644 --- a/tests/attachment/delete_test.php +++ b/tests/attachment/delete_test.php @@ -24,6 +24,9 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case /** @var \phpbb\filesystem\filesystem */ protected $filesystem; + /** @var \phpbb\event\dispatcher_interface */ + protected $dispatcher; + /** @var \phpbb\attachment\resync */ protected $resync; @@ -37,9 +40,9 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/resync.xml'); } - public function setUp() + public function setUp(): void { - global $db, $phpbb_root_path; + global $phpbb_root_path; parent::setUp(); @@ -47,7 +50,7 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case $this->db = $this->new_dbal(); $db = $this->db; $this->resync = new \phpbb\attachment\resync($this->db); - $this->filesystem = $this->getMock('\phpbb\filesystem\filesystem', array('remove', 'exists')); + $this->filesystem = $this->createMock('\phpbb\filesystem\filesystem', array('remove', 'exists')); $this->filesystem->expects($this->any()) ->method('remove') ->willReturn(false); @@ -103,7 +106,7 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case */ public function test_attachment_delete_success($remove_success, $exists_success, $expected, $throw_exception = false) { - $this->filesystem = $this->getMock('\phpbb\filesystem\filesystem', array('remove', 'exists')); + $this->filesystem = $this->createMock('\phpbb\filesystem\filesystem', array('remove', 'exists')); if ($throw_exception) { $this->filesystem->expects($this->any()) diff --git a/tests/attachment/manager_test.php b/tests/attachment/manager_test.php index 47d7f38b1d..c440dcf101 100644 --- a/tests/attachment/manager_test.php +++ b/tests/attachment/manager_test.php @@ -17,7 +17,7 @@ class phpbb_attachment_manager_test extends \phpbb_test_case protected $resync; protected $upload; - public function setUp() + public function setUp(): void { $this->delete = $this->getMockBuilder('\phpbb\attachment\delete') ->disableOriginalConstructor() diff --git a/tests/attachment/resync_test.php b/tests/attachment/resync_test.php index f882af9ae5..de5ead5bff 100644 --- a/tests/attachment/resync_test.php +++ b/tests/attachment/resync_test.php @@ -24,7 +24,7 @@ class phpbb_attachment_resync_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/resync.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/attachment/upload_test.php b/tests/attachment/upload_test.php index 235ecd082a..a3f51dd34e 100644 --- a/tests/attachment/upload_test.php +++ b/tests/attachment/upload_test.php @@ -67,7 +67,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/resync.xml'); } - public function setUp() + public function setUp(): void { global $config, $phpbb_root_path, $phpEx; @@ -81,7 +81,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case $config = $this->config; $this->db = $this->new_dbal(); $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\dummy(), $this->config, $this->db, $phpbb_root_path, $phpEx); - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); @@ -336,14 +336,14 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case */ public function test_image_upload($is_image, $plupload_active, $config_data, $expected) { - $filespec = $this->getMock('\phpbb\files\filespec', - array( + $filespec = $this->getMockBuilder('\phpbb\files\filespec') + ->setMethods(array( 'init_error', 'is_image', 'move_file', 'is_uploaded', - ), - array( + )) + ->setConstructorArgs(array( $this->filesystem, $this->language, $this->php_ini, @@ -351,7 +351,8 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case $this->phpbb_root_path, $this->mimetype_guesser, $this->plupload - )); + )) + ->getMock(); foreach ($config_data as $key => $value) { $this->config[$key] = $value; diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index 7d77d763fb..0c26a0a186 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -17,7 +17,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case protected $user; protected $request; - protected function setup() + protected function setup(): void { parent::setUp(); @@ -27,7 +27,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case $config = new \phpbb\config\config(array()); $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->user = new \phpbb\user($lang, '\phpbb\datetime'); $driver_helper = new \phpbb\passwords\driver\helper($config); $passwords_drivers = array( diff --git a/tests/auth/provider_db_test.php b/tests/auth/provider_db_test.php index 6ff77da564..b7d94ed046 100644 --- a/tests/auth/provider_db_test.php +++ b/tests/auth/provider_db_test.php @@ -37,7 +37,7 @@ class phpbb_auth_provider_db_test extends phpbb_database_test_case )); $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); - $request = $this->getMock('\phpbb\request\request'); + $request = $this->createMock('\phpbb\request\request'); $user = new \phpbb\user($lang, '\phpbb\datetime'); $driver_helper = new \phpbb\passwords\driver\helper($config); $passwords_drivers = array( diff --git a/tests/auth/provider_oauth_token_storage_test.php b/tests/auth/provider_oauth_token_storage_test.php index ae5de6aa7e..0c0e55dec6 100644 --- a/tests/auth/provider_oauth_token_storage_test.php +++ b/tests/auth/provider_oauth_token_storage_test.php @@ -25,7 +25,7 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c protected $state_table; protected $user; - protected function setup() + protected function setup(): void { parent::setUp(); @@ -73,7 +73,10 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c $token = $cache_token; } - $this->setExpectedException($exception); + if (!empty($exception)) + { + $this->expectException($exception); + } $stored_token = $this->token_storage->retrieveAccessToken($this->service_name); $this->assertEquals($token, $stored_token); @@ -120,7 +123,10 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c $token = $cache_token; } - $this->setExpectedException($exception); + if (!empty($exception)) + { + $this->expectException($exception); + } $stored_token = $this->token_storage->retrieve_access_token_by_session($this->service_name); $this->assertEquals($token, $stored_token); diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index d1e907b53d..81a0655e02 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -25,12 +25,12 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/users.xml'); } - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; // Mock phpbb_container - $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $phpbb_container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); $phpbb_container->expects($this->any()) ->method('get') ->will($this->returnArgument(0)); @@ -39,13 +39,13 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case // Prepare dependencies for avatar manager and driver $this->config = new \phpbb\config\config(array()); - $cache = $this->getMock('\phpbb\cache\driver\driver_interface'); + $cache = $this->createMock('\phpbb\cache\driver\driver_interface'); $path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( new phpbb_mock_request() ), $filesystem, - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, $phpEx ); @@ -62,12 +62,17 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case $dispatcher = new phpbb_mock_event_dispatcher(); // $this->avatar_foobar will be needed later on - $this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache)); + $this->avatar_foobar = $this->getMockBuilder('\phpbb\avatar\driver\foobar') + ->setMethods(array('get_name')) + ->setConstructorArgs(array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache)) + ->getMock(); $this->avatar_foobar->expects($this->any()) ->method('get_name') ->will($this->returnValue('avatar.driver.foobar')); // barfoo driver can't be mocked with constructor arguments - $this->avatar_barfoo = $this->getMock('\phpbb\avatar\driver\barfoo', array('get_name', 'get_config_name')); + $this->avatar_barfoo = $this->getMockBuilder('\phpbb\avatar\driver\barfoo') + ->setMethods(array('get_name', 'get_config_name')) + ->getMock(); $this->avatar_barfoo->expects($this->any()) ->method('get_name') ->will($this->returnValue('avatar.driver.barfoo')); @@ -82,11 +87,17 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case { if ($driver !== 'upload') { - $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache)); + $cur_avatar = $this->getMockBuilder('\phpbb\avatar\driver\\' . $driver) + ->setMethods(array('get_name')) + ->setConstructorArgs(array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache)) + ->getMock(); } else { - $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $filesystem, $path_helper, $dispatcher, $files_factory, $cache)); + $cur_avatar = $this->getMockBuilder('\phpbb\avatar\driver\\' . $driver) + ->setMethods(array('get_name')) + ->setConstructorArgs(array($this->config, $phpbb_root_path, $phpEx, $filesystem, $path_helper, $dispatcher, $files_factory, $cache)) + ->getMock(); } $cur_avatar->expects($this->any()) ->method('get_name') @@ -288,10 +299,10 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case { global $phpbb_root_path, $phpEx; - $user = $this->getMock('\phpbb\user', array(), array( - new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), - '\phpbb\datetime') - ); + $user = $this->getMockBuilder('\phpbb\user') + ->setMethods(array()) + ->setConstructorArgs(array(new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime')) + ->getMock(); $lang_array = array( array('FOOBAR_OFF', 'foobar_off'), array('FOOBAR_EXPLAIN', 'FOOBAR_EXPLAIN %s'), diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 18977bac88..62f91e346e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -42,7 +42,7 @@ require_once 'test_framework/phpbb_database_test_connection_manager.php'; require_once 'test_framework/phpbb_functional_test_case.php'; require_once 'test_framework/phpbb_ui_test_case.php'; -if (version_compare(PHP_VERSION, '5.3.19', ">=") && file_exists(__DIR__ . '/vendor/autoload.php')) +if (file_exists(__DIR__ . '/vendor/autoload.php')) { require_once __DIR__ . '/vendor/autoload.php'; } diff --git a/tests/cache/apc_driver_test.php b/tests/cache/apc_driver_test.php index 706f274448..276cbeb3e1 100644 --- a/tests/cache/apc_driver_test.php +++ b/tests/cache/apc_driver_test.php @@ -20,7 +20,6 @@ require_once dirname(__FILE__) . '/common_test_case.php'; class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case { protected static $config; - protected $driver; public function getDataSet() { @@ -47,7 +46,7 @@ class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case } } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/cache/apcu_driver_test.php b/tests/cache/apcu_driver_test.php index 57f640c313..34bcf8f844 100644 --- a/tests/cache/apcu_driver_test.php +++ b/tests/cache/apcu_driver_test.php @@ -20,7 +20,6 @@ require_once dirname(__FILE__) . '/common_test_case.php'; class phpbb_cache_apcu_driver_test extends phpbb_cache_common_test_case { protected static $config; - protected $driver; public function getDataSet() { @@ -45,9 +44,11 @@ class phpbb_cache_apcu_driver_test extends phpbb_cache_common_test_case { self::markTestSkipped('APCu is not enabled for CLI. Set apc.enable_cli=1 in php.ini'); } + + parent::setUpBeforeClass(); } - protected function setUp() + protected function setUp(): void { global $phpbb_container, $phpbb_root_path; diff --git a/tests/cache/cache_memory_test.php b/tests/cache/cache_memory_test.php index ba1010bcf3..b3d19f1782 100644 --- a/tests/cache/cache_memory_test.php +++ b/tests/cache/cache_memory_test.php @@ -23,7 +23,7 @@ class phpbb_cache_memory_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/cache_memory.xml'); } - protected function setUp() + protected function setUp(): void { global $db; parent::setUp(); diff --git a/tests/cache/common_test_case.php b/tests/cache/common_test_case.php index ee0649a755..64273c250a 100644 --- a/tests/cache/common_test_case.php +++ b/tests/cache/common_test_case.php @@ -13,6 +13,9 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case { + /** @var \phpbb\cache\driver\driver_interface */ + protected $driver; + public function test_get_put_exists() { $this->assertFalse($this->driver->_exists('test_key')); diff --git a/tests/cache/dummy_driver_test.php b/tests/cache/dummy_driver_test.php index 6cb6b73729..6802e120ab 100644 --- a/tests/cache/dummy_driver_test.php +++ b/tests/cache/dummy_driver_test.php @@ -13,14 +13,12 @@ class phpbb_cache_dummy_driver_test extends phpbb_database_test_case { - protected $driver; - public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/cache/file_driver_test.php b/tests/cache/file_driver_test.php index 471316847d..37973edba3 100644 --- a/tests/cache/file_driver_test.php +++ b/tests/cache/file_driver_test.php @@ -16,22 +16,18 @@ require_once dirname(__FILE__) . '/common_test_case.php'; class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case { private $cache_dir; - protected $driver; - - public function __construct() - { - $this->cache_dir = dirname(__FILE__) . '/../tmp/cache/'; - } public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); + $this->cache_dir = dirname(__FILE__) . '/../tmp/cache/'; + if (file_exists($this->cache_dir)) { // cache directory possibly left after aborted @@ -43,7 +39,7 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case $this->driver = new \phpbb\cache\driver\file($this->cache_dir); } - protected function tearDown() + protected function tearDown(): void { if (file_exists($this->cache_dir)) { diff --git a/tests/cache/redis_driver_test.php b/tests/cache/redis_driver_test.php index 387e6ca855..a2288cf9a8 100644 --- a/tests/cache/redis_driver_test.php +++ b/tests/cache/redis_driver_test.php @@ -13,10 +13,9 @@ require_once dirname(__FILE__) . '/common_test_case.php'; -class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case +class phpbb_cache_redis_driver_test extends \phpbb_cache_common_test_case { protected static $config; - protected $driver; public function getDataSet() { @@ -41,12 +40,18 @@ class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case { self::markTestSkipped('Test redis host/port is not specified'); } + + parent::setUpBeforeClass(); } - protected function setUp() + protected function setUp(): void { + global $phpbb_root_path, $phpbb_container; + parent::setUp(); + $phpbb_container = new phpbb_mock_container_builder(); + $phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/'); $this->driver = new \phpbb\cache\driver\redis(self::$config['host'], self::$config['port']); $this->driver->purge(); } diff --git a/tests/captcha/qa_test.php b/tests/captcha/qa_test.php index 7ec4be69f5..0856bbd3c3 100644 --- a/tests/captcha/qa_test.php +++ b/tests/captcha/qa_test.php @@ -23,7 +23,7 @@ class phpbb_captcha_qa_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); } - public function setUp() + public function setUp(): void { global $db, $request, $phpbb_container; diff --git a/tests/class_loader/class_loader_test.php b/tests/class_loader/class_loader_test.php index ffb14b0720..60d8d26b13 100644 --- a/tests/class_loader/class_loader_test.php +++ b/tests/class_loader/class_loader_test.php @@ -13,7 +13,7 @@ class phpbb_class_loader_test extends \phpbb_test_case { - public function setUp() + public function setUp(): void { global $phpbb_class_loader; $phpbb_class_loader->unregister(); @@ -22,7 +22,7 @@ class phpbb_class_loader_test extends \phpbb_test_case $phpbb_class_loader_ext->unregister(); } - public function tearDown() + public function tearDown(): void { global $phpbb_class_loader_ext; $phpbb_class_loader_ext->register(); diff --git a/tests/compress/compress_test.php b/tests/compress/compress_test.php index c071a049a8..f67726c205 100644 --- a/tests/compress/compress_test.php +++ b/tests/compress/compress_test.php @@ -34,7 +34,7 @@ class phpbb_compress_test extends phpbb_test_case 'dir/2_1.txt', ); - protected function setUp() + protected function setUp(): void { // Required for compress::add_file global $phpbb_root_path; @@ -54,7 +54,7 @@ class phpbb_compress_test extends phpbb_test_case } } - protected function tearDown() + protected function tearDown(): void { foreach (array(dirname(__FILE__) . self::EXTRACT_DIR, dirname(__FILE__) . self::ARCHIVE_DIR) as $dir) { diff --git a/tests/config/db_test.php b/tests/config/db_test.php index 713e6cb6d9..46addc9d38 100644 --- a/tests/config/db_test.php +++ b/tests/config/db_test.php @@ -22,7 +22,7 @@ class phpbb_config_db_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/config/db_text_test.php b/tests/config/db_text_test.php index a91abf990f..0683abc1a9 100644 --- a/tests/config/db_text_test.php +++ b/tests/config/db_text_test.php @@ -21,7 +21,7 @@ class phpbb_config_db_text_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config_text.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/console/cache/purge_test.php b/tests/console/cache/purge_test.php index 6c92660580..2bb4252c41 100644 --- a/tests/console/cache/purge_test.php +++ b/tests/console/cache/purge_test.php @@ -25,15 +25,12 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case protected $db; protected $config; - public function __construct() - { - $this->cache_dir = dirname(__FILE__) . '/tmp/cache/'; - } - - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; + $this->cache_dir = dirname(__FILE__) . '/tmp/cache/'; + if (file_exists($this->cache_dir)) { // cache directory possibly left after aborted @@ -44,10 +41,10 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case $this->cache = new \phpbb\cache\driver\file($this->cache_dir); - $this->db = $this->getMock('\phpbb\db\driver\driver_interface'); + $this->db = $this->createMock('\phpbb\db\driver\driver_interface'); $this->config = new \phpbb\config\config(array('assets_version' => 1)); - $this->user = $this->getMock('\phpbb\user', array(), array( + $this->user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime') ); @@ -91,7 +88,7 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case public function get_command_tester() { $application = new Application(); - $application->add(new purge($this->user, $this->cache, $this->db, $this->getMock('\phpbb\auth\auth'), new \phpbb\log\dummy(), $this->config)); + $application->add(new purge($this->user, $this->cache, $this->db, $this->createMock('\phpbb\auth\auth'), new \phpbb\log\dummy(), $this->config)); $command = $application->find('cache:purge'); $this->command_name = $command->getName(); diff --git a/tests/console/config/config_test.php b/tests/console/config/config_test.php index 076316217d..65bfad4757 100644 --- a/tests/console/config/config_test.php +++ b/tests/console/config/config_test.php @@ -20,13 +20,13 @@ class phpbb_console_command_config_test extends phpbb_test_case protected $command_name; protected $user; - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; $this->config = new \phpbb\config\config(array()); - $this->user = $this->getMock('\phpbb\user', array(), array( + $this->user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime') ); diff --git a/tests/console/cron/cron_list_test.php b/tests/console/cron/cron_list_test.php index fdc9a05cb2..8c7424c50d 100644 --- a/tests/console/cron/cron_list_test.php +++ b/tests/console/cron/cron_list_test.php @@ -30,11 +30,11 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case protected $command_tester; - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; - $this->user = $this->getMock('\phpbb\user', array(), array( + $this->user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); @@ -74,7 +74,35 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case $task->set_name('command' . $i); $i++; } - $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $pathEx); + + $mock_config = new \phpbb\config\config(array( + 'force_server_vars' => false, + 'enable_mod_rewrite' => '', + )); + + $mock_router = $this->getMockBuilder('\phpbb\routing\router') + ->setMethods(array('setContext', 'generate')) + ->disableOriginalConstructor() + ->getMock(); + $mock_router->method('setContext') + ->willReturn(true); + $mock_router->method('generate') + ->willReturn('foobar'); + + $request = new \phpbb\request\request(); + $request->enable_super_globals(); + + $routing_helper = new \phpbb\routing\helper( + $mock_config, + $mock_router, + new \phpbb\symfony_request($request), + $request, + new \phpbb\filesystem\filesystem(), + $phpbb_root_path, + $pathEx + ); + + $this->cron_manager = new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $pathEx); } public function get_command_tester() diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php index b4a0203325..2744bf132c 100644 --- a/tests/console/cron/run_test.php +++ b/tests/console/cron/run_test.php @@ -32,7 +32,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - public function setUp() + public function setUp(): void { global $db, $config, $phpbb_root_path, $phpEx; @@ -40,7 +40,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $config = $this->config = new \phpbb\config\config(array('cron_lock' => '0')); $this->lock = new \phpbb\lock\db('cron_lock', $this->config, $this->db); - $this->user = $this->getMock('\phpbb\user', array(), array( + $this->user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); @@ -50,7 +50,35 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $tasks = array( $this->task, ); - $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $phbEx); + + $mock_config = new \phpbb\config\config(array( + 'force_server_vars' => false, + 'enable_mod_rewrite' => '', + )); + + $mock_router = $this->getMockBuilder('\phpbb\routing\router') + ->setMethods(array('setContext', 'generate')) + ->disableOriginalConstructor() + ->getMock(); + $mock_router->method('setContext') + ->willReturn(true); + $mock_router->method('generate') + ->willReturn('foobar'); + + $request = new \phpbb\request\request(); + $request->enable_super_globals(); + + $routing_helper = new \phpbb\routing\helper( + $mock_config, + $mock_router, + new \phpbb\symfony_request($request), + $request, + new \phpbb\filesystem\filesystem(), + $phpbb_root_path, + $phpEx + ); + + $this->cron_manager = new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $phpEx); $this->assertSame('0', $config['cron_lock']); } @@ -96,7 +124,35 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case { $tasks = array( ); - $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx); + + $mock_config = new \phpbb\config\config(array( + 'force_server_vars' => false, + 'enable_mod_rewrite' => '', + )); + + $mock_router = $this->getMockBuilder('\phpbb\routing\router') + ->setMethods(array('setContext', 'generate')) + ->disableOriginalConstructor() + ->getMock(); + $mock_router->method('setContext') + ->willReturn(true); + $mock_router->method('generate') + ->willReturn('foobar'); + + $request = new \phpbb\request\request(); + $request->enable_super_globals(); + + $routing_helper = new \phpbb\routing\helper( + $mock_config, + $mock_router, + new \phpbb\symfony_request($request), + $request, + new \phpbb\filesystem\filesystem(), + $phpbb_root_path, + $phpEx + ); + + $this->cron_manager = new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $phpEx); $command_tester = $this->get_command_tester(); $exit_status = $command_tester->execute(array('command' => $this->command_name)); @@ -109,7 +165,35 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case { $tasks = array( ); - $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx); + + $mock_config = new \phpbb\config\config(array( + 'force_server_vars' => false, + 'enable_mod_rewrite' => '', + )); + + $mock_router = $this->getMockBuilder('\phpbb\routing\router') + ->setMethods(array('setContext', 'generate')) + ->disableOriginalConstructor() + ->getMock(); + $mock_router->method('setContext') + ->willReturn(true); + $mock_router->method('generate') + ->willReturn('foobar'); + + $request = new \phpbb\request\request(); + $request->enable_super_globals(); + + $routing_helper = new \phpbb\routing\helper( + $mock_config, + $mock_router, + new \phpbb\symfony_request($request), + $request, + new \phpbb\filesystem\filesystem(), + $phpbb_root_path, + $phpEx + ); + + $this->cron_manager = new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $phpEx); $command_tester = $this->get_command_tester(); $exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true)); diff --git a/tests/console/thumbnail_test.php b/tests/console/thumbnail_test.php index e425d998a2..8f4da5a414 100644 --- a/tests/console/thumbnail_test.php +++ b/tests/console/thumbnail_test.php @@ -32,7 +32,7 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/thumbnail.xml'); } - public function setUp() + public function setUp(): void { global $config, $phpbb_root_path, $phpEx, $phpbb_filesystem; @@ -50,14 +50,14 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case )); $this->db = $this->db = $this->new_dbal(); - $this->user = $this->getMock('\phpbb\user', array(), array( + $this->user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime') ); $this->phpbb_root_path = $phpbb_root_path; $this->phpEx = $phpEx; - $this->cache = $this->getMock('\phpbb\cache\service', array(), array(new phpbb_mock_cache(), $this->config, $this->db, $this->phpbb_root_path, $this->phpEx)); + $this->cache = $this->createMock('\phpbb\cache\service', array(), array(new phpbb_mock_cache(), $this->config, $this->db, $this->phpbb_root_path, $this->phpEx)); $this->cache->expects(self::any())->method('obtain_attach_extensions')->will(self::returnValue(array( 'png' => array('display_cat' => ATTACHMENT_CATEGORY_IMAGE), 'txt' => array('display_cat' => ATTACHMENT_CATEGORY_NONE), @@ -76,7 +76,7 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case copy(dirname(__FILE__) . '/fixtures/txt.txt', $this->phpbb_root_path . 'files/test_txt'); } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); diff --git a/tests/console/update/check_test.php b/tests/console/update/check_test.php index 5cadc5cc97..6812ea61b8 100644 --- a/tests/console/update/check_test.php +++ b/tests/console/update/check_test.php @@ -84,7 +84,7 @@ class phpbb_console_command_check_test extends phpbb_test_case $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( $this->language, '\phpbb\datetime' )); diff --git a/tests/console/user/activate_test.php b/tests/console/user/activate_test.php index 1588a76e47..51e9754b59 100644 --- a/tests/console/user/activate_test.php +++ b/tests/console/user/activate_test.php @@ -21,7 +21,7 @@ class phpbb_console_user_activate_test extends phpbb_console_user_base { protected $notifications; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/console/user/add_test.php b/tests/console/user/add_test.php index bdfb8a8d2a..cc86cb27d3 100644 --- a/tests/console/user/add_test.php +++ b/tests/console/user/add_test.php @@ -61,7 +61,10 @@ class phpbb_console_user_add_test extends phpbb_console_user_base $output->writeln(print_r($response, true)); return $response; }; - $helper = $this->getMock('\Symfony\Component\Console\Helper\QuestionHelper', array('ask')); + $helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\QuestionHelper') + ->setMethods(['ask']) + ->disableOriginalConstructor() + ->getMock(); $helper->expects($this->any()) ->method('ask') ->will($this->returnCallback($ask)); diff --git a/tests/console/user/base.php b/tests/console/user/base.php index ad328ac893..94a51eb896 100644 --- a/tests/console/user/base.php +++ b/tests/console/user/base.php @@ -20,6 +20,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case protected $log; protected $passwords_manager; protected $command_name; + /** @var Symfony\Component\Console\Helper\QuestionHelper */ protected $question; protected $user_loader; protected $phpbb_root_path; @@ -30,7 +31,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - public function setUp() + public function setUp(): void { global $auth, $db, $cache, $config, $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpEx; @@ -39,7 +40,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case $phpbb_container->set('cache.driver', new phpbb_mock_cache()); $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager()); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $cache = $phpbb_container->get('cache.driver'); @@ -62,7 +63,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case $this->language->expects($this->any()) ->method('lang') ->will($this->returnArgument(0)); - $user = $this->user = $this->getMock('\phpbb\user', array(), array( + $user = $this->user = $this->createMock('\phpbb\user', array(), array( $this->language, '\phpbb\datetime' )); diff --git a/tests/console/user/delete_test.php b/tests/console/user/delete_test.php index 88f91afab1..926e496e1e 100644 --- a/tests/console/user/delete_test.php +++ b/tests/console/user/delete_test.php @@ -45,7 +45,7 @@ class phpbb_console_user_delete_test extends phpbb_console_user_base $this->assertEquals(3, $this->get_user_id('Test')); - $this->question->setInputStream($this->getInputStream("yes\n")); + $command_tester->setInputs(['yes', '']); $command_tester->execute(array( 'command' => $this->command_name, @@ -63,7 +63,7 @@ class phpbb_console_user_delete_test extends phpbb_console_user_base $this->assertNull($this->get_user_id('Foo')); - $this->question->setInputStream($this->getInputStream("yes\n")); + $command_tester->setInputs(['yes', '']); $command_tester->execute(array( 'command' => $this->command_name, @@ -80,7 +80,7 @@ class phpbb_console_user_delete_test extends phpbb_console_user_base $this->assertEquals(3, $this->get_user_id('Test')); - $this->question->setInputStream($this->getInputStream("no\n")); + $command_tester->setInputs(['no', '']); $command_tester->execute(array( 'command' => $this->command_name, diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php index 4ea95b0a96..4f978219c2 100644 --- a/tests/content_visibility/delete_post_test.php +++ b/tests/content_visibility/delete_post_test.php @@ -299,7 +299,7 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); // Create auth mock - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $auth->expects($this->any()) ->method('acl_get') ->with($this->stringContains('_'), $this->anything()) diff --git a/tests/content_visibility/get_forums_visibility_sql_test.php b/tests/content_visibility/get_forums_visibility_sql_test.php index 6c5066119e..fde2b62131 100644 --- a/tests/content_visibility/get_forums_visibility_sql_test.php +++ b/tests/content_visibility/get_forums_visibility_sql_test.php @@ -129,7 +129,7 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data $db = $this->new_dbal(); // Create auth mock - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $auth->expects($this->any()) ->method('acl_getf') ->with($this->stringContains('_'), $this->anything()) diff --git a/tests/content_visibility/get_global_visibility_sql_test.php b/tests/content_visibility/get_global_visibility_sql_test.php index 9ae4182673..eced3aa680 100644 --- a/tests/content_visibility/get_global_visibility_sql_test.php +++ b/tests/content_visibility/get_global_visibility_sql_test.php @@ -129,7 +129,7 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data $db = $this->new_dbal(); // Create auth mock - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $auth->expects($this->any()) ->method('acl_getf') ->with($this->stringContains('_'), $this->anything()) diff --git a/tests/content_visibility/get_visibility_sql_test.php b/tests/content_visibility/get_visibility_sql_test.php index aaaf64330e..18802fadbc 100644 --- a/tests/content_visibility/get_visibility_sql_test.php +++ b/tests/content_visibility/get_visibility_sql_test.php @@ -76,7 +76,7 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te $db = $this->new_dbal(); // Create auth mock - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $auth->expects($this->any()) ->method('acl_get') ->with($this->stringContains('_'), $this->anything()) diff --git a/tests/content_visibility/set_post_visibility_test.php b/tests/content_visibility/set_post_visibility_test.php index e33a1f30d5..8f629dca62 100644 --- a/tests/content_visibility/set_post_visibility_test.php +++ b/tests/content_visibility/set_post_visibility_test.php @@ -120,7 +120,7 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); @@ -173,7 +173,7 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); diff --git a/tests/content_visibility/set_topic_visibility_test.php b/tests/content_visibility/set_topic_visibility_test.php index 78431396c3..3db79c0fe0 100644 --- a/tests/content_visibility/set_topic_visibility_test.php +++ b/tests/content_visibility/set_topic_visibility_test.php @@ -84,7 +84,7 @@ class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_ $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php index ea2bc042b1..447c10d10e 100644 --- a/tests/controller/common_helper_route.php +++ b/tests/controller/common_helper_route.php @@ -29,7 +29,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case private $router; private $routing_helper; - public function setUp() + public function setUp(): void { global $phpbb_dispatcher, $phpbb_root_path, $phpEx; @@ -122,7 +122,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case 'autoescape' => false, ) ); - $this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user))); + $this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user))); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->extension_manager = new phpbb_mock_extension_manager( @@ -140,7 +140,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case new \phpbb\routing\file_locator($this->filesystem, dirname(__FILE__) . '/') ); $resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $this->extension_manager); - $this->router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php'); + $this->router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php', false); // Set correct current phpBB root path $this->root_path = $this->get_phpbb_root_path(); diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php index d921d0eade..ddc1921b0e 100644 --- a/tests/controller/controller_test.php +++ b/tests/controller/controller_test.php @@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; class phpbb_controller_controller_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { $this->extension_manager = new phpbb_mock_extension_manager( dirname(__FILE__) . '/', @@ -48,7 +48,7 @@ class phpbb_controller_controller_test extends phpbb_test_case new \phpbb\routing\file_locator(new \phpbb\filesystem\filesystem(), dirname(__FILE__) . '/') ); $resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $this->extension_manager); - $router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php'); + $router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php', false); $routes = $router->get_routes(); // This will need to be updated if any new routes are defined @@ -128,7 +128,8 @@ class phpbb_controller_controller_test extends phpbb_test_case if (!empty($exception)) { - $this->setExpectedException($exception, $exception_message); + $this->expectException($exception); + $this->expectExceptionMessage($exception_message); } $this->assertEquals($expected, $resolver->getArguments($symfony_request, $input)); diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php index 76f8c753bf..f025e38cd5 100644 --- a/tests/cron/manager_test.php +++ b/tests/cron/manager_test.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__) . '/tasks/simple_should_not_run.php'; class phpbb_cron_manager_test extends \phpbb_test_case { - public function setUp() + public function setUp(): void { $this->manager = $this->create_cron_manager(array( new phpbb_cron_task_core_dummy_task(), @@ -75,6 +75,33 @@ class phpbb_cron_manager_test extends \phpbb_test_case { global $phpbb_root_path, $phpEx; - return new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx); + $mock_config = new \phpbb\config\config(array( + 'force_server_vars' => false, + 'enable_mod_rewrite' => '', + )); + + $mock_router = $this->getMockBuilder('\phpbb\routing\router') + ->setMethods(array('setContext', 'generate')) + ->disableOriginalConstructor() + ->getMock(); + $mock_router->method('setContext') + ->willReturn(true); + $mock_router->method('generate') + ->willReturn('foobar'); + + $request = new \phpbb\request\request(); + $request->enable_super_globals(); + + $routing_helper = new \phpbb\routing\helper( + $mock_config, + $mock_router, + new \phpbb\symfony_request($request), + $request, + new \phpbb\filesystem\filesystem(), + $phpbb_root_path, + $phpEx + ); + + return new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $phpEx); } } diff --git a/tests/dbal/auto_increment_test.php b/tests/dbal/auto_increment_test.php index 950a4fc8f7..27d10d2843 100644 --- a/tests/dbal/auto_increment_test.php +++ b/tests/dbal/auto_increment_test.php @@ -23,7 +23,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -42,7 +42,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case $this->table_exists = true; } - protected function tearDown() + protected function tearDown(): void { if ($this->table_exists) { diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index 0365463a48..20ea2b3729 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -25,7 +25,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -77,7 +77,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case $this->table_exists = true; } - protected function tearDown() + protected function tearDown(): void { if ($this->table_exists) { @@ -346,10 +346,10 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case public function test_perform_schema_changes_drop_tables() { - $db_tools = $this->getMock('\phpbb\db\tools\tools', array( - 'sql_table_exists', - 'sql_table_drop', - ), array(&$this->db)); + $db_tools = $this->getMockBuilder('\phpbb\db\tools\tools') + ->setMethods(array('sql_table_exists', 'sql_table_drop')) + ->setConstructorArgs(array(&$this->db)) + ->getMock(); // pretend all tables exist $db_tools->expects($this->any())->method('sql_table_exists') @@ -372,10 +372,10 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case public function test_perform_schema_changes_drop_columns() { - $db_tools = $this->getMock('\phpbb\db\tools\tools', array( - 'sql_column_exists', - 'sql_column_remove', - ), array(&$this->db)); + $db_tools = $this->getMockBuilder('\phpbb\db\tools\tools') + ->setMethods(array('sql_column_exists', 'sql_column_remove')) + ->setConstructorArgs(array(&$this->db)) + ->getMock(); // pretend all columns exist $db_tools->expects($this->any())->method('sql_column_exists') diff --git a/tests/dbal/migration/if.php b/tests/dbal/migration/if.php index 481250ea77..83fba1cbd4 100644 --- a/tests/dbal/migration/if.php +++ b/tests/dbal/migration/if.php @@ -23,11 +23,11 @@ class phpbb_dbal_migration_if extends \phpbb\db\migration\migration return array( array('if', array( true, - array('custom', array(array(&$this, 'test_true'))), + array('custom', array(array($this, 'test_true'))), )), array('if', array( false, - array('custom', array(array(&$this, 'test_false'))), + array('custom', array(array($this, 'test_false'))), )), ); } diff --git a/tests/dbal/migration/if_params.php b/tests/dbal/migration/if_params.php new file mode 100644 index 0000000000..7280088ddc --- /dev/null +++ b/tests/dbal/migration/if_params.php @@ -0,0 +1,44 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class phpbb_dbal_migration_if_params extends \phpbb\db\migration\migration +{ + function update_schema() + { + return array(); + } + + function update_data() + { + return array( + array('if', array( + true, + array('custom', array(array($this, 'test'), array('true'))), + )), + array('if', array( + false, + array('custom', array(array($this, 'test'), array('false'))), + )), + ); + } + + function test($param) + { + global $migrator_test_if_true_failed, $migrator_test_if_false_failed; + + $var = 'migrator_test_if_' . $param . '_failed'; + + ${$var} = !${$var}; + } + +} diff --git a/tests/dbal/migration/recall.php b/tests/dbal/migration/recall.php index c0333b084d..e065b5c4d8 100644 --- a/tests/dbal/migration/recall.php +++ b/tests/dbal/migration/recall.php @@ -21,7 +21,7 @@ class phpbb_dbal_migration_recall extends \phpbb\db\migration\migration function update_data() { return array( - array('custom', array(array(&$this, 'test_call'))), + array('custom', array(array($this, 'test_call'))), ); } diff --git a/tests/dbal/migration/recall_params.php b/tests/dbal/migration/recall_params.php new file mode 100644 index 0000000000..ee0f04c09d --- /dev/null +++ b/tests/dbal/migration/recall_params.php @@ -0,0 +1,42 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class phpbb_dbal_migration_recall_params extends \phpbb\db\migration\migration +{ + function update_schema() + { + return array(); + } + + function update_data() + { + return array( + array('custom', array(array($this, 'test_call'), array(5))), + ); + } + + // This function should be called 5 times + function test_call($times, $input) + { + global $migrator_test_call_input; + + $migrator_test_call_input = (int) $input; + + if ($migrator_test_call_input < $times) + { + return ($migrator_test_call_input + 1); + } + + return; + } +} diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 372b2dbe1e..7d6b100449 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -15,6 +15,8 @@ require_once dirname(__FILE__) . '/migration/dummy.php'; require_once dirname(__FILE__) . '/migration/unfulfillable.php'; require_once dirname(__FILE__) . '/migration/if.php'; require_once dirname(__FILE__) . '/migration/recall.php'; +require_once dirname(__FILE__) . '/migration/if_params.php'; +require_once dirname(__FILE__) . '/migration/recall_params.php'; require_once dirname(__FILE__) . '/migration/revert.php'; require_once dirname(__FILE__) . '/migration/revert_with_dependency.php'; require_once dirname(__FILE__) . '/migration/revert_table.php'; @@ -42,7 +44,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); @@ -196,6 +198,54 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSame(10, $migrator_test_call_input); } + public function test_if_params() + { + $this->migrator->set_migrations(array('phpbb_dbal_migration_if_params')); + + // Don't like this, but I'm not sure there is any other way to do this + global $migrator_test_if_true_failed, $migrator_test_if_false_failed; + $migrator_test_if_true_failed = true; + $migrator_test_if_false_failed = false; + + while (!$this->migrator->finished()) + { + $this->migrator->update(); + } + + $this->assertFalse($migrator_test_if_true_failed, 'True test failed'); + $this->assertFalse($migrator_test_if_false_failed, 'False test failed'); + + while ($this->migrator->migration_state('phpbb_dbal_migration_if_params') !== false) + { + $this->migrator->revert('phpbb_dbal_migration_if_params'); + } + + $this->assertFalse($migrator_test_if_true_failed, 'True test after revert failed'); + $this->assertFalse($migrator_test_if_false_failed, 'False test after revert failed'); + } + + public function test_recall_params() + { + $this->migrator->set_migrations(array('phpbb_dbal_migration_recall_params')); + + global $migrator_test_call_input; + + // Run the schema first + $this->migrator->update(); + + $i = 0; + while (!$this->migrator->finished()) + { + $this->migrator->update(); + + $this->assertSame($i, $migrator_test_call_input); + + $i++; + } + + $this->assertSame(5, $migrator_test_call_input); + } + public function test_revert() { global $migrator_test_revert_counter; diff --git a/tests/dbal/migrator_tool_config_test.php b/tests/dbal/migrator_tool_config_test.php index 13e0c13e3c..74d816dbcd 100644 --- a/tests/dbal/migrator_tool_config_test.php +++ b/tests/dbal/migrator_tool_config_test.php @@ -13,7 +13,7 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case { - public function setup() + public function setUp(): void { $this->config = new \phpbb\config\config(array()); diff --git a/tests/dbal/migrator_tool_config_text_test.php b/tests/dbal/migrator_tool_config_text_test.php index b271c2d62e..051e0a7556 100644 --- a/tests/dbal/migrator_tool_config_text_test.php +++ b/tests/dbal/migrator_tool_config_text_test.php @@ -18,7 +18,7 @@ class phpbb_dbal_migrator_tool_config_text_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_config_text.xml'); } - public function setup() + public function setUp(): void { parent::setup(); diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php index e34ee7b59c..ecc7b384e7 100644 --- a/tests/dbal/migrator_tool_module_test.php +++ b/tests/dbal/migrator_tool_module_test.php @@ -21,7 +21,7 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_module.xml'); } - public function setup() + public function setUp(): void { // Need global $db, $user for delete_module function in acp_modules global $phpbb_root_path, $phpEx, $skip_add_log, $db, $user, $phpbb_log; @@ -39,7 +39,7 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case $cache = new phpbb_mock_cache; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); // Correctly set the root path for this test to this directory, so the classes can be found diff --git a/tests/dbal/migrator_tool_permission_test.php b/tests/dbal/migrator_tool_permission_test.php index ccad6a1387..a48c367896 100644 --- a/tests/dbal/migrator_tool_permission_test.php +++ b/tests/dbal/migrator_tool_permission_test.php @@ -24,7 +24,7 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_permission.xml'); } - public function setup() + public function setUp(): void { // Global $db and $cache are needed in acp/auth.php constructor global $phpbb_root_path, $phpEx, $db, $cache; diff --git a/tests/dbal/sql_affected_rows_test.php b/tests/dbal/sql_affected_rows_test.php index 07d7318358..e9fb1f2724 100644 --- a/tests/dbal/sql_affected_rows_test.php +++ b/tests/dbal/sql_affected_rows_test.php @@ -16,7 +16,7 @@ class phpbb_dbal_sql_affected_rows_test extends phpbb_database_test_case /** @var \phpbb\db\driver\driver_interface */ protected $db; - public function setUp() + public function setUp(): void { parent::setUp(); $this->db = $this->new_dbal(); diff --git a/tests/dbal/sql_insert_buffer_test.php b/tests/dbal/sql_insert_buffer_test.php index eae0abceba..b0e678b9da 100644 --- a/tests/dbal/sql_insert_buffer_test.php +++ b/tests/dbal/sql_insert_buffer_test.php @@ -16,7 +16,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case protected $db; protected $buffer; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php index 1fd2cbd7ee..8ecad71412 100644 --- a/tests/di/create_container_test.php +++ b/tests/di/create_container_test.php @@ -26,7 +26,7 @@ namespace protected $phpbb_root_path; protected $filename; - public function setUp() + public function setUp(): void { $this->phpbb_root_path = dirname(__FILE__) . '/'; $this->config_php = new \phpbb\config_php_file($this->phpbb_root_path . 'fixtures/', 'php'); diff --git a/tests/di/ordered_service_collection_test.php b/tests/di/ordered_service_collection_test.php index 47e6d23744..baa9776573 100644 --- a/tests/di/ordered_service_collection_test.php +++ b/tests/di/ordered_service_collection_test.php @@ -18,7 +18,7 @@ class phpbb_ordered_service_collection_test extends \phpbb_test_case */ protected $service_collection; - public function setUp() + public function setUp(): void { $container = new phpbb_mock_container_builder(); $container->set('foo', new StdClass); diff --git a/tests/di/service_collection_test.php b/tests/di/service_collection_test.php index 5b51254a4a..97c13ab163 100644 --- a/tests/di/service_collection_test.php +++ b/tests/di/service_collection_test.php @@ -18,15 +18,19 @@ class phpbb_service_collection_test extends \phpbb_test_case */ protected $service_collection; - public function setUp() + public function setUp(): void { $container = new phpbb_mock_container_builder(); $container->set('foo', new StdClass); $container->set('bar', new StdClass); + $container->set('baz', new StdClass); $this->service_collection = new \phpbb\di\service_collection($container); $this->service_collection->add('foo'); $this->service_collection->add('bar'); + $this->service_collection->add_service_class('foo', 'foo_class'); + $this->service_collection->add_service_class('bar', 'bar_class'); + $this->service_collection->add_service_class('baz', 'bar_class'); parent::setUp(); } @@ -44,4 +48,25 @@ class phpbb_service_collection_test extends \phpbb_test_case $this->assertSame(array('foo', 'bar'), $service_names); } + + public function test_get_by_class() + { + $this->assertSame($this->service_collection['foo'], $this->service_collection->get_by_class('foo_class')); + } + + public function test_get_by_class_many_services_exception() + { + $this->expectException('RuntimeException'); + $this->expectExceptionMessage('More than one service definitions found for class "bar_class" in collection.'); + + $this->service_collection->get_by_class('bar_class'); + } + + public function test_get_by_class_no_service_exception() + { + $this->expectException('RuntimeException'); + $this->expectExceptionMessage('No service found for class "baz_class" in collection.'); + + $this->service_collection->get_by_class('baz_class'); + } } diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php index 8fdfe3035e..629df9abb6 100644 --- a/tests/email/email_parsing_test.php +++ b/tests/email/email_parsing_test.php @@ -19,7 +19,7 @@ class phpbb_email_parsing_test extends phpbb_test_case /** @var \ReflectionProperty */ protected $reflection_template_property; - public function setUp() + public function setUp(): void { global $phpbb_container, $config, $phpbb_root_path, $phpEx, $request, $user; @@ -67,13 +67,6 @@ class phpbb_email_parsing_test extends phpbb_test_case $phpbb_container->set('ext.manager', $extension_manager); $context = new \phpbb\template\context(); - $twig_extension = new \phpbb\template\twig\extension($context, $lang); - $phpbb_container->set('template.twig.extensions.phpbb', $twig_extension); - - $twig_extensions_collection = new \phpbb\di\service_collection($phpbb_container); - $twig_extensions_collection->add('template.twig.extensions.phpbb'); - $phpbb_container->set('template.twig.extensions.collection', $twig_extensions_collection); - $twig = new \phpbb\template\twig\environment( $config, $filesystem, @@ -89,6 +82,13 @@ class phpbb_email_parsing_test extends phpbb_test_case 'autoescape' => false, ) ); + $twig_extension = new \phpbb\template\twig\extension($context, $twig, $lang); + $phpbb_container->set('template.twig.extensions.phpbb', $twig_extension); + + $twig_extensions_collection = new \phpbb\di\service_collection($phpbb_container); + $twig_extensions_collection->add('template.twig.extensions.phpbb'); + $phpbb_container->set('template.twig.extensions.collection', $twig_extensions_collection); + $twig->addExtension($twig_extension); $phpbb_container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig)); diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php index 8ed89bbe52..c7701cfad0 100644 --- a/tests/error_collector_test.php +++ b/tests/error_collector_test.php @@ -13,7 +13,7 @@ class phpbb_error_collector_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/event/exception_listener_test.php b/tests/event/exception_listener_test.php index 08679a3ed8..fbae9e25b7 100644 --- a/tests/event/exception_listener_test.php +++ b/tests/event/exception_listener_test.php @@ -84,7 +84,7 @@ class exception_listener extends phpbb_test_case $exception_listener = new \phpbb\event\kernel_exception_subscriber($template, $lang); - $event = new \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent($this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST, $exception); + $event = new \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent($this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST, $exception); $exception_listener->on_kernel_exception($event); $response = $event->getResponse(); diff --git a/tests/event/export_php_test.php b/tests/event/export_php_test.php index 21bbb0620a..92280b6f4f 100644 --- a/tests/event/export_php_test.php +++ b/tests/event/export_php_test.php @@ -16,7 +16,7 @@ class phpbb_event_export_php_test extends phpbb_test_case /** @var \phpbb\event\php_exporter */ protected $exporter; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php index c6670e1340..5c9e20aa7d 100644 --- a/tests/event/php_exporter_test.php +++ b/tests/event/php_exporter_test.php @@ -16,7 +16,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case /** @var \phpbb\event\php_exporter */ protected $exporter; - public function setUp() + public function setUp(): void { parent::setUp(); $this->exporter = new \phpbb\event\php_exporter(dirname(__FILE__) . '/fixtures/'); @@ -122,7 +122,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case static public function crawl_php_file_throws_data() { return array( - array('missing_var.test', null), + array('missing_var.test', 2), array('duplicate_event.test', 10), ); } @@ -132,7 +132,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_crawl_php_file_throws($file, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->crawl_php_file($file); } @@ -206,7 +207,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_validate_event_throws($event_name, $event, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->validate_event($event_name, $event); } @@ -461,7 +463,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_get_vars_from_array_throws($lines, $event_line, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->set_current_event('', $event_line); $this->exporter->set_content($lines); @@ -546,7 +549,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_get_vars_from_docblock_throws($lines, $event_line, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->set_current_event('', $event_line); $this->exporter->set_content($lines); @@ -649,7 +653,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_find_since_throws($lines, $event_line, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->set_current_event('', $event_line); $this->exporter->set_content($lines); @@ -750,7 +755,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case */ public function test_find_description_throws($lines, $event_line, $exception_code) { - $this->setExpectedException('LogicException', '', $exception_code); + $this->expectException('LogicException'); + $this->expectExceptionCode($exception_code); $this->exporter->set_current_event('', $event_line); $this->exporter->set_content($lines); diff --git a/tests/extension/extension_base_test.php b/tests/extension/extension_base_test.php index e0c2e6d549..1f44fdb234 100644 --- a/tests/extension/extension_base_test.php +++ b/tests/extension/extension_base_test.php @@ -30,7 +30,7 @@ class phpbb_extension_extension_base_test extends phpbb_test_case self::$reflection_method_get_migration_file_list->setAccessible(true); } - public function setUp() + public function setUp(): void { $container = new phpbb_mock_container_builder(); $migrator = new phpbb_mock_migrator(); diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php index 71de2c2fc5..7649b4f19a 100644 --- a/tests/extension/finder_test.php +++ b/tests/extension/finder_test.php @@ -18,7 +18,7 @@ class phpbb_extension_finder_test extends phpbb_test_case /** @var \phpbb\finder */ protected $finder; - public function setUp() + public function setUp(): void { $this->extension_manager = new phpbb_mock_extension_manager( dirname(__FILE__) . '/', @@ -239,7 +239,7 @@ class phpbb_extension_finder_test extends phpbb_test_case /** * These do not work because of changes with PHPBB3-11386 - * They do not seem neccessary to me, so I am commenting them out for now + * They do not seem necessary to me, so I am commenting them out for now public function test_get_classes_create_cache() { $cache = new phpbb_mock_cache; diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index f619d4c19d..231af81a39 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -26,7 +26,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 533da68c57..a2f0542979 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -32,7 +32,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -59,7 +59,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case new phpbb_mock_request() ), $filesystem, - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $this->phpbb_root_path, $this->phpEx ); @@ -111,7 +111,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case $lang = new \phpbb\language\language($lang_loader); $this->user = new \phpbb\user($lang, '\phpbb\datetime'); - $this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user))); + $this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user))); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); } diff --git a/tests/extension/modules_test.php b/tests/extension/modules_test.php index 88634bc6ba..f8c65bc147 100644 --- a/tests/extension/modules_test.php +++ b/tests/extension/modules_test.php @@ -24,7 +24,7 @@ class phpbb_extension_modules_test extends phpbb_test_case protected $finder; protected $module_manager; - public function setUp() + public function setUp(): void { global $phpbb_extension_manager; @@ -46,7 +46,7 @@ class phpbb_extension_modules_test extends phpbb_test_case $this->module_manager = new \phpbb\module\module_manager( new \phpbb\cache\driver\dummy(), - $this->getMock('\phpbb\db\driver\driver_interface'), + $this->createMock('\phpbb\db\driver\driver_interface'), $this->extension_manager, MODULES_TABLE, dirname(__FILE__) . '/', diff --git a/tests/feed/attachments_base_test.php b/tests/feed/attachments_base_test.php index 573218be42..3798056f10 100644 --- a/tests/feed/attachments_base_test.php +++ b/tests/feed/attachments_base_test.php @@ -25,7 +25,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/../extension/fixtures/extensions.xml'); } - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; @@ -36,7 +36,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case new phpbb_mock_request() ), $this->filesystem, - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, 'php' ); @@ -99,7 +99,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case if ($expected_exception !== false) { - $this->setExpectedException($expected_exception); + $this->expectException($expected_exception); $this->attachments_mocks_feed->get_sql(); } diff --git a/tests/files/types_base_test.php b/tests/files/types_base_test.php index e630bf8c48..a5533f2bc0 100644 --- a/tests/files/types_base_test.php +++ b/tests/files/types_base_test.php @@ -35,11 +35,11 @@ class phpbb_files_types_base_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); @@ -75,7 +75,7 @@ class phpbb_files_types_base_test extends phpbb_test_case */ public function test_check_upload_size($filename, $max_filesize, $expected) { - $php_ini = $this->getMock('\bantu\IniGetWrapper\IniGetWrapper'); + $php_ini = $this->createMock('\bantu\IniGetWrapper\IniGetWrapper'); $php_ini->expects($this->any()) ->method('getString') ->willReturn($max_filesize); diff --git a/tests/files/types_form_test.php b/tests/files/types_form_test.php index 925babb47f..ffebcf603f 100644 --- a/tests/files/types_form_test.php +++ b/tests/files/types_form_test.php @@ -38,11 +38,11 @@ class phpbb_files_types_form_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->request->expects($this->any()) ->method('file') ->willReturn(array()); @@ -137,7 +137,7 @@ class phpbb_files_types_form_test extends phpbb_test_case */ public function test_upload_form($upload, $expected, $plupload = array()) { - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->request->expects($this->any()) ->method('file') ->willReturn($upload); diff --git a/tests/files/types_local_test.php b/tests/files/types_local_test.php index 31070de107..7468e9c4a7 100644 --- a/tests/files/types_local_test.php +++ b/tests/files/types_local_test.php @@ -38,11 +38,11 @@ class phpbb_files_types_local_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->request->expects($this->any()) ->method('file') ->willReturn(array()); diff --git a/tests/files/types_remote_test.php b/tests/files/types_remote_test.php index 1a7d63d790..d42a609fbb 100644 --- a/tests/files/types_remote_test.php +++ b/tests/files/types_remote_test.php @@ -40,14 +40,14 @@ class phpbb_files_types_remote_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { global $config, $phpbb_root_path, $phpEx; $config = new \phpbb\config\config(array()); $this->config = $config; $this->config->set('remote_upload_verify', 0); - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); @@ -102,7 +102,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case */ public function test_get_max_file_size($max_file_size, $link, $expected = array('URL_NOT_FOUND')) { - $php_ini = $this->getMock('\bantu\IniGetWrapper\IniGetWrapper', array('getString')); + $php_ini = $this->createMock('\bantu\IniGetWrapper\IniGetWrapper', array('getString')); $php_ini->expects($this->any()) ->method('getString') ->willReturn($max_file_size); diff --git a/tests/files/upload_test.php b/tests/files/upload_test.php index c41204a0d5..c8857f863d 100644 --- a/tests/files/upload_test.php +++ b/tests/files/upload_test.php @@ -35,7 +35,7 @@ class phpbb_files_upload_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { // Global $config required by unique_id global $config, $phpbb_root_path, $phpEx; @@ -48,7 +48,7 @@ class phpbb_files_upload_test extends phpbb_test_case $config['rand_seed'] = ''; $config['rand_seed_last_update'] = time() + 600; - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); diff --git a/tests/filesystem/clean_path_test.php b/tests/filesystem/clean_path_test.php index d2dec424b4..dbb06e5e74 100644 --- a/tests/filesystem/clean_path_test.php +++ b/tests/filesystem/clean_path_test.php @@ -15,7 +15,7 @@ class phpbb_filesystem_clean_path_test extends phpbb_test_case { protected $filesystem; - public function setUp() + public function setUp(): void { parent::setUp(); $this->filesystem = new \phpbb\filesystem\filesystem(); diff --git a/tests/filesystem/is_absolute_test.php b/tests/filesystem/is_absolute_test.php index 7a50989b74..55e729feb7 100644 --- a/tests/filesystem/is_absolute_test.php +++ b/tests/filesystem/is_absolute_test.php @@ -16,7 +16,7 @@ class phpbb_filesystem_is_absolute_test extends phpbb_test_case /** @var \phpbb\filesystem\filesystem_interface */ protected $filesystem; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/filesystem/realpath_test.php b/tests/filesystem/realpath_test.php index d994935f94..3d05cd7ff2 100644 --- a/tests/filesystem/realpath_test.php +++ b/tests/filesystem/realpath_test.php @@ -27,7 +27,7 @@ class phpbb_filesystem_realpath_test extends phpbb_test_case self::$filesystem_own_realpath->setAccessible(true); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/acp_permissions_test.php b/tests/functional/acp_permissions_test.php index 0a40e76057..ccaa4aab29 100644 --- a/tests/functional/acp_permissions_test.php +++ b/tests/functional/acp_permissions_test.php @@ -16,7 +16,7 @@ */ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/acp_profile_field_test.php b/tests/functional/acp_profile_field_test.php index 7a0a6ca941..4c0414f03a 100644 --- a/tests/functional/acp_profile_field_test.php +++ b/tests/functional/acp_profile_field_test.php @@ -16,7 +16,7 @@ */ class phpbb_functional_acp_profile_field_test extends phpbb_functional_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/acp_users_test.php b/tests/functional/acp_users_test.php index 78028aacb8..c8d0072c28 100644 --- a/tests/functional/acp_users_test.php +++ b/tests/functional/acp_users_test.php @@ -16,7 +16,7 @@ */ class phpbb_functional_acp_users_test extends phpbb_functional_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/common_avatar_test_case.php b/tests/functional/common_avatar_test_case.php index 924eb1273c..155f6e0c09 100644 --- a/tests/functional/common_avatar_test_case.php +++ b/tests/functional/common_avatar_test_case.php @@ -21,7 +21,7 @@ abstract class phpbb_functional_common_avatar_test_case extends phpbb_functional abstract function get_url(); - public function setUp() + public function setUp(): void { parent::setUp(); $this->path = __DIR__ . '/fixtures/files/'; diff --git a/tests/functional/controllers_compatibility_test.php b/tests/functional/controllers_compatibility_test.php index 9499888a1a..36a34aa7c8 100644 --- a/tests/functional/controllers_compatibility_test.php +++ b/tests/functional/controllers_compatibility_test.php @@ -37,6 +37,13 @@ class phpbb_functional_controllers_compatibility_test extends phpbb_functional_t $this->assert301('feed.php?t=1', 'app.php/feed/topic/1'); } + public function test_cron_compatibility() + { + $this->assert301('cron.php?cron_type=foo', 'app.php/cron/foo'); + $this->assert301('cron.php?cron_type=foo&bar=foobar', 'app.php/cron/foo?bar=foobar'); + $this->assert301('cron.php?cron_type=foo&bar=foobar&who=me', 'app.php/cron/foo?bar=foobar&who=me'); + } + protected function assert301($from, $to) { self::$client->followRedirects(false); @@ -44,6 +51,7 @@ class phpbb_functional_controllers_compatibility_test extends phpbb_functional_t // Fix sid issues $location = self::$client->getResponse()->getHeader('Location'); + $location = str_replace('&', '&', $location); $location = preg_replace('#sid=[^&]+(&(amp;)?)?#', '', $location); if (substr($location, -1) === '?') { diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index ce0f4911e3..b398a73e3f 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -37,7 +37,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); @@ -195,7 +195,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('.errorbox')->text()); + $this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('#main')->text()); } public function test_actions() @@ -206,7 +206,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case // Correctly submit the enable form $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $form = $crawler->selectButton('enable')->form(); + $form = $crawler->selectButton('confirm')->form(); $crawler = self::submit($form); $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('.successbox')->text()); @@ -216,7 +216,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case // Correctly submit the disable form $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $form = $crawler->selectButton('disable')->form(); + $form = $crawler->selectButton('confirm')->form(); $crawler = self::submit($form); $this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('.successbox')->text()); @@ -226,12 +226,17 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case // Correctly submit the delete data form $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $form = $crawler->selectButton('delete_data')->form(); + $form = $crawler->selectButton('confirm')->form(); $crawler = self::submit($form); $this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $crawler->filter('.successbox')->text()); // Attempt to enable invalid extension $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=barfoo&sid=' . $this->sid); $this->assertContainsLang('EXTENSION_DIR_INVALID', $crawler->filter('.errorbox')->text()); + + // Test installing/uninstalling extension altogether + $this->logout(); + $this->install_ext('vendor/moo'); + $this->uninstall_ext('vendor/moo'); } } diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index 58c3878b8b..c5ebf761c9 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -45,7 +45,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); @@ -90,6 +90,15 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c } /** + * Check includejs/includecss when the request_uri is a subdirectory + */ + public function test_controller_template_include_js_css() + { + $crawler = self::request('GET', 'app.php/help/faq'); + $this->assertContains("./../../assets/javascript/core.js", $crawler->filter('body')->html()); + } + + /** * Check the error produced by calling a controller without a required * argument. */ diff --git a/tests/functional/extension_global_lang_test.php b/tests/functional/extension_global_lang_test.php index a1e2547745..94c80a6d9a 100644 --- a/tests/functional/extension_global_lang_test.php +++ b/tests/functional/extension_global_lang_test.php @@ -41,10 +41,10 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_ self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); - + $this->get_db(); $this->phpbb_extension_manager = $this->get_extension_manager(); @@ -52,7 +52,7 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_ $this->purge_cache(); } - public function tearDown() + public function tearDown(): void { parent::tearDown(); diff --git a/tests/functional/extension_module_test.php b/tests/functional/extension_module_test.php index d3a66b9b35..09d0124990 100644 --- a/tests/functional/extension_module_test.php +++ b/tests/functional/extension_module_test.php @@ -40,7 +40,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { global $db; diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php index f570d45215..e0721ad1ec 100644 --- a/tests/functional/extension_permission_lang_test.php +++ b/tests/functional/extension_permission_lang_test.php @@ -41,12 +41,12 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); - + $this->get_db(); - + $acl_ary = array( 'auth_option' => 'u_foo', 'is_global' => 1, diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index 3792b0a23c..a3cdfb336d 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -20,7 +20,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case static public $init_values = array(); - public function setUp() + public function setUp(): void { parent::setUp(); $this->purge_cache(); diff --git a/tests/functional/fileupload_form_test.php b/tests/functional/fileupload_form_test.php index b0780172ff..b0838344de 100644 --- a/tests/functional/fileupload_form_test.php +++ b/tests/functional/fileupload_form_test.php @@ -18,14 +18,14 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case { private $path; - public function setUp() + public function setUp(): void { parent::setUp(); $this->path = __DIR__ . '/fixtures/files/'; $this->add_lang('posting'); } - public function tearDown() + public function tearDown(): void { $iterator = new DirectoryIterator(__DIR__ . '/../../phpBB/files/'); foreach ($iterator as $fileinfo) diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php index 426ebcee53..25fc9f0508 100644 --- a/tests/functional/fileupload_remote_test.php +++ b/tests/functional/fileupload_remote_test.php @@ -34,7 +34,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - public function setUp() + public function setUp(): void { parent::setUp(); // Only doing this within the functional framework because we need a @@ -54,7 +54,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $this->filesystem = new \phpbb\filesystem\filesystem(); $this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; $container = new phpbb_mock_container_builder(); @@ -65,7 +65,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $this->phpbb_root_path = $phpbb_root_path; } - public function tearDown() + public function tearDown(): void { global $config, $user; $user = null; diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index 64fa19557f..2fd5b45f7d 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -45,7 +45,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case } - public function tearDown() + public function tearDown(): void { $this->login(); $this->admin_login(); diff --git a/tests/functional/metadata_manager_test.php b/tests/functional/metadata_manager_test.php index 8456c40f00..4f4fad4434 100644 --- a/tests/functional/metadata_manager_test.php +++ b/tests/functional/metadata_manager_test.php @@ -24,7 +24,7 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case 'foo/bar/', ); - public function tearDown() + public function tearDown(): void { $this->purge_cache(); @@ -46,7 +46,7 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/plupload_test.php b/tests/functional/plupload_test.php index 9d284a7e57..c3b2e5b9eb 100644 --- a/tests/functional/plupload_test.php +++ b/tests/functional/plupload_test.php @@ -30,7 +30,7 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case $db->sql_query($query); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->purge_cache(); @@ -40,7 +40,7 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case $this->login(); } - public function tearDown() + public function tearDown(): void { $this->set_extension_group_permission(0); $iterator = new DirectoryIterator(__DIR__ . '/../../phpBB/files/'); diff --git a/tests/functional/prune_shadow_topic_test.php b/tests/functional/prune_shadow_topic_test.php index c014119b98..39bf223f93 100644 --- a/tests/functional/prune_shadow_topic_test.php +++ b/tests/functional/prune_shadow_topic_test.php @@ -130,7 +130,16 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Prune Shadow']}&sid={$this->sid}"); $this->assertNotEmpty($crawler->filter('img')->last()->attr('src')); - self::request('GET', "cron.php?cron_type=cron.task.core.prune_shadow_topics&f={$this->data['forums']['Prune Shadow']}&sid={$this->sid}", array(), false); + self::request('GET', "app.php/cron/cron.task.core.prune_shadow_topics?f={$this->data['forums']['Prune Shadow']}&sid={$this->sid}", array(), false); + + // Try to ensure that the cron can actually run before we start to wait for it + sleep(1); + $cron_lock = new \phpbb\lock\db('cron_lock', new \phpbb\config\db($this->db, new \phpbb\cache\driver\dummy(), 'phpbb_config'), $this->db); + while (!$cron_lock->acquire()) + { + // do nothing + } + $cron_lock->release(); $this->assert_forum_details($this->data['forums']['Prune Shadow'], array( 'forum_posts_approved' => 0, diff --git a/tests/functional/ucp_pm_test.php b/tests/functional/ucp_pm_test.php index ddd5c8d791..53de247202 100644 --- a/tests/functional/ucp_pm_test.php +++ b/tests/functional/ucp_pm_test.php @@ -16,7 +16,7 @@ */ class phpbb_functional_ucp_pm_test extends phpbb_functional_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); $this->login(); diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php index 91a4a9ec66..1519549d3e 100644 --- a/tests/functions/build_url_test.php +++ b/tests/functions/build_url_test.php @@ -13,7 +13,7 @@ class phpbb_build_url_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { global $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpbb_path_helper; @@ -28,7 +28,7 @@ class phpbb_build_url_test extends phpbb_test_case new phpbb_mock_request() ), new \phpbb\filesystem\filesystem(), - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, 'php' ); diff --git a/tests/functions/generate_string_list.php b/tests/functions/generate_string_list.php index 6eddb1395e..0f9975bcac 100644 --- a/tests/functions/generate_string_list.php +++ b/tests/functions/generate_string_list.php @@ -15,7 +15,7 @@ class phpbb_generate_string_list_test extends phpbb_test_case { public $user; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php index d481bde80d..18ad789705 100644 --- a/tests/functions/make_clickable_email_test.php +++ b/tests/functions/make_clickable_email_test.php @@ -13,7 +13,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php index a6af12b624..d8d5eb5e0e 100644 --- a/tests/functions/make_clickable_test.php +++ b/tests/functions/make_clickable_test.php @@ -154,7 +154,7 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case ); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php index 778753e5d2..f740decab8 100644 --- a/tests/functions/obtain_online_test.php +++ b/tests/functions/obtain_online_test.php @@ -18,7 +18,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/obtain_online.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -162,7 +162,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case $config['load_online_guests'] = $display_guests; $user = new phpbb_mock_lang(); $user->lang = $this->load_language(); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $acl_get_map = array( array('u_viewonline', true), array('u_viewprofile', true), diff --git a/tests/functions/phpbb_get_banned_user_ids.php b/tests/functions/phpbb_get_banned_user_ids.php index 6f7607132e..e1cb7a4636 100644 --- a/tests/functions/phpbb_get_banned_user_ids.php +++ b/tests/functions/phpbb_get_banned_user_ids.php @@ -43,13 +43,13 @@ class phpbb_get_banned_user_ids_test extends phpbb_database_test_case ); } - public function setUp() + public function setUp(): void { global $db; $db = $this->new_dbal(); - return parent::setUp(); + parent::setUp(); } /** diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php index f419c90e9e..89aecdefb9 100644 --- a/tests/functions/user_delete_test.php +++ b/tests/functions/user_delete_test.php @@ -23,7 +23,7 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_delete.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_date_test.php b/tests/functions/validate_date_test.php index 9dc0db46d6..cd4e7430f3 100644 --- a/tests/functions/validate_date_test.php +++ b/tests/functions/validate_date_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_date_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_email_test.php b/tests/functions/validate_email_test.php index 7f8b2679d4..e163d01412 100644 --- a/tests/functions/validate_email_test.php +++ b/tests/functions/validate_email_test.php @@ -22,7 +22,7 @@ class phpbb_functions_validate_email_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/validate_email.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_jabber_test.php b/tests/functions/validate_jabber_test.php index 23811a94c0..dbdf10cb4a 100644 --- a/tests/functions/validate_jabber_test.php +++ b/tests/functions/validate_jabber_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_jabber_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -32,7 +32,7 @@ class phpbb_functions_validate_jabber_test extends phpbb_test_case array(), '', array('jabber'), - ), + ), 'no_seperator' => array( array('WRONG_DATA'), 'testjabber.ccc', diff --git a/tests/functions/validate_lang_iso_test.php b/tests/functions/validate_lang_iso_test.php index 81b56055e6..cbe5339ea5 100644 --- a/tests/functions/validate_lang_iso_test.php +++ b/tests/functions/validate_lang_iso_test.php @@ -24,7 +24,7 @@ class phpbb_functions_validate_lang_iso_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/language_select.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_match_test.php b/tests/functions/validate_match_test.php index 811bed3e33..7159686066 100644 --- a/tests/functions/validate_match_test.php +++ b/tests/functions/validate_match_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_match_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_num_test.php b/tests/functions/validate_num_test.php index 798468759c..acbdc49614 100644 --- a/tests/functions/validate_num_test.php +++ b/tests/functions/validate_num_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_num_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_password_test.php b/tests/functions/validate_password_test.php index 5e34c8baba..6e4ccea3ab 100644 --- a/tests/functions/validate_password_test.php +++ b/tests/functions/validate_password_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_password_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_string_test.php b/tests/functions/validate_string_test.php index 7aca14c334..83ba546152 100644 --- a/tests/functions/validate_string_test.php +++ b/tests/functions/validate_string_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_string_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_user_email_test.php b/tests/functions/validate_user_email_test.php index 8dcec88103..a05a7808a4 100644 --- a/tests/functions/validate_user_email_test.php +++ b/tests/functions/validate_user_email_test.php @@ -26,7 +26,7 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/validate_email.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php index cee5d38400..3a4b63b5e8 100644 --- a/tests/functions/validate_username_test.php +++ b/tests/functions/validate_username_test.php @@ -26,7 +26,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/validate_username.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_with_method_test.php b/tests/functions/validate_with_method_test.php index 37e05d412a..1cd610fd2f 100644 --- a/tests/functions/validate_with_method_test.php +++ b/tests/functions/validate_with_method_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_with_method_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_acp/build_select_test.php b/tests/functions_acp/build_select_test.php index ebdc58fd64..9a295762c3 100644 --- a/tests/functions_acp/build_select_test.php +++ b/tests/functions_acp/build_select_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_built_select_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_acp/h_radio_test.php b/tests/functions_acp/h_radio_test.php index 5ae4e91ea2..cc9d837357 100644 --- a/tests/functions_acp/h_radio_test.php +++ b/tests/functions_acp/h_radio_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_h_radio_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_acp/validate_config_vars_test.php b/tests/functions_acp/validate_config_vars_test.php index 3bd2204de9..0198f28a39 100644 --- a/tests/functions_acp/validate_config_vars_test.php +++ b/tests/functions_acp/validate_config_vars_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_acp/validate_range_test.php b/tests/functions_acp/validate_range_test.php index 9e9154a43c..085787105f 100644 --- a/tests/functions_acp/validate_range_test.php +++ b/tests/functions_acp/validate_range_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_validate_range_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_content/get_username_string_test.php b/tests/functions_content/get_username_string_test.php index e79342d05d..ac36e37e93 100644 --- a/tests/functions_content/get_username_string_test.php +++ b/tests/functions_content/get_username_string_test.php @@ -18,7 +18,7 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case parent::setUp(); global $auth, $phpbb_dispatcher, $user; - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $auth->expects($this->any()) ->method('acl_get') ->with($this->stringContains('_'), $this->anything()) diff --git a/tests/functions_content/phpbb_format_quote_test.php b/tests/functions_content/phpbb_format_quote_test.php index cbbd46d0a9..52a792517a 100644 --- a/tests/functions_content/phpbb_format_quote_test.php +++ b/tests/functions_content/phpbb_format_quote_test.php @@ -18,7 +18,7 @@ class phpbb_functions_content_phpbb_format_quote_test extends phpbb_test_case /** @var \phpbb\language\language */ protected $lang; - public function setUp() + public function setUp(): void { global $cache, $user, $phpbb_root_path, $phpEx; diff --git a/tests/functions_privmsgs/get_max_setting_from_group_test.php b/tests/functions_privmsgs/get_max_setting_from_group_test.php index fbabf1222a..b96f490c88 100644 --- a/tests/functions_privmsgs/get_max_setting_from_group_test.php +++ b/tests/functions_privmsgs/get_max_setting_from_group_test.php @@ -23,7 +23,7 @@ class phpbb_functions_privmsgs_get_max_setting_from_group_test extends phpbb_dat /** @var \phpbb\db\driver\driver_interface */ protected $db; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_user/delete_user_test.php b/tests/functions_user/delete_user_test.php index 09ed51890c..c112a0c368 100644 --- a/tests/functions_user/delete_user_test.php +++ b/tests/functions_user/delete_user_test.php @@ -19,7 +19,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/delete_user.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_user/group_user_attributes_test.php b/tests/functions_user/group_user_attributes_test.php index 3124d57ba0..6968b1cd3a 100644 --- a/tests/functions_user/group_user_attributes_test.php +++ b/tests/functions_user/group_user_attributes_test.php @@ -134,11 +134,11 @@ class phpbb_functions_user_group_user_attributes_test extends phpbb_database_tes $cache = new phpbb_mock_cache; $db = $this->new_dbal(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $auth->expects($this->any()) ->method('acl_clear_prefetch'); $cache_driver = new \phpbb\cache\driver\dummy(); - $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $phpbb_container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); $phpbb_container ->expects($this->any()) ->method('get') diff --git a/tests/group/helper_test.php b/tests/group/helper_test.php index 2377a6f47c..855663791b 100644 --- a/tests/group/helper_test.php +++ b/tests/group/helper_test.php @@ -16,7 +16,7 @@ class phpbb_group_helper_test extends phpbb_test_case /** @var \phpbb\group\helper */ protected $group_helper; - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/groupposition/legend_test.php b/tests/groupposition/legend_test.php index 02ddb7cbce..66fc909770 100644 --- a/tests/groupposition/legend_test.php +++ b/tests/groupposition/legend_test.php @@ -43,7 +43,7 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case if ($throws_exception) { - $this->setExpectedException($throws_exception); + $this->expectException($throws_exception); } $test_class = new \phpbb\groupposition\legend($db, $user); diff --git a/tests/groupposition/teampage_test.php b/tests/groupposition/teampage_test.php index 3b916670f7..8598e5cfb0 100644 --- a/tests/groupposition/teampage_test.php +++ b/tests/groupposition/teampage_test.php @@ -43,7 +43,7 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case if ($throws_exception) { - $this->setExpectedException($throws_exception); + $this->expectException($throws_exception); } $test_class = new \phpbb\groupposition\teampage($db, $user, $cache); diff --git a/tests/help/manager_test.php b/tests/help/manager_test.php index 68534d9a32..118a38ad3e 100644 --- a/tests/help/manager_test.php +++ b/tests/help/manager_test.php @@ -20,7 +20,7 @@ class phpbb_help_manager_test extends phpbb_test_case /** @var \phpbb\language\language */ protected $language; - public function setUp() + public function setUp(): void { $this->template = $this->getMockBuilder('\phpbb\template\template') ->disableOriginalConstructor() diff --git a/tests/installer/database_helper_test.php b/tests/installer/database_helper_test.php index ed355884f6..9ffdad3e03 100644 --- a/tests/installer/database_helper_test.php +++ b/tests/installer/database_helper_test.php @@ -18,7 +18,7 @@ class phpbb_installer_database_helper_test extends phpbb_test_case */ private $database_helper; - public function setUp() + public function setUp(): void { $filesystem = new \phpbb\filesystem\filesystem(); $phpbb_root_path = ''; diff --git a/tests/installer/installer_config_test.php b/tests/installer/installer_config_test.php index 13ac325a79..6fa8248b68 100644 --- a/tests/installer/installer_config_test.php +++ b/tests/installer/installer_config_test.php @@ -20,11 +20,12 @@ class phpbb_installer_config_test extends phpbb_test_case */ private $config; - public function setUp() + public function setUp(): void { $phpbb_root_path = __DIR__ . './../../phpBB/'; - $filesystem = $this->getMock('\phpbb\filesystem\filesystem'); + $filesystem = $this->createMock('\phpbb\filesystem\filesystem'); $php_ini = $this->getMockBuilder('\bantu\IniGetWrapper\IniGetWrapper') + ->setMethods(array('getInt', 'getBytes')) ->getMock(); $php_ini->method('getInt') ->willReturn(-1); diff --git a/tests/installer/module_base_test.php b/tests/installer/module_base_test.php index 9578010047..887d29f4c6 100644 --- a/tests/installer/module_base_test.php +++ b/tests/installer/module_base_test.php @@ -26,7 +26,7 @@ class module_base_test extends phpbb_test_case */ protected $container; - public function setUp() + public function setUp(): void { // DI container mock $this->container = new phpbb_mock_container_builder(); @@ -42,7 +42,7 @@ class module_base_test extends phpbb_test_case $this->module = new test_installer_module($module_collection, true, false); - $iohandler = $this->getMock('\phpbb\install\helper\iohandler\iohandler_interface'); + $iohandler = $this->createMock('\phpbb\install\helper\iohandler\iohandler_interface'); $config = new \phpbb\install\helper\config(new \phpbb\filesystem\filesystem(), new \bantu\IniGetWrapper\IniGetWrapper(), '', 'php'); $this->module->setup($config, $iohandler); } diff --git a/tests/language/language_test.php b/tests/language/language_test.php index 29b4873dcb..8b822472cd 100644 --- a/tests/language/language_test.php +++ b/tests/language/language_test.php @@ -16,7 +16,7 @@ class phpbb_language_test extends phpbb_test_case /** @var \phpbb\language\language */ protected $lang; - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/lint_test.php b/tests/lint_test.php index 8ab31f976c..8356389acf 100644 --- a/tests/lint_test.php +++ b/tests/lint_test.php @@ -45,11 +45,6 @@ class phpbb_lint_test extends phpbb_test_case */ public function test_lint($path) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) - { - $this->markTestSkipped('phpBB uses PHP 5.3 syntax in some files, linting on PHP < 5.3 will fail'); - } - $cmd = sprintf('(%s -l %s) 2>&1', self::$php_binary, escapeshellarg($path)); $output = array(); $status = 1; diff --git a/tests/lock/db_test.php b/tests/lock/db_test.php index 5fbfa26554..e96920ed1f 100644 --- a/tests/lock/db_test.php +++ b/tests/lock/db_test.php @@ -22,7 +22,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml'); } - public function setUp() + public function setUp(): void { global $db, $config; diff --git a/tests/log/add_test.php b/tests/log/add_test.php index 604c8364dc..469d4ebd69 100644 --- a/tests/log/add_test.php +++ b/tests/log/add_test.php @@ -28,7 +28,7 @@ class phpbb_log_add_test extends phpbb_database_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); @@ -59,7 +59,7 @@ class phpbb_log_add_test extends phpbb_database_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); diff --git a/tests/log/delete_test.php b/tests/log/delete_test.php index e8b75d01d9..503e2c2fca 100644 --- a/tests/log/delete_test.php +++ b/tests/log/delete_test.php @@ -20,7 +20,7 @@ class phpbb_log_delete_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/delete_log.xml'); } - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx, $db, $phpbb_dispatcher, $auth; @@ -30,7 +30,7 @@ class phpbb_log_delete_test extends phpbb_database_test_case $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->data['user_id'] = 1; - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $this->log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); diff --git a/tests/log/function_add_log_test.php b/tests/log/function_add_log_test.php index 3b5537fc13..c3f1a0beba 100644 --- a/tests/log/function_add_log_test.php +++ b/tests/log/function_add_log_test.php @@ -159,11 +159,11 @@ class phpbb_log_function_add_log_test extends phpbb_database_test_case $db = $this->new_dbal(); $cache = new phpbb_mock_cache; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php index ee9c3e5893..c26644088e 100644 --- a/tests/log/function_view_log_test.php +++ b/tests/log/function_view_log_test.php @@ -274,7 +274,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case // Offset that will be returned from the function 'expected_returned' => 0, // view_log parameters (see includes/functions_admin.php for docblock) - // $log is ommited! + // $log is omitted! 'mod', 5, 0, 12, 45, ), */ @@ -378,7 +378,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); // Create auth mock - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $acl_get_map = array( array('f_read', 23, true), array('m_', 23, true), diff --git a/tests/mcp/post_ip_test.php b/tests/mcp/post_ip_test.php index 72a9f62774..f53066c9e6 100644 --- a/tests/mcp/post_ip_test.php +++ b/tests/mcp/post_ip_test.php @@ -23,7 +23,7 @@ class phpbb_mcp_post_ip_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/post_ip.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/migrator/convert_timezones_test.php b/tests/migrator/convert_timezones_test.php index f8d780da0c..4bb0aec34f 100644 --- a/tests/migrator/convert_timezones_test.php +++ b/tests/migrator/convert_timezones_test.php @@ -49,7 +49,7 @@ class phpbb_migrator_convert_timezones_test extends phpbb_database_test_case ); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/migrator/get_callable_from_step_test.php b/tests/migrator/get_callable_from_step_test.php index af636f5d21..f08caf3181 100644 --- a/tests/migrator/get_callable_from_step_test.php +++ b/tests/migrator/get_callable_from_step_test.php @@ -13,7 +13,7 @@ class get_callable_from_step_test extends phpbb_database_test_case { - public function setUp() + public function setUp(): void { global $phpbb_root_path, $php_ext, $table_prefix, $phpbb_log; diff --git a/tests/migrator/get_schema_steps_test.php b/tests/migrator/get_schema_steps_test.php index 3d15d2b200..10accb3d68 100644 --- a/tests/migrator/get_schema_steps_test.php +++ b/tests/migrator/get_schema_steps_test.php @@ -13,7 +13,7 @@ class get_schema_steps_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/migrator/reverse_update_data_test.php b/tests/migrator/reverse_update_data_test.php index b85e48c64c..b93680c2e2 100644 --- a/tests/migrator/reverse_update_data_test.php +++ b/tests/migrator/reverse_update_data_test.php @@ -16,7 +16,7 @@ class reverse_update_data_test extends phpbb_test_case /** @var \phpbb\db\migration\helper */ protected $helper; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/migrator/schema_generator_test.php b/tests/migrator/schema_generator_test.php index 1996d207ea..88257430a7 100644 --- a/tests/migrator/schema_generator_test.php +++ b/tests/migrator/schema_generator_test.php @@ -24,7 +24,7 @@ class schema_generator_test extends phpbb_test_case /** @var \phpbb\db\migration\schema_generator */ protected $generator; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/mimetype/guesser_test.php b/tests/mimetype/guesser_test.php index fa53e6c8c4..238e7ae2d6 100644 --- a/tests/mimetype/guesser_test.php +++ b/tests/mimetype/guesser_test.php @@ -27,7 +27,7 @@ class guesser_test extends \phpbb_test_case protected $fileinfo_supported = false; - public function setUp() + public function setUp(): void { global $phpbb_root_path; @@ -181,7 +181,7 @@ class guesser_test extends \phpbb_test_case if (!$supported) { - $this->setExpectedException('\LogicException'); + $this->expectException('\LogicException'); } $guesser = new \phpbb\mimetype\guesser($guessers); diff --git a/tests/mock/cache.php b/tests/mock/cache.php index 5fa3d28147..2306fd9009 100644 --- a/tests/mock/cache.php +++ b/tests/mock/cache.php @@ -72,13 +72,13 @@ class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface } } - public function checkVar(PHPUnit_Framework_Assert $test, $var_name, $data) + public function checkVar(PHPUnit\Framework\Assert $test, $var_name, $data) { $test->assertTrue(isset($this->data[$var_name])); $test->assertEquals($data, $this->data[$var_name]); } - public function checkAssociativeVar(PHPUnit_Framework_Assert $test, $var_name, $data, $sort = true) + public function checkAssociativeVar(PHPUnit\Framework\Assert $test, $var_name, $data, $sort = true) { $test->assertTrue(isset($this->data[$var_name])); @@ -93,12 +93,12 @@ class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface $test->assertEquals($data, $this->data[$var_name]); } - public function checkVarUnset(PHPUnit_Framework_Assert $test, $var_name) + public function checkVarUnset(PHPUnit\Framework\Assert $test, $var_name) { $test->assertFalse(isset($this->data[$var_name])); } - public function check(PHPUnit_Framework_Assert $test, $data, $ignore_db_info = true) + public function check(PHPUnit\Framework\Assert $test, $data, $ignore_db_info = true) { $cache_data = $this->data; diff --git a/tests/mock/container_builder.php b/tests/mock/container_builder.php index 134589b0b8..17c4ae22dd 100644 --- a/tests/mock/container_builder.php +++ b/tests/mock/container_builder.php @@ -18,16 +18,22 @@ class phpbb_mock_container_builder implements ContainerInterface protected $services = array(); protected $parameters = array(); + public function __construct() + { + $this->setParameter('debug.load_time', false); + $this->setParameter('session.log_errors', false); + } + /** * Sets a service. * * @param string $id The service identifier * @param object $service The service instance - * @param string $scope The scope of the service + * @param bool $shared Whether service is shared * * @api */ - public function set($id, $service, $scope = self::SCOPE_CONTAINER) + public function set($id, $service, $shared = false) { $this->services[$id] = $service; } @@ -193,4 +199,9 @@ class phpbb_mock_container_builder implements ContainerInterface { return false; } + + public function initialized($id) + { + return true; + } } diff --git a/tests/mock/session_testable.php b/tests/mock/session_testable.php index 2f24978ba8..7828a864d4 100644 --- a/tests/mock/session_testable.php +++ b/tests/mock/session_testable.php @@ -30,14 +30,14 @@ class phpbb_mock_session_testable extends \phpbb\session /** * Checks if the cookies were set correctly. * - * @param PHPUnit_Framework_Assert test The test from which this is called + * @param PHPUnit\Framework\Assert test The test from which this is called * @param array(string => mixed) cookies The cookie data to check against. * The keys are cookie names, the values can either be null to - * check only the existance of the cookie, or an array(d, t), + * check only the existence of the cookie, or an array(d, t), * where d is the cookie data to check, or null to skip the * check and t is the cookie time to check, or null to skip. */ - public function check_cookies(PHPUnit_Framework_Assert $test, $cookies) + public function check_cookies(PHPUnit\Framework\Assert $test, $cookies) { $test->assertEquals(array_keys($cookies), array_keys($this->_cookies), 'Incorrect cookies were set'); diff --git a/tests/notification/base.php b/tests/notification/base.php index 80b9a0d777..f7faf50d68 100644 --- a/tests/notification/base.php +++ b/tests/notification/base.php @@ -50,7 +50,7 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case ); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/notification/convert_test.php b/tests/notification/convert_test.php index 4a7fd89409..d4a33ff537 100644 --- a/tests/notification/convert_test.php +++ b/tests/notification/convert_test.php @@ -21,7 +21,7 @@ class phpbb_notification_convert_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/convert.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/notification/fixtures/services_notification.yml b/tests/notification/fixtures/services_notification.yml index 6e68cccff6..c83d8bd323 100644 --- a/tests/notification/fixtures/services_notification.yml +++ b/tests/notification/fixtures/services_notification.yml @@ -70,7 +70,7 @@ services: test: class: phpbb\notification\type\test - scope: prototype + shared: false parent: notification.type.base tags: - { name: notification.type } diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php index 21559c42a5..466d3ec07f 100644 --- a/tests/notification/submit_post_base.php +++ b/tests/notification/submit_post_base.php @@ -47,7 +47,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/submit_post_' . $this->item_type . '.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); @@ -58,7 +58,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c $db = $this->db; // Auth - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $auth->expects($this->any()) ->method('acl_get') ->with($this->stringContains('_'), @@ -92,7 +92,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c $lang = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); // User - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( $lang, '\phpbb\datetime' )); @@ -105,8 +105,8 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c ); // Request - $type_cast_helper = $this->getMock('\phpbb\request\type_cast_helper_interface'); - $request = $this->getMock('\phpbb\request\request'); + $type_cast_helper = $this->createMock('\phpbb\request\type_cast_helper_interface'); + $request = $this->createMock('\phpbb\request\request'); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $user_loader = new \phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE); diff --git a/tests/notification/submit_post_type_bookmark_test.php b/tests/notification/submit_post_type_bookmark_test.php index 7c3b9f938f..9af247b3c3 100644 --- a/tests/notification/submit_post_type_bookmark_test.php +++ b/tests/notification/submit_post_type_bookmark_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_bookmark_test extends phpbb_notificati { protected $item_type = 'notification.type.bookmark'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_type_post_in_queue_test.php b/tests/notification/submit_post_type_post_in_queue_test.php index 1390e92d96..bced0ea48c 100644 --- a/tests/notification/submit_post_type_post_in_queue_test.php +++ b/tests/notification/submit_post_type_post_in_queue_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_post_in_queue_test extends phpbb_notif { protected $item_type = 'notification.type.post_in_queue'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_type_post_test.php b/tests/notification/submit_post_type_post_test.php index 037c326bc0..5580d0924e 100644 --- a/tests/notification/submit_post_type_post_test.php +++ b/tests/notification/submit_post_type_post_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_post_test extends phpbb_notification_s { protected $item_type = 'notification.type.post'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_type_quote_test.php b/tests/notification/submit_post_type_quote_test.php index 3fab8c05ba..655f12661b 100644 --- a/tests/notification/submit_post_type_quote_test.php +++ b/tests/notification/submit_post_type_quote_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_quote_test extends phpbb_notification_ { protected $item_type = 'notification.type.quote'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_type_topic_test.php b/tests/notification/submit_post_type_topic_test.php index f14f305517..070b2fa21e 100644 --- a/tests/notification/submit_post_type_topic_test.php +++ b/tests/notification/submit_post_type_topic_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_topic_test extends phpbb_notification_ { protected $item_type = 'notification.type.topic'; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -42,7 +42,7 @@ class phpbb_notification_submit_post_type_topic_test extends phpbb_notification_ ), ))); - $phpbb_log = $this->getMock('\phpbb\log\dummy'); + $phpbb_log = $this->createMock('\phpbb\log\dummy'); } /** diff --git a/tests/notification/user_list_trim_test.php b/tests/notification/user_list_trim_test.php index 7d4dff6024..bf3058c342 100644 --- a/tests/notification/user_list_trim_test.php +++ b/tests/notification/user_list_trim_test.php @@ -20,7 +20,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_list_trim.xml'); } - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx, $phpbb_dispatcher, $user, $cache, $auth; @@ -39,7 +39,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case $phpEx ); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $auth->expects($this->any()) ->method('acl_get') ->with($this->stringContains('_'), diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php index 2d7d1671a8..073ba1d5cd 100644 --- a/tests/pagination/pagination_test.php +++ b/tests/pagination/pagination_test.php @@ -22,14 +22,14 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case return implode('-', func_get_args()); } - public function setUp() + public function setUp(): void { parent::setUp(); global $phpbb_dispatcher, $phpbb_root_path, $phpEx; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $this->user = $this->getMock('\phpbb\user', array(), array( + $this->user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); @@ -47,7 +47,7 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case new \phpbb\routing\file_locator($filesystem, dirname(__FILE__) . '/') ); $resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $manager); - $router = new phpbb_mock_router(new phpbb_mock_container_builder(), $resources_locator, $loader, dirname(__FILE__) . '/', 'php'); + $router = new phpbb_mock_router(new phpbb_mock_container_builder(), $resources_locator, $loader, dirname(__FILE__) . '/', 'php', false); $request = new phpbb_mock_request(); $request->overwrite('SCRIPT_NAME', '/app.php', \phpbb\request\request_interface::SERVER); diff --git a/tests/passwords/drivers_test.php b/tests/passwords/drivers_test.php index 01c69a38bb..547ee33f2e 100644 --- a/tests/passwords/drivers_test.php +++ b/tests/passwords/drivers_test.php @@ -13,7 +13,7 @@ class phpbb_passwords_helper_test extends \phpbb_test_case { - public function setUp() + public function setUp(): void { // Prepare dependencies for drivers $config = new \phpbb\config\config(array()); @@ -23,6 +23,7 @@ class phpbb_passwords_helper_test extends \phpbb_test_case $php_ext = 'php'; $this->passwords_drivers = array( + 'passwords.driver.argon2i' => new \phpbb\passwords\driver\argon2i($config, $this->driver_helper), 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $this->driver_helper, 10), 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $this->driver_helper, 10), 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $this->driver_helper), @@ -422,6 +423,10 @@ class phpbb_passwords_helper_test extends \phpbb_test_case array('passwords.driver.salted_md5', 'foobar', false), array('passwords.driver.bcrypt_2y', '$2y$9$somerandomhash', true), array('passwords.driver.bcrypt', '$2a$04$somerandomhash', true), + array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=2,p=2$NEF0S1JSN04yNGQ1UVRKdA$KYGNI9CbjoKh1UEu1PpdlqbuLbveGwkMcwcT2Un9pPM', false), + array('passwords.driver.argon2i', '$argon2i$v=19$m=128,t=2,p=2$M29GUi51QjdKLjIzbC9scQ$6h1gZDqn7JTmVdQ0lJh1x5nyvgO/DaJWUKOFJ0itCJ0', true), + array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=1,p=2$UnFHb2F4NER3M0xWWmxMUQ$u3javvoAZJeIyR1P3eg0tb8VjEeXvQPagqwetonq1NA', true), + array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=2,p=1$bm5SeGJ3R3ZRY1A0YXJPNg$v1A9m4sJW+ge0RBtpJ4w9861+J9xkguKBAsZHrG8LQU', true), ); } @@ -430,6 +435,10 @@ class phpbb_passwords_helper_test extends \phpbb_test_case */ public function test_needs_rehash($driver, $hash, $expected) { - $this->assertSame($this->passwords_drivers[$driver]->needs_rehash($hash), $expected); + if (!$this->passwords_drivers[$driver]->is_supported()) + { + $this->markTestSkipped($driver . ' is not supported'); + } + $this->assertSame($expected, $this->passwords_drivers[$driver]->needs_rehash($hash)); } } diff --git a/tests/passwords/manager_test.php b/tests/passwords/manager_test.php index 0410d7035f..dc5c539316 100644 --- a/tests/passwords/manager_test.php +++ b/tests/passwords/manager_test.php @@ -19,7 +19,7 @@ class phpbb_passwords_manager_test extends \phpbb_test_case protected $default_pw = 'foobar'; - public function setUp() + public function setUp(): void { // Prepare dependencies for manager and driver $config = new \phpbb\config\config(array()); @@ -361,13 +361,13 @@ class phpbb_passwords_manager_test extends \phpbb_test_case { if ($use_new_interface) { - $test_driver = $this->getMock('\phpbb\passwords\driver\rehashable_driver_interface', array('needs_rehash', 'get_prefix', 'check', 'is_supported', 'is_legacy', 'hash', 'get_settings_only')); + $test_driver = $this->createMock('\phpbb\passwords\driver\rehashable_driver_interface', array('needs_rehash', 'get_prefix', 'check', 'is_supported', 'is_legacy', 'hash', 'get_settings_only')); $test_driver->method('needs_rehash') ->willReturn($needs_rehash); } else { - $test_driver = $this->getMock('\phpbb\passwords\driver\driver_interface', array('get_prefix', 'check', 'is_supported', 'is_legacy', 'hash', 'get_settings_only')); + $test_driver = $this->createMock('\phpbb\passwords\driver\driver_interface', array('get_prefix', 'check', 'is_supported', 'is_legacy', 'hash', 'get_settings_only')); } $config = new \phpbb\config\config(array()); diff --git a/tests/path_helper/path_helper_test.php b/tests/path_helper/path_helper_test.php index 49dd40fbec..447ed7a2db 100644 --- a/tests/path_helper/path_helper_test.php +++ b/tests/path_helper/path_helper_test.php @@ -17,7 +17,7 @@ class phpbb_path_helper_test extends phpbb_test_case protected $path_helper; protected $phpbb_root_path = ''; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -29,7 +29,7 @@ class phpbb_path_helper_test extends phpbb_test_case new phpbb_mock_request() ), new \phpbb\filesystem\filesystem(), - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $this->phpbb_root_path, 'php' ); @@ -180,7 +180,7 @@ class phpbb_path_helper_test extends phpbb_test_case */ public function test_update_web_root_path($input, $getPathInfo, $getRequestUri, $getScriptName, $correction) { - $symfony_request = $this->getMock('\phpbb\symfony_request', array(), array( + $symfony_request = $this->createMock('\phpbb\symfony_request', array(), array( new phpbb_mock_request(), )); $symfony_request->expects($this->any()) @@ -196,7 +196,7 @@ class phpbb_path_helper_test extends phpbb_test_case $path_helper = new \phpbb\path_helper( $symfony_request, new \phpbb\filesystem\filesystem(), - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $this->phpbb_root_path, 'php' ); diff --git a/tests/profilefields/type_bool_test.php b/tests/profilefields/type_bool_test.php index 10239172c3..3e7cace288 100644 --- a/tests/profilefields/type_bool_test.php +++ b/tests/profilefields/type_bool_test.php @@ -23,19 +23,21 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case * @access public * @return void */ - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; - $user = $this->getMock('\phpbb\user', array(), array( - new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), - '\phpbb\datetime' - )); + $db = $this->createMock('phpbb\\db\\driver\\driver'); + + $user = $this->createMock('\phpbb\user'); $user->expects($this->any()) ->method('lang') ->will($this->returnCallback(array($this, 'return_callback_implode'))); - $lang = $this->getMock('\phpbb\profilefields\lang_helper', array(), array(null, null)); + $lang = $this->getMockBuilder('\phpbb\profilefields\lang_helper') + ->setMethods(array('get_options_lang', 'is_set', 'get')) + ->setConstructorArgs(array($db, LANG_TABLE)) + ->getMock(); $lang->expects($this->any()) ->method('get_options_lang'); @@ -48,8 +50,8 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case ->method('get') ->will($this->returnCallback(array($this, 'get'))); - $request = $this->getMock('\phpbb\request\request'); - $template = $this->getMock('\phpbb\template\template'); + $request = $this->createMock('\phpbb\request\request'); + $template = $this->createMock('\phpbb\template\template'); $this->cp = new \phpbb\profilefields\type\type_bool( $lang, diff --git a/tests/profilefields/type_date_test.php b/tests/profilefields/type_date_test.php index e0807b2f9b..b70aa60368 100644 --- a/tests/profilefields/type_date_test.php +++ b/tests/profilefields/type_date_test.php @@ -23,11 +23,11 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; - $this->user = $this->getMock('\phpbb\user', array(), array( + $this->user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); @@ -45,8 +45,8 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case 'DATE_FORMAT' => 'm/d/Y', ); - $request = $this->getMock('\phpbb\request\request'); - $template = $this->getMock('\phpbb\template\template'); + $request = $this->createMock('\phpbb\request\request'); + $template = $this->createMock('\phpbb\template\template'); $this->cp = new \phpbb\profilefields\type\type_date( $request, diff --git a/tests/profilefields/type_dropdown_test.php b/tests/profilefields/type_dropdown_test.php index ab02353fb9..738801d524 100644 --- a/tests/profilefields/type_dropdown_test.php +++ b/tests/profilefields/type_dropdown_test.php @@ -23,22 +23,24 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; - $user = $this->getMock('\phpbb\user', array(), array( - new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), - '\phpbb\datetime' - )); + $db = $this->createMock('phpbb\\db\\driver\\driver'); + + $user = $this->createMock('\phpbb\user'); $user->expects($this->any()) ->method('lang') ->will($this->returnCallback(array($this, 'return_callback_implode'))); - $request = $this->getMock('\phpbb\request\request'); - $template = $this->getMock('\phpbb\template\template'); + $request = $this->createMock('\phpbb\request\request'); + $template = $this->createMock('\phpbb\template\template'); - $lang = $this->getMock('\phpbb\profilefields\lang_helper', array(), array(null, null)); + $lang = $this->getMockBuilder('\phpbb\profilefields\lang_helper') + ->setMethods(array('get_options_lang', 'is_set', 'get')) + ->setConstructorArgs(array($db, LANG_TABLE)) + ->getMock(); $lang->expects($this->any()) ->method('get_options_lang'); diff --git a/tests/profilefields/type_googleplus_test.php b/tests/profilefields/type_googleplus_test.php index 9222362214..a5f934ea17 100644 --- a/tests/profilefields/type_googleplus_test.php +++ b/tests/profilefields/type_googleplus_test.php @@ -15,7 +15,7 @@ class phpbb_profilefield_type_googleplus_test extends phpbb_test_case { protected $field; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -25,8 +25,8 @@ class phpbb_profilefield_type_googleplus_test extends phpbb_test_case $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->add_lang('ucp'); - $request = $this->getMock('\phpbb\request\request'); - $template = $this->getMock('\phpbb\template\template'); + $request = $this->createMock('\phpbb\request\request'); + $template = $this->createMock('\phpbb\template\template'); $this->field = new \phpbb\profilefields\type\type_googleplus( $request, diff --git a/tests/profilefields/type_int_test.php b/tests/profilefields/type_int_test.php index 33f3f575c8..943f130835 100644 --- a/tests/profilefields/type_int_test.php +++ b/tests/profilefields/type_int_test.php @@ -22,11 +22,11 @@ class phpbb_profilefield_type_int_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); @@ -34,8 +34,8 @@ class phpbb_profilefield_type_int_test extends phpbb_test_case ->method('lang') ->will($this->returnCallback(array($this, 'return_callback_implode'))); - $request = $this->getMock('\phpbb\request\request'); - $template = $this->getMock('\phpbb\template\template'); + $request = $this->createMock('\phpbb\request\request'); + $template = $this->createMock('\phpbb\template\template'); $this->cp = new \phpbb\profilefields\type\type_int( $request, diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php index 54bb406838..19bfbbc926 100644 --- a/tests/profilefields/type_string_test.php +++ b/tests/profilefields/type_string_test.php @@ -22,11 +22,11 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $config, $request, $user, $cache, $phpbb_root_path, $phpEx; - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); @@ -36,8 +36,8 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case ->will($this->returnCallback(array($this, 'return_callback_implode'))); $config = new \phpbb\config\config([]); - $request = $this->getMock('\phpbb\request\request'); - $template = $this->getMock('\phpbb\template\template'); + $request = $this->createMock('\phpbb\request\request'); + $template = $this->createMock('\phpbb\template\template'); $this->cp = new \phpbb\profilefields\type\type_string( $request, diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php index 3bb5d52899..5ed5fb4c2f 100644 --- a/tests/profilefields/type_url_test.php +++ b/tests/profilefields/type_url_test.php @@ -26,13 +26,13 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $config, $request, $user, $cache, $phpbb_root_path, $phpEx; $config = new \phpbb\config\config([]); $cache = new phpbb_mock_cache; - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); @@ -40,8 +40,8 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case ->method('lang') ->will($this->returnCallback(array($this, 'return_callback_implode'))); - $request = $this->getMock('\phpbb\request\request'); - $template = $this->getMock('\phpbb\template\template'); + $request = $this->createMock('\phpbb\request\request'); + $template = $this->createMock('\phpbb\template\template'); $this->cp = new \phpbb\profilefields\type\type_url( $request, diff --git a/tests/random/gen_rand_string_test.php b/tests/random/gen_rand_string_test.php index 428db6ac98..044fd3cc15 100644 --- a/tests/random/gen_rand_string_test.php +++ b/tests/random/gen_rand_string_test.php @@ -17,7 +17,7 @@ class phpbb_random_gen_rand_string_test extends phpbb_test_case const MIN_STRING_LENGTH = 1; const MAX_STRING_LENGTH = 15; - public function setUp() + public function setUp(): void { global $config; diff --git a/tests/regex/email_test.php b/tests/regex/email_test.php index 5187b8bda6..7b10b0a6ef 100644 --- a/tests/regex/email_test.php +++ b/tests/regex/email_test.php @@ -15,7 +15,7 @@ class phpbb_regex_email_test extends phpbb_test_case { protected $regex; - public function setUp() + public function setUp(): void { $this->regex = '#^' . get_preg_expression('email') . '$#i'; } @@ -36,7 +36,7 @@ class phpbb_regex_email_test extends phpbb_test_case //array('"John Doe"@example.com'), //array('Alice@[192.168.2.1]'), // IPv4 //array('Bob@[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]'), // IPv6 - + // http://fightingforalostcause.net/misc/2006/compare-email-regex.php array('l3tt3rsAndNumb3rs@domain.com'), array('has-dash@domain.com'), @@ -80,7 +80,7 @@ class phpbb_regex_email_test extends phpbb_test_case array('abc,def@example.com'), // invalid character , array('abc<def@example.com'), // invalid character < array('abc>def@example.com'), // invalid character > - + // http://fightingforalostcause.net/misc/2006/compare-email-regex.php array('missingDomain@.com'), array('@missingLocal.org'), diff --git a/tests/regex/ipv4_test.php b/tests/regex/ipv4_test.php index e21a2d77fa..5d859c240b 100644 --- a/tests/regex/ipv4_test.php +++ b/tests/regex/ipv4_test.php @@ -15,7 +15,7 @@ class phpbb_regex_ipv4_test extends phpbb_test_case { protected $regex; - public function setUp() + public function setUp(): void { $this->regex = get_preg_expression('ipv4'); } diff --git a/tests/regex/ipv6_test.php b/tests/regex/ipv6_test.php index 223161df7f..d4a86015ae 100644 --- a/tests/regex/ipv6_test.php +++ b/tests/regex/ipv6_test.php @@ -15,7 +15,7 @@ class phpbb_regex_ipv6_test extends phpbb_test_case { protected $regex; - public function setUp() + public function setUp(): void { $this->regex = get_preg_expression('ipv6'); } diff --git a/tests/request/deactivated_super_global_test.php b/tests/request/deactivated_super_global_test.php index d45f9ca666..eabc79ed96 100644 --- a/tests/request/deactivated_super_global_test.php +++ b/tests/request/deactivated_super_global_test.php @@ -19,7 +19,7 @@ class phpbb_deactivated_super_global_test extends phpbb_test_case public function test_write_triggers_error() { $this->setExpectedTriggerError(E_USER_ERROR); - $obj = new \phpbb\request\deactivated_super_global($this->getMock('\phpbb\request\request_interface'), 'obj', \phpbb\request\request_interface::POST); + $obj = new \phpbb\request\deactivated_super_global($this->createMock('\phpbb\request\request_interface'), 'obj', \phpbb\request\request_interface::POST); $obj->offsetSet(0, 0); } } diff --git a/tests/request/request_test.php b/tests/request/request_test.php index ebaea1f9ef..d03253ceb9 100644 --- a/tests/request/request_test.php +++ b/tests/request/request_test.php @@ -19,7 +19,7 @@ class phpbb_request_test extends phpbb_test_case /** @var \phpbb\request\request */ private $request; - protected function setUp() + protected function setUp(): void { // populate super globals $_POST['test'] = 1; @@ -39,7 +39,7 @@ class phpbb_request_test extends phpbb_test_case $_SERVER['HTTP_ACCEPT'] = 'application/json'; $_SERVER['HTTP_SOMEVAR'] = '<value>'; - $this->type_cast_helper = $this->getMock('\phpbb\request\type_cast_helper_interface'); + $this->type_cast_helper = $this->createMock('\phpbb\request\type_cast_helper_interface'); $this->request = new \phpbb\request\request($this->type_cast_helper); } @@ -264,7 +264,7 @@ class phpbb_request_test extends phpbb_test_case /** * Makes sure super globals work properly after these tests */ - protected function tearDown() + protected function tearDown(): void { $this->request->enable_super_globals(); } diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php index 84c81c4e84..8dc8e4c7c7 100644 --- a/tests/request/request_var_test.php +++ b/tests/request/request_var_test.php @@ -16,7 +16,7 @@ class phpbb_request_var_test extends phpbb_test_case /** * Makes sure request_var has its standard behaviour. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); request_var(false, false, false, false, false); diff --git a/tests/request/type_cast_helper_test.php b/tests/request/type_cast_helper_test.php index 6407dca894..5810c67b78 100644 --- a/tests/request/type_cast_helper_test.php +++ b/tests/request/type_cast_helper_test.php @@ -15,7 +15,7 @@ class phpbb_type_cast_helper_test extends phpbb_test_case { private $type_cast_helper; - protected function setUp() + protected function setUp(): void { $this->type_cast_helper = new \phpbb\request\type_cast_helper(); } diff --git a/tests/search/mysql_test.php b/tests/search/mysql_test.php index 3a791f5e81..7d3917296e 100644 --- a/tests/search/mysql_test.php +++ b/tests/search/mysql_test.php @@ -23,7 +23,7 @@ class phpbb_search_mysql_test extends phpbb_search_common_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); } - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx, $config, $user, $cache; diff --git a/tests/search/native_test.php b/tests/search/native_test.php index 0e6f719cef..2e11eaff14 100644 --- a/tests/search/native_test.php +++ b/tests/search/native_test.php @@ -23,7 +23,7 @@ class phpbb_search_native_test extends phpbb_search_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/posts.xml'); } - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx, $config, $user, $cache; diff --git a/tests/search/postgres_test.php b/tests/search/postgres_test.php index 97cca0e70c..7e2a6cec85 100644 --- a/tests/search/postgres_test.php +++ b/tests/search/postgres_test.php @@ -23,7 +23,7 @@ class phpbb_search_postgres_test extends phpbb_search_common_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); } - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx, $config, $user, $cache; diff --git a/tests/security/base.php b/tests/security/base.php index d2abdbc362..ad518b5543 100644 --- a/tests/security/base.php +++ b/tests/security/base.php @@ -18,7 +18,7 @@ abstract class phpbb_security_test_base extends phpbb_test_case /** * Set up the required user object and server variables for the suites */ - protected function setUp() + protected function setUp(): void { global $user, $phpbb_root_path, $phpEx, $request, $symfony_request, $phpbb_filesystem; @@ -60,7 +60,7 @@ abstract class phpbb_security_test_base extends phpbb_test_case $user->page = \phpbb\session::extract_current_page($phpbb_root_path); } - protected function tearDown() + protected function tearDown(): void { global $user; $user = NULL; diff --git a/tests/security/hash_test.php b/tests/security/hash_test.php index 84d4fcf479..40d14f24bf 100644 --- a/tests/security/hash_test.php +++ b/tests/security/hash_test.php @@ -13,12 +13,12 @@ class phpbb_security_hash_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { global $phpbb_container; $config = new \phpbb\config\config(array()); - $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $phpbb_container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); $driver_helper = new \phpbb\passwords\driver\helper($config); $passwords_drivers = array( 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $driver_helper), diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php index 0177eb4259..313e329e20 100644 --- a/tests/security/redirect_test.php +++ b/tests/security/redirect_test.php @@ -67,7 +67,7 @@ class phpbb_security_redirect_test extends phpbb_security_test_base new phpbb_mock_request() ), new \phpbb\filesystem\filesystem(), - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $this->phpbb_root_path, 'php' ); @@ -75,7 +75,7 @@ class phpbb_security_redirect_test extends phpbb_security_test_base return $this->path_helper; } - protected function setUp() + protected function setUp(): void { global $phpbb_dispatcher; diff --git a/tests/session/check_ban_test.php b/tests/session/check_ban_test.php index 16a65b0ade..0ee655f4ac 100644 --- a/tests/session/check_ban_test.php +++ b/tests/session/check_ban_test.php @@ -17,6 +17,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case { protected $user_id = 4; protected $key_id = 4; + /** @var \phpbb\session */ protected $session; protected $backup_cache; @@ -37,7 +38,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case ); } - public function setUp() + public function setUp(): void { parent::setUp(); // Get session here so that config is mocked correctly @@ -59,7 +60,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case ); } - public function tearDown() + public function tearDown(): void { parent::tearDown(); // Set cache back to what it was before the test changed it @@ -75,7 +76,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case $ban = $this->session->check_ban($user_id, $user_ips, $user_email, $return); $is_banned = !empty($ban); } - catch (PHPUnit_Framework_Error_Notice $e) + catch (PHPUnit\Framework\Error\Notice $e) { // User error was triggered, user must have been banned $is_banned = true; diff --git a/tests/session/garbage_collection_test.php b/tests/session/garbage_collection_test.php index 3dc591a328..d361e022da 100644 --- a/tests/session/garbage_collection_test.php +++ b/tests/session/garbage_collection_test.php @@ -22,7 +22,7 @@ class phpbb_session_garbage_collection_test extends phpbb_session_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_garbage.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->session = $this->session_factory->get_session($this->db); diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php index 6f8b49122b..d381b4cbbd 100644 --- a/tests/session/testable_factory.php +++ b/tests/session/testable_factory.php @@ -120,10 +120,10 @@ class phpbb_session_testable_factory /** * Check if the cache used for the generated session contains correct data. * - * @param PHPUnit_Framework_Assert $test The test case to call assert methods + * @param PHPUnit\Framework\Assert $test The test case to call assert methods * on */ - public function check(PHPUnit_Framework_Assert $test) + public function check(PHPUnit\Framework\Assert $test) { $this->cache->check($test, $this->get_cache_data()); } diff --git a/tests/template/context_test.php b/tests/template/context_test.php index 52ce6c8fde..a1be672f51 100644 --- a/tests/template/context_test.php +++ b/tests/template/context_test.php @@ -14,7 +14,7 @@ class context_test extends phpbb_test_case { protected $context; - protected function setUp() + protected function setUp(): void { $this->context = new \phpbb\template\context(); @@ -31,7 +31,7 @@ class context_test extends phpbb_test_case 'SUBFOO' => 'subfoo' . $j, 'SUBBAR' => 'subbar' . $j, )); - + for ($k = 0; $k < 10; $k++) { $this->context->assign_block_vars('block' . $i . '.subblock.subsubblock', array( diff --git a/tests/template/template_allfolder_test.php b/tests/template/template_allfolder_test.php index 63a6ef08ea..a9a8ecc287 100644 --- a/tests/template/template_allfolder_test.php +++ b/tests/template/template_allfolder_test.php @@ -40,7 +40,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case new phpbb_mock_request() ), $filesystem, - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, $phpEx ); @@ -75,7 +75,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case 'autoescape' => false, ) ); - $this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)), $this->extension_manager); + $this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user)), $this->extension_manager); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->template_path = $this->test_path . '/templates'; diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php index 3a93c91e11..9243390937 100644 --- a/tests/template/template_events_test.php +++ b/tests/template/template_events_test.php @@ -145,7 +145,7 @@ Zeta test event in all', new phpbb_mock_request() ), new \phpbb\filesystem\filesystem(), - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, $phpEx ); @@ -169,7 +169,7 @@ Zeta test event in all', 'autoescape' => false, ) ); - $this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)), $this->extension_manager); + $this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user)), $this->extension_manager); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path)); diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index 4eb30eda1e..5f9875a556 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -35,7 +35,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te new phpbb_mock_request() ), $filesystem, - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, $phpEx ); @@ -68,7 +68,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te $twig, $cache_path, $this->user, - array(new \phpbb\template\twig\extension($context, $this->user)), + array(new \phpbb\template\twig\extension($context, $twig, $this->user)), new phpbb_mock_extension_manager( dirname(__FILE__) . '/', array( diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 727f35e9d2..01c132e032 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -521,7 +521,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case $this->template->set_filenames(array('test' => $filename)); $this->assertFileNotExists($this->template_path . '/' . $filename, 'Testing missing file, file cannot exist'); - $this->setExpectedException('Twig_Error_Loader'); + $this->expectException('Twig_Error_Loader'); $this->display('test'); } @@ -529,7 +529,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case public function test_invalid_handle() { - $this->setExpectedException('Twig_Error_Loader'); + $this->expectException('Twig_Error_Loader'); $this->display('test'); } diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index 8adbafb1b2..0389088ec8 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -87,7 +87,7 @@ class phpbb_template_template_test_case extends phpbb_test_case new phpbb_mock_request() ), $filesystem, - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, $phpEx ); @@ -113,12 +113,12 @@ class phpbb_template_template_test_case extends phpbb_test_case 'autoescape' => false, ) ); - $this->template = new phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user))); + $this->template = new phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user))); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->template->set_custom_style('tests', $this->template_path); } - protected function setUp() + protected function setUp(): void { // Test the engine can be used $this->setup_engine(); @@ -130,7 +130,7 @@ class phpbb_template_template_test_case extends phpbb_test_case $phpbb_filesystem = new \phpbb\filesystem\filesystem(); } - protected function tearDown() + protected function tearDown(): void { if ($this->template) { diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php index 75e3918f44..c0238b6f03 100644 --- a/tests/template/template_test_case_with_tree.php +++ b/tests/template/template_test_case_with_tree.php @@ -29,7 +29,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat new phpbb_mock_request() ), $filesystem, - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, $phpEx ); @@ -56,7 +56,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat 'autoescape' => false, ) ); - $this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user))); + $this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user))); $twig->setLexer(new \phpbb\template\twig\lexer($twig)); $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path)); } diff --git a/tests/template/templates/expressions.html b/tests/template/templates/expressions.html index e1283f165f..17a5b8d265 100644 --- a/tests/template/templates/expressions.html +++ b/tests/template/templates/expressions.html @@ -3,7 +3,7 @@ <!-- IF not 390 is even -->fail<!-- ELSE -->pass<!-- ENDIF --> <!-- IF 9 is odd -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 32 is odd -->fail<!-- ELSE -->pass<!-- ENDIF --> -<!-- IF 32 is div by 16 -->pass<!-- ELSE -->fail<!-- ENDIF --> +<!-- IF 32 is divisible by(16) -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 10 is not even -->fail<!-- ELSE -->pass<!-- ENDIF --> <!-- IF 24 == 24 -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 24 eq 24 -->pass<!-- ELSE -->fail<!-- ENDIF --> diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index 606c40a623..c098ff64bd 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -11,7 +11,9 @@ * */ -abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_TestCase +use PHPUnit\DbUnit\TestCase; + +abstract class phpbb_database_test_case extends TestCase { static private $already_connected; @@ -31,10 +33,10 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test { parent::__construct($name, $data, $dataName); $this->backupStaticAttributesBlacklist += array( - 'PHP_CodeCoverage' => array('instance'), - 'PHP_CodeCoverage_Filter' => array('instance'), - 'PHP_CodeCoverage_Util' => array('ignoredLines', 'templateMethods'), - 'PHP_Timer' => array('startTimes',), + 'SebastianBergmann\CodeCoverage\CodeCoverage' => array('instance'), + 'SebastianBergmann\CodeCoverage\Filter' => array('instance'), + 'SebastianBergmann\CodeCoverage\Util' => array('ignoredLines', 'templateMethods'), + 'SebastianBergmann\Timer\Timer' => array('startTimes',), 'PHP_Token_Stream' => array('customTokens'), 'PHP_Token_Stream_CachingFactory' => array('cache'), @@ -99,7 +101,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test parent::tearDownAfterClass(); } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); @@ -113,7 +115,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test } } - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -146,7 +148,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test * Create xml data set for insertion into database * * @param string $path Path to fixture XML - * @return PHPUnit_Extensions_Database_DataSet_DefaultDataSet|PHPUnit_Extensions_Database_DataSet_XmlDataSet + * @return PHPUnit\DbUnit\DataSet\DefaultDataSet|PHPUnit\DbUnit\DataSet\XmlDataSet */ public function createXMLDataSet($path) { @@ -155,11 +157,11 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test // Extend XML data set on MSSQL if (strpos($this->get_database_config()['dbms'], 'mssql') !== false) { - $newXmlData = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet(); + $newXmlData = new PHPUnit\DbUnit\DataSet\DefaultDataSet([]); $db = $this->new_dbal(); foreach ($this->fixture_xml_data as $key => $value) { - /** @var \PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData $tableMetaData */ + /** @var PHPUnit\DbUnit\DataSet\DefaultTableMetaData $tableMetaData */ $tableMetaData = $value->getTableMetaData(); $columns = $tableMetaData->getColumns(); $primaryKeys = $tableMetaData->getPrimaryKeys(); @@ -201,8 +203,8 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test $columns[] = 'mssqlindex'; } - $newMetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($key, $columns, $primaryKeys); - $newTable = new PHPUnit_Extensions_Database_DataSet_DefaultTable($newMetaData); + $newMetaData = new PHPUnit\DbUnit\DataSet\DefaultTableMetaData($key, $columns, $primaryKeys); + $newTable = new PHPUnit\DbUnit\DataSet\DefaultTable($newMetaData); for ($i = 0; $i < $value->getRowCount(); $i++) { $dataRow = $value->getRow($i); diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 4d294fd523..b594e48864 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -75,7 +75,7 @@ class phpbb_functional_test_case extends phpbb_test_case return array(); } - public function setUp() + public function setUp(): void { parent::setUp(); @@ -114,7 +114,7 @@ class phpbb_functional_test_case extends phpbb_test_case } } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); @@ -424,9 +424,9 @@ class phpbb_functional_test_case extends phpbb_test_case $ext_path = str_replace('/', '%2F', $extension); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertGreaterThan(0, $crawler->filter('.submit-buttons')->count()); + $this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count()); - $form = $crawler->selectButton('Enable')->form(); + $form = $crawler->selectButton('confirm')->form(); $crawler = self::submit($form); $this->add_lang('acp/extensions'); @@ -446,6 +446,72 @@ class phpbb_functional_test_case extends phpbb_test_case $this->logout(); } + public function disable_ext($extension) + { + $this->login(); + $this->admin_login(); + + $ext_path = str_replace('/', '%2F', $extension); + + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); + $this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count()); + + $form = $crawler->selectButton('confirm')->form(); + $crawler = self::submit($form); + $this->add_lang('acp/extensions'); + + $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); + + // Wait for extension to be fully enabled + while (count($meta_refresh)) + { + preg_match('#url=.+/(adm+.+)#', $meta_refresh->attr('content'), $match); + $url = $match[1]; + $crawler = self::request('POST', $url); + $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); + } + + $this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('div.successbox')->text()); + + $this->logout(); + } + + public function delete_ext_data($extension) + { + $this->login(); + $this->admin_login(); + + $ext_path = str_replace('/', '%2F', $extension); + + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); + $this->assertGreaterThan(1, $crawler->filter('div.main fieldset div input.button2')->count()); + + $form = $crawler->selectButton('confirm')->form(); + $crawler = self::submit($form); + $this->add_lang('acp/extensions'); + + $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); + + // Wait for extension to be fully enabled + while (count($meta_refresh)) + { + preg_match('#url=.+/(adm+.+)#', $meta_refresh->attr('content'), $match); + $url = $match[1]; + $crawler = self::request('POST', $url); + $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); + } + + $this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $crawler->filter('div.successbox')->text()); + + $this->logout(); + } + + public function uninstall_ext($extension) + { + $this->disable_ext($extension); + $this->delete_ext_data($extension); + } + static private function recreate_database($config) { $db_conn_mgr = new phpbb_database_test_connection_manager($config); @@ -632,11 +698,11 @@ class phpbb_functional_test_case extends phpbb_test_case $db = $this->get_db(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); $cache = new phpbb_mock_null_cache; @@ -674,17 +740,17 @@ class phpbb_functional_test_case extends phpbb_test_case $db = $this->get_db(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); - $auth = $this->getMock('\phpbb\auth\auth'); + $auth = $this->createMock('\phpbb\auth\auth'); $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); $cache = new phpbb_mock_null_cache; $cache_driver = new \phpbb\cache\driver\dummy(); - $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $phpbb_container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); $phpbb_container ->expects($this->any()) ->method('get') @@ -854,7 +920,7 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $haystack Search this * @param string $message Optional failure message */ - public function assertContainsLang($needle, $haystack, $message = null) + public function assertContainsLang($needle, $haystack, $message = '') { $this->assertContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message); } @@ -866,7 +932,7 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $haystack Search this * @param string $message Optional failure message */ - public function assertNotContainsLang($needle, $haystack, $message = null) + public function assertNotContainsLang($needle, $haystack, $message = '') { $this->assertNotContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message); } diff --git a/tests/test_framework/phpbb_session_test_case.php b/tests/test_framework/phpbb_session_test_case.php index b3d7780d14..02722c473e 100644 --- a/tests/test_framework/phpbb_session_test_case.php +++ b/tests/test_framework/phpbb_session_test_case.php @@ -25,7 +25,7 @@ abstract class phpbb_session_test_case extends phpbb_database_test_case /** @var \phpbb\db\driver\driver_interface */ protected $db; - function setUp() + function setUp(): void { parent::setUp(); @@ -37,7 +37,7 @@ abstract class phpbb_session_test_case extends phpbb_database_test_case $phpbb_path_helper = new \phpbb\path_helper( $symfony_request, $phpbb_filesystem, - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, $phpEx ); diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php index 01d26fb67d..8e09f17ede 100644 --- a/tests/test_framework/phpbb_test_case.php +++ b/tests/test_framework/phpbb_test_case.php @@ -11,7 +11,9 @@ * */ -class phpbb_test_case extends PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class phpbb_test_case extends TestCase { protected $test_case_helpers; @@ -19,10 +21,10 @@ class phpbb_test_case extends PHPUnit_Framework_TestCase { parent::__construct($name, $data, $dataName); $this->backupStaticAttributesBlacklist += array( - 'PHP_CodeCoverage' => array('instance'), - 'PHP_CodeCoverage_Filter' => array('instance'), - 'PHP_CodeCoverage_Util' => array('ignoredLines', 'templateMethods'), - 'PHP_Timer' => array('startTimes',), + 'SebastianBergmann\CodeCoverage\CodeCoverage' => array('instance'), + 'SebastianBergmann\CodeCoverage\Filter' => array('instance'), + 'SebastianBergmann\CodeCoverage\Util' => array('ignoredLines', 'templateMethods'), + 'SebastianBergmann\Timer\Timer' => array('startTimes',), 'PHP_Token_Stream' => array('customTokens'), 'PHP_Token_Stream_CachingFactory' => array('cache'), diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index c792976b1e..807a64d810 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -81,21 +81,26 @@ class phpbb_test_case_helpers { case E_NOTICE: case E_STRICT: - PHPUnit_Framework_Error_Notice::$enabled = true; - $exceptionName = 'PHPUnit_Framework_Error_Notice'; + PHPUnit\Framework\Error\Notice::$enabled = true; + $exceptionName = 'PHPUnit\Framework\Error\Notice'; break; case E_WARNING: - PHPUnit_Framework_Error_Warning::$enabled = true; - $exceptionName = 'PHPUnit_Framework_Error_Warning'; + PHPUnit\Framework\Error\Warning::$enabled = true; + $exceptionName = 'PHPUnit\Framework\Error\Warning'; break; default: - $exceptionName = 'PHPUnit_Framework_Error'; + $exceptionName = 'PHPUnit\Framework\Error\Error'; break; } $this->expectedTriggerError = true; - $this->test_case->setExpectedException($exceptionName, (string) $message, $errno); + $this->test_case->expectException($exceptionName); + $this->test_case->expectExceptionCode($errno); + if ($message) + { + $this->test_case->expectExceptionMessage((string) $message); + } } public function makedirs($path) @@ -382,10 +387,16 @@ class phpbb_test_case_helpers } // Mock the DAL, make it return data from the fixture + $db_driver = $this->test_case->getMockBuilder('phpbb\\db\\driver\\driver') + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableArgumentCloning() + ->disallowMockingUnknownTypes() + ->getMock(); $mb = $this->test_case->getMockBuilder('phpbb\\textformatter\\data_access'); $mb->setMethods(array('get_bbcodes', 'get_censored_words', 'get_smilies', 'get_styles')); $mb->setConstructorArgs(array( - $this->test_case->getMockBuilder('phpbb\\db\\driver\\driver')->getMock(), + $db_driver, 'phpbb_bbcodes', 'phpbb_smilies', 'phpbb_styles', diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php index 7b950a7d5d..914de2e02a 100644 --- a/tests/test_framework/phpbb_ui_test_case.php +++ b/tests/test_framework/phpbb_ui_test_case.php @@ -52,15 +52,10 @@ class phpbb_ui_test_case extends phpbb_test_case { parent::setUpBeforeClass(); - if (version_compare(PHP_VERSION, '5.3.19', '<')) - { - self::markTestSkipped('UI test case requires at least PHP 5.3.19.'); - } - else if (!class_exists('\Facebook\WebDriver\Remote\RemoteWebDriver')) + if (!class_exists('\Facebook\WebDriver\Remote\RemoteWebDriver')) { self::markTestSkipped( - 'Could not find RemoteWebDriver class. ' . - 'Run "php ../composer.phar install" from the tests folder.' + 'Could not find RemoteWebDriver class.' ); } @@ -105,7 +100,7 @@ class phpbb_ui_test_case extends phpbb_test_case return array(); } - public function setUp() + public function setUp(): void { if (!self::$install_success) { @@ -137,7 +132,7 @@ class phpbb_ui_test_case extends phpbb_test_case } } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); @@ -322,9 +317,9 @@ class phpbb_ui_test_case extends phpbb_test_case $ext_path = str_replace('/', '%2F', $extension); $this->visit('adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertNotEmpty(count($this->find_element('cssSelector', '.submit-buttons'))); + $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2'))); - $this->find_element('cssSelector', "input[value='Enable']")->submit(); + $this->find_element('cssSelector', "input[value='Yes']")->submit(); $this->add_lang('acp/extensions'); try @@ -349,6 +344,82 @@ class phpbb_ui_test_case extends phpbb_test_case $this->logout(); } + public function disable_ext($extension) + { + $this->login(); + $this->admin_login(); + + $ext_path = str_replace('/', '%2F', $extension); + + $this->visit('adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); + $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2'))); + + $this->find_element('cssSelector', "input[value='Yes']")->submit(); + $this->add_lang('acp/extensions'); + + try + { + $meta_refresh = $this->find_element('cssSelector', 'meta[http-equiv="refresh"]'); + + // Wait for extension to be fully enabled + while (count($meta_refresh)) + { + preg_match('#url=.+/(adm+.+)#', $meta_refresh->getAttribute('content'), $match); + $this->getDriver()->execute(array('method' => 'post', 'url' => $match[1])); + $meta_refresh = $this->find_element('cssSelector', 'meta[http-equiv="refresh"]'); + } + } + catch (\Facebook\WebDriver\Exception\NoSuchElementException $e) + { + // Probably no refresh triggered + } + + $this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $this->find_element('cssSelector', 'div.successbox')->getText()); + + $this->logout(); + } + + public function delete_ext_data($extension) + { + $this->login(); + $this->admin_login(); + + $ext_path = str_replace('/', '%2F', $extension); + + $this->visit('adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); + $this->assertNotEmpty(count($this->find_element('cssSelector', 'div.main fieldset div input.button2'))); + + $this->find_element('cssSelector', "input[value='Yes']")->submit(); + $this->add_lang('acp/extensions'); + + try + { + $meta_refresh = $this->find_element('cssSelector', 'meta[http-equiv="refresh"]'); + + // Wait for extension to be fully enabled + while (count($meta_refresh)) + { + preg_match('#url=.+/(adm+.+)#', $meta_refresh->getAttribute('content'), $match); + $this->getDriver()->execute(array('method' => 'post', 'url' => $match[1])); + $meta_refresh = $this->find_element('cssSelector', 'meta[http-equiv="refresh"]'); + } + } + catch (\Facebook\WebDriver\Exception\NoSuchElementException $e) + { + // Probably no refresh triggered + } + + $this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $this->find_element('cssSelector', 'div.successbox')->getText()); + + $this->logout(); + } + + public function uninstall_ext($extension) + { + $this->disable_ext($extension); + $this->delete_ext_data($extension); + } + protected function get_cache_driver() { if (!$this->cache) diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index 0d780a19a9..d3be7d2fb4 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/../../test_framework/phpbb_database_test_case.php'; class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case { - public function setUp() + public function setUp(): void { $this->cache = new phpbb_mock_cache; $this->dispatcher = new phpbb_mock_event_dispatcher; @@ -286,7 +286,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case */ public function test_configure_events() { - $this->dispatcher = $this->getMock('phpbb\\event\\dispatcher_interface'); + $this->dispatcher = $this->createMock('phpbb\\event\\dispatcher_interface'); $this->dispatcher ->expects($this->at(0)) ->method('trigger_event') diff --git a/tests/text_formatter/s9e/parser_test.php b/tests/text_formatter/s9e/parser_test.php index 4b9bbf9bb2..e10ebd29ee 100644 --- a/tests/text_formatter/s9e/parser_test.php +++ b/tests/text_formatter/s9e/parser_test.php @@ -19,7 +19,7 @@ class phpbb_textformatter_s9e_parser_test extends phpbb_test_case ->disableOriginalConstructor() ->getMock(); - $cache = $this->getMock('phpbb_mock_cache'); + $cache = $this->createMock('phpbb_mock_cache'); $cache->expects($this->once()) ->method('get') ->with('_foo_parser') @@ -172,7 +172,7 @@ class phpbb_textformatter_s9e_parser_test extends phpbb_test_case public function test_setup_event() { $container = $this->get_test_case_helpers()->set_s9e_services(); - $dispatcher = $this->getMock('phpbb\\event\\dispatcher_interface'); + $dispatcher = $this->createMock('phpbb\\event\\dispatcher_interface'); $dispatcher ->expects($this->once()) ->method('trigger_event') @@ -202,7 +202,7 @@ class phpbb_textformatter_s9e_parser_test extends phpbb_test_case public function test_parse_event() { $container = $this->get_test_case_helpers()->set_s9e_services(); - $dispatcher = $this->getMock('phpbb\\event\\dispatcher_interface'); + $dispatcher = $this->createMock('phpbb\\event\\dispatcher_interface'); $dispatcher ->expects($this->any()) ->method('trigger_event') diff --git a/tests/text_formatter/s9e/renderer_test.php b/tests/text_formatter/s9e/renderer_test.php index 175b90fdc7..672069590a 100644 --- a/tests/text_formatter/s9e/renderer_test.php +++ b/tests/text_formatter/s9e/renderer_test.php @@ -26,7 +26,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case '<?php class renderer_foo { public function setParameter() {} }' ); - $cache = $this->getMock('phpbb_mock_cache'); + $cache = $this->createMock('phpbb_mock_cache'); $cache->expects($this->once()) ->method('get') ->with('_foo_renderer') @@ -50,7 +50,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case { $mock = $this->getMockForAbstractClass('s9e\\TextFormatter\\Renderer'); - $cache = $this->getMock('phpbb_mock_cache'); + $cache = $this->createMock('phpbb_mock_cache'); $cache->expects($this->once()) ->method('get') ->with('_foo_renderer') @@ -197,7 +197,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case $config = new \phpbb\config\config(array('allow_nocensors' => true)); - $auth = $test->getMock('phpbb\\auth\\auth'); + $auth = $test->createMock('phpbb\\auth\\auth'); $auth->expects($test->any()) ->method('acl_get') ->with('u_chgcensors') @@ -393,7 +393,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case public function test_setup_event() { $container = $this->get_test_case_helpers()->set_s9e_services(); - $dispatcher = $this->getMock('phpbb\\event\\dispatcher_interface'); + $dispatcher = $this->createMock('phpbb\\event\\dispatcher_interface'); $dispatcher ->expects($this->once()) ->method('trigger_event') @@ -424,7 +424,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case public function test_render_event() { $container = $this->get_test_case_helpers()->set_s9e_services(); - $dispatcher = $this->getMock('phpbb\\event\\dispatcher_interface'); + $dispatcher = $this->createMock('phpbb\\event\\dispatcher_interface'); $dispatcher ->expects($this->any()) ->method('trigger_event') diff --git a/tests/text_processing/decode_message_test.php b/tests/text_processing/decode_message_test.php index e2402e721a..805dd89039 100644 --- a/tests/text_processing/decode_message_test.php +++ b/tests/text_processing/decode_message_test.php @@ -13,7 +13,7 @@ class phpbb_text_processing_decode_message_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php index 86bc803c98..f7da27cc35 100644 --- a/tests/text_processing/generate_text_for_display_test.php +++ b/tests/text_processing/generate_text_for_display_test.php @@ -13,7 +13,7 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { global $cache, $user, $phpbb_dispatcher; @@ -77,7 +77,7 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca $config = new \phpbb\config\config(array('allow_nocensors' => true)); - $auth = $this->getMock('phpbb\\auth\\auth'); + $auth = $this->createMock('phpbb\\auth\\auth'); $auth->expects($this->any()) ->method('acl_get') ->with('u_chgcensors') diff --git a/tests/text_processing/generate_text_for_storage_test.php b/tests/text_processing/generate_text_for_storage_test.php index f0588fec4f..c6c62c7579 100644 --- a/tests/text_processing/generate_text_for_storage_test.php +++ b/tests/text_processing/generate_text_for_storage_test.php @@ -13,7 +13,7 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { global $config, $phpbb_container, $phpbb_dispatcher; diff --git a/tests/text_reparser/base_test.php b/tests/text_reparser/base_test.php index 2c6844b063..59604da4e3 100644 --- a/tests/text_reparser/base_test.php +++ b/tests/text_reparser/base_test.php @@ -17,7 +17,7 @@ class phpbb_textreparser_base_test extends phpbb_database_test_case { protected $db; - public function setUp() + public function setUp(): void { global $config; if (!isset($config)) diff --git a/tests/text_reparser/manager_test.php b/tests/text_reparser/manager_test.php index df6adacb66..afa557deff 100644 --- a/tests/text_reparser/manager_test.php +++ b/tests/text_reparser/manager_test.php @@ -30,7 +30,7 @@ class phpbb_text_reparser_manager_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config_text.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/text_reparser/plugins/contact_admin_info_test.php b/tests/text_reparser/plugins/contact_admin_info_test.php index 757b02be39..690d3a4046 100644 --- a/tests/text_reparser/plugins/contact_admin_info_test.php +++ b/tests/text_reparser/plugins/contact_admin_info_test.php @@ -39,7 +39,7 @@ class phpbb_textreparser_contact_admin_info_test extends phpbb_database_test_cas return $rows; } - public function setUp() + public function setUp(): void { global $config; if (!isset($config)) diff --git a/tests/text_reparser/plugins/poll_option_test.php b/tests/text_reparser/plugins/poll_option_test.php index 177faac51d..32fb8a0411 100644 --- a/tests/text_reparser/plugins/poll_option_test.php +++ b/tests/text_reparser/plugins/poll_option_test.php @@ -39,7 +39,7 @@ class phpbb_textreparser_poll_option_test extends phpbb_database_test_case return $rows; } - public function setUp() + public function setUp(): void { global $config; if (!isset($config)) diff --git a/tests/text_reparser/plugins/test_row_based_plugin.php b/tests/text_reparser/plugins/test_row_based_plugin.php index 3e9ff09448..cf913c9c1e 100644 --- a/tests/text_reparser/plugins/test_row_based_plugin.php +++ b/tests/text_reparser/plugins/test_row_based_plugin.php @@ -39,7 +39,7 @@ abstract class phpbb_textreparser_test_row_based_plugin extends phpbb_database_t return $rows; } - public function setUp() + public function setUp(): void { global $config; if (!isset($config)) diff --git a/tests/tree/nestedset_forum_base.php b/tests/tree/nestedset_forum_base.php index 498c6a69a2..e91e816b2a 100644 --- a/tests/tree/nestedset_forum_base.php +++ b/tests/tree/nestedset_forum_base.php @@ -48,7 +48,7 @@ class phpbb_tests_tree_nestedset_forum_base extends phpbb_database_test_case $lock, $db; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index b41b95d925..656b801372 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -28,7 +28,7 @@ class phpbb_filespec_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { // Global $config required by unique_id global $config, $phpbb_root_path, $phpEx; @@ -101,7 +101,7 @@ class phpbb_filespec_test extends phpbb_test_case return $filespec->set_upload_ary(array_merge($upload_ary, $override)); } - protected function tearDown() + protected function tearDown(): void { $this->config = array(); @@ -420,7 +420,7 @@ class phpbb_filespec_test extends phpbb_test_case /** * @dataProvider data_move_file_copy */ - public function test_move_file_copy($tmp_name, $move_success, $safe_mode_on, $expected_error) + public function test_move_file_copy($tmp_name, $move_success, $open_basedir_on, $expected_error) { // Initialise a blank filespec object for use with trivial methods $upload_ary = array( @@ -436,7 +436,7 @@ class phpbb_filespec_test extends phpbb_test_case $php_ini->expects($this->any()) ->method('getBool') ->with($this->anything()) - ->willReturn($safe_mode_on); + ->willReturn($open_basedir_on); $upload = new phpbb_mock_fileupload(); $upload->max_filesize = self::UPLOAD_MAX_FILESIZE; $filespec = new \phpbb\files\filespec($this->filesystem, $this->language, $php_ini, new \FastImageSize\FastImagesize, '', $this->mimetype_guesser); diff --git a/tests/upload/fileupload_test.php b/tests/upload/fileupload_test.php index 5b3357237d..ca9259d357 100644 --- a/tests/upload/fileupload_test.php +++ b/tests/upload/fileupload_test.php @@ -37,7 +37,7 @@ class phpbb_fileupload_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { // Global $config required by unique_id global $config, $phpbb_root_path, $phpEx; @@ -50,7 +50,7 @@ class phpbb_fileupload_test extends phpbb_test_case $config['rand_seed'] = ''; $config['rand_seed_last_update'] = time() + 600; - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper; $this->filesystem = new \phpbb\filesystem\filesystem(); @@ -83,13 +83,13 @@ class phpbb_fileupload_test extends phpbb_test_case $this->php_ini, $plupload, $this->request - ), phpbb_mock_container_builder::SCOPE_PROTOTYPE); + )); $this->container->set('files.types.local', new \phpbb\files\types\local( $this->factory, $this->language, $this->php_ini, $this->request - ), phpbb_mock_container_builder::SCOPE_PROTOTYPE); + )); $this->path = __DIR__ . '/fixture/'; $this->phpbb_root_path = $phpbb_root_path; @@ -107,7 +107,7 @@ class phpbb_fileupload_test extends phpbb_test_case return $filespec; } - protected function tearDown() + protected function tearDown(): void { // Clear globals global $config, $user; diff --git a/tests/upload/imagesize_test.php b/tests/upload/imagesize_test.php index 5429bb5c5e..3adf61dedc 100644 --- a/tests/upload/imagesize_test.php +++ b/tests/upload/imagesize_test.php @@ -20,7 +20,7 @@ class phpbb_upload_imagesize_test extends \phpbb_test_case /** @var string Path to fixtures */ protected $path; - public function setUp() + public function setUp(): void { parent::setUp(); $this->imagesize = new \FastImageSize\FastImageSize(); diff --git a/tests/user/user_loader_test.php b/tests/user/user_loader_test.php index f871f324ca..f283e993dc 100644 --- a/tests/user/user_loader_test.php +++ b/tests/user/user_loader_test.php @@ -21,7 +21,7 @@ class phpbb_user_loader_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_loader.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/version/version_fetch_test.php b/tests/version/version_fetch_test.php index c44bd5514a..188b371c47 100644 --- a/tests/version/version_fetch_test.php +++ b/tests/version/version_fetch_test.php @@ -16,7 +16,7 @@ */ class phpbb_version_helper_fetch_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/version/version_helper_remote_test.php b/tests/version/version_helper_remote_test.php index 35c3d92a3a..e15ff897b0 100644 --- a/tests/version/version_helper_remote_test.php +++ b/tests/version/version_helper_remote_test.php @@ -17,7 +17,7 @@ class version_helper_remote_test extends \phpbb_test_case protected $cache; protected $version_helper; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -30,7 +30,11 @@ class version_helper_remote_test extends \phpbb_test_case )); $container = new \phpbb_mock_container_builder(); $db = new \phpbb\db\driver\factory($container); - $this->cache = $this->getMock('\phpbb\cache\service', array('get'), array(new \phpbb\cache\driver\dummy(), $config, $db, '../../', 'php')); + $this->cache = $this->getMockBuilder('\phpbb\cache\service') + ->setMethods(array('get')) + ->setConstructorArgs(array(new \phpbb\cache\driver\dummy(), $config, $db, '../../', 'php')) + ->getMock(); + $this->cache->expects($this->any()) ->method('get') ->with($this->anything()) diff --git a/tests/version/version_test.php b/tests/version/version_test.php index 2a0240f847..3298213487 100644 --- a/tests/version/version_test.php +++ b/tests/version/version_test.php @@ -13,7 +13,7 @@ class phpbb_version_helper_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/viewonline/helper_test.php b/tests/viewonline/helper_test.php index 6540d33287..d7c9965ad1 100644 --- a/tests/viewonline/helper_test.php +++ b/tests/viewonline/helper_test.php @@ -13,7 +13,7 @@ class phpbb_viewonline_helper_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/wrapper/phpbb_php_ini_test.php b/tests/wrapper/phpbb_php_ini_test.php index 5827744702..d6ce11219f 100644 --- a/tests/wrapper/phpbb_php_ini_test.php +++ b/tests/wrapper/phpbb_php_ini_test.php @@ -18,7 +18,7 @@ class phpbb_wrapper_phpbb_php_ini_test extends phpbb_test_case /** @var \phpbb_php_ini_fake php_ini */ protected $php_ini; - public function setUp() + public function setUp(): void { $this->php_ini = new phpbb_php_ini_fake; } diff --git a/travis/phpunit-mariadb-travis.xml b/travis/phpunit-mariadb-travis.xml index 53a206b9b0..35ade72d4e 100644 --- a/travis/phpunit-mariadb-travis.xml +++ b/travis/phpunit-mariadb-travis.xml @@ -1,14 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="true" - backupStaticAttributes="true" + backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="true" - strict="true" verbose="true" bootstrap="../tests/bootstrap.php"> <testsuites> @@ -19,10 +17,10 @@ <exclude>../tests/ui</exclude> </testsuite> <testsuite name="phpBB Functional Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> + <directory suffix="_test.php">../tests/functional</directory> </testsuite> <testsuite name="phpBB UI Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory> + <directory suffix="_test.php">../tests/ui</directory> </testsuite> </testsuites> diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml deleted file mode 100644 index d0d3e3c0c0..0000000000 --- a/travis/phpunit-mysql-travis.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<phpunit backupGlobals="true" - backupStaticAttributes="true" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - processIsolation="false" - stopOnFailure="false" - syntaxCheck="true" - strict="true" - verbose="true" - bootstrap="../tests/bootstrap.php"> - <testsuites> - <testsuite name="phpBB Test Suite"> - <directory suffix="_test.php">../tests</directory> - <exclude>../tests/functional</exclude> - <exclude>../tests/lint_test.php</exclude> - <exclude>../tests/ui</exclude> - </testsuite> - <testsuite name="phpBB Functional Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> - </testsuite> - <testsuite name="phpBB UI Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory> - </testsuite> - </testsuites> - - <groups> - <exclude> - <group>slow</group> - </exclude> - </groups> - - <php> - <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysql" /> - <server name="PHPBB_TEST_DBHOST" value="0.0.0.0" /> - <server name="PHPBB_TEST_DBPORT" value="3306" /> - <server name="PHPBB_TEST_DBNAME" value="phpbb_tests" /> - <server name="PHPBB_TEST_DBUSER" value="root" /> - <server name="PHPBB_TEST_DBPASSWD" value="" /> - <server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> - <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> - <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> - </php> -</phpunit> diff --git a/travis/phpunit-mysqli-travis.xml b/travis/phpunit-mysqli-travis.xml index b12ae6fe8b..d2284086b9 100644 --- a/travis/phpunit-mysqli-travis.xml +++ b/travis/phpunit-mysqli-travis.xml @@ -1,14 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="true" - backupStaticAttributes="true" + backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="true" - strict="true" verbose="true" bootstrap="../tests/bootstrap.php"> <testsuites> @@ -19,10 +17,10 @@ <exclude>../tests/ui</exclude> </testsuite> <testsuite name="phpBB Functional Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> + <directory suffix="_test.php">../tests/functional</directory> </testsuite> <testsuite name="phpBB UI Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory> + <directory suffix="_test.php">../tests/ui</directory> </testsuite> </testsuites> diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml index fa497a1264..6faab4d61a 100644 --- a/travis/phpunit-postgres-travis.xml +++ b/travis/phpunit-postgres-travis.xml @@ -1,14 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="true" - backupStaticAttributes="true" + backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="true" - strict="true" verbose="true" bootstrap="../tests/bootstrap.php"> <testsuites> @@ -19,10 +17,10 @@ <exclude>../tests/ui</exclude> </testsuite> <testsuite name="phpBB Functional Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> + <directory suffix="_test.php">../tests/functional</directory> </testsuite> <testsuite name="phpBB UI Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory> + <directory suffix="_test.php">../tests/ui</directory> </testsuite> </testsuites> diff --git a/travis/phpunit-sqlite3-travis.xml b/travis/phpunit-sqlite3-travis.xml index 5baab791e0..633963c9fb 100644 --- a/travis/phpunit-sqlite3-travis.xml +++ b/travis/phpunit-sqlite3-travis.xml @@ -1,14 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="true" - backupStaticAttributes="true" + backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="true" - strict="true" verbose="true" bootstrap="../tests/bootstrap.php"> <testsuites> @@ -19,10 +17,10 @@ <exclude>../tests/ui</exclude> </testsuite> <testsuite name="phpBB Functional Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> + <directory suffix="_test.php">../tests/functional</directory> </testsuite> <testsuite name="phpBB UI Tests"> - <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory> + <directory suffix="_test.php">../tests/ui</directory> </testsuite> </testsuites> diff --git a/travis/setup-database.sh b/travis/setup-database.sh index 3771f19073..cbd5e93e83 100755 --- a/travis/setup-database.sh +++ b/travis/setup-database.sh @@ -26,7 +26,7 @@ then psql -c 'create database phpbb_tests;' -U postgres fi -if [ "$TRAVIS_PHP_VERSION" == "5.4" -a "$DB" == "mysqli" ] +if [ "$TRAVIS_PHP_VERSION" == "5.6" -a "$DB" == "mysqli" ] then mysql -e 'SET GLOBAL storage_engine=MyISAM;' fi diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh index de27965e39..7d1400c3b3 100755 --- a/travis/setup-php-extensions.sh +++ b/travis/setup-php-extensions.sh @@ -42,16 +42,9 @@ function install_php_extension php_ini_file=$(find_php_ini) -# apc -if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.0-dev', '<');"` == "1" ] -then - echo 'Enabling APC PHP extension' - printf "\n" | pecl install apc - echo 'apc.enable_cli=1' >> "$php_ini_file" -else - echo 'Disabling Opcache' - echo 'opcache.enable=0' >> "$php_ini_file" -fi +# Disable opcache for testing +echo 'Disabling Opcache' +echo 'opcache.enable=0' >> "$php_ini_file" # APCu if [ `php -r "echo (int) (version_compare(PHP_VERSION, '7.0.0-dev', '>=') && version_compare(PHP_VERSION, '7.3.0-dev', '<'));"` == "1" ] diff --git a/vagrant/after.sh b/vagrant/after.sh index aadb7e7492..3b56777a4e 100755 --- a/vagrant/after.sh +++ b/vagrant/after.sh @@ -2,32 +2,46 @@ PHPBB_PATH="/home/vagrant/phpbb" PHPBB_CONFIG="${PHPBB_PATH}/phpBB/config.php" +PHPBB_SQLITE="/tmp/phpbb.sqlite3" PHPBB_INSTALL="${PHPBB_PATH}/vagrant/phpbb-install-config.yml" # Ensure composer deps are installed cd ${PHPBB_PATH}/phpBB php ../composer.phar install -# Backup current config.php file +# Backup and remove current config.php file if [ -e ${PHPBB_CONFIG} ] then cp --backup=numbered ${PHPBB_CONFIG} ${PHPBB_CONFIG}.bak + rm -rf ${PHPBB_CONFIG} fi -# Delete any sqlite db and config file -rm -rf /tmp/phpbb.sqlite3 -rm -rf ${PHPBB_CONFIG} +# Delete any sqlite db +if [ -e ${PHPBB_SQLITE} ] +then + rm -rf ${PHPBB_SQLITE} +fi # Install phpBB php ${PHPBB_PATH}/phpBB/install/phpbbcli.php install ${PHPBB_INSTALL} # Update sqlite db file permissions -sudo chown -R vagrant /tmp/phpbb.sqlite3 +if [ -e ${PHPBB_SQLITE} ] +then + sudo chown -R vagrant ${PHPBB_SQLITE} +fi # Add DEBUG mode to phpBB to remove annoying installer warnings -sed -i "$ a @define('DEBUG', true);" ${PHPBB_CONFIG} +echo "@define('DEBUG', true);" >> ${PHPBB_CONFIG} + +# Change environment to development +sed -i '/^.*PHPBB_ENVIRONMENT.*$/s/production/development/' ${PHPBB_CONFIG} # Update the PHP memory limits (enough to allow phpunit tests to run) -sed -i "s/memory_limit = .*/memory_limit = 1024M/" /etc/php5/fpm/php.ini +sed -i "s/memory_limit = .*/memory_limit = 1024M/" /etc/php/7.1/fpm/php.ini + +# Make routes work in vagrant (https://tracker.phpbb.com/browse/PHPBB3-15400) +sed -i '/^.*try_files.*$/s/index/app/' /etc/nginx/sites-enabled/phpbb.app +nginx -s reload echo "Your board is ready at http://192.168.10.10/" |