diff options
-rw-r--r-- | phpBB/adm/style/acp_board.html | 7 | ||||
-rw-r--r-- | phpBB/adm/style/installer_form.html | 2 | ||||
-rw-r--r-- | phpBB/composer.json | 2 | ||||
-rw-r--r-- | phpBB/composer.lock | 14 | ||||
-rw-r--r-- | phpBB/install/convert/convert.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/cache/driver/apcu.php | 70 | ||||
-rw-r--r-- | phpBB/phpbb/cache/driver/memcached.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/db/extractor/postgres_extractor.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/db/tools/postgres.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php | 6 | ||||
-rw-r--r-- | phpBB/phpbb/install/module/update_filesystem/task/download_updated_files.php | 24 | ||||
-rw-r--r-- | phpBB/phpbb/install/module/update_filesystem/task/file_check.php | 29 | ||||
-rw-r--r-- | phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php | 6 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/bidi.css | 6 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/content.css | 1 | ||||
-rw-r--r-- | tests/RUNNING_TESTS.md | 12 | ||||
-rw-r--r-- | tests/cache/apcu_driver_test.php | 58 |
17 files changed, 217 insertions, 28 deletions
diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index 64592a5de2..04dee98276 100644 --- a/phpBB/adm/style/acp_board.html +++ b/phpBB/adm/style/acp_board.html @@ -18,10 +18,11 @@ <!-- BEGIN options --> <!-- IF options.S_LEGEND --> <!-- IF not options.S_FIRST_ROW --> - </fieldset> - <!-- ENDIF --> + </fieldset> + <fieldset> - <legend>{options.LEGEND}</legend> + <!-- ENDIF --> + <legend>{options.LEGEND}</legend> <!-- ELSE --> <dl> diff --git a/phpBB/adm/style/installer_form.html b/phpBB/adm/style/installer_form.html index cc5b041fa1..a38f33c7c2 100644 --- a/phpBB/adm/style/installer_form.html +++ b/phpBB/adm/style/installer_form.html @@ -49,7 +49,7 @@ <fieldset class="submit-buttons"> <legend>{L_SUBMIT}</legend> <!-- BEGIN submit_buttons --> - <input class="button1" type="submit" name="{submit_buttons.KEY}" value="{submit_buttons.TITLE}" /> + <input class="button1<!-- IF submit_buttons.DISABLED --> disabled<!-- ENDIF -->" type="submit" name="{submit_buttons.KEY}" value="{submit_buttons.TITLE}"<!-- IF submit_buttons.DISABLED --> disabled="disabled"<!-- ENDIF --> /> <!-- END submit_buttons --> </fieldset> <!-- ENDIF --> diff --git a/phpBB/composer.json b/phpBB/composer.json index 1b8de72710..5bc8f5dc0d 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -33,7 +33,7 @@ "marc1706/fast-image-size": "^1.1", "paragonie/random_compat": "^1.4", "patchwork/utf8": "^1.1", - "s9e/text-formatter": "~0.10.0", + "s9e/text-formatter": "~0.11.0", "symfony/config": "^2.8", "symfony/console": "^2.8", "symfony/debug": "^2.8", diff --git a/phpBB/composer.lock b/phpBB/composer.lock index d460c6db58..9345d07dbf 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "3b947e5d38012be6ef86609c709c7b4b", - "content-hash": "447fa8ed870502dc3089b0a0ffa08ef0", + "hash": "7c30306b2abcb79a206bf6497ef45a02", + "content-hash": "d559dd0af2317fb0fc15720a18834e33", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -660,16 +660,16 @@ }, { "name": "s9e/text-formatter", - "version": "0.10.1", + "version": "0.11.0", "source": { "type": "git", "url": "https://github.com/s9e/TextFormatter.git", - "reference": "9380fd3d3e3289d7e966bab7769ca2aae5d23f67" + "reference": "664b3eaf52baaae4d93548f5e20246fa5942b2b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/9380fd3d3e3289d7e966bab7769ca2aae5d23f67", - "reference": "9380fd3d3e3289d7e966bab7769ca2aae5d23f67", + "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/664b3eaf52baaae4d93548f5e20246fa5942b2b9", + "reference": "664b3eaf52baaae4d93548f5e20246fa5942b2b9", "shasum": "" }, "require": { @@ -721,7 +721,7 @@ "parser", "shortcodes" ], - "time": "2017-07-03 13:55:54" + "time": "2017-08-04 23:06:38" }, { "name": "symfony/config", diff --git a/phpBB/install/convert/convert.php b/phpBB/install/convert/convert.php index 03913d6ae6..3e9e562f2e 100644 --- a/phpBB/install/convert/convert.php +++ b/phpBB/install/convert/convert.php @@ -53,7 +53,7 @@ class convert var $p_master; - function convert($p_master) + function __construct($p_master) { $this->p_master = $p_master; } diff --git a/phpBB/phpbb/cache/driver/apcu.php b/phpBB/phpbb/cache/driver/apcu.php new file mode 100644 index 0000000000..40192e4026 --- /dev/null +++ b/phpBB/phpbb/cache/driver/apcu.php @@ -0,0 +1,70 @@ +<?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\cache\driver; + +/** +* ACM for APCU +*/ +class apcu extends \phpbb\cache\driver\memory +{ + var $extension = 'apcu'; + + /** + * {@inheritDoc} + */ + function purge() + { + apcu_clear_cache(); + + parent::purge(); + } + + /** + * Fetch an item from the cache + * + * @access protected + * @param string $var Cache key + * @return mixed Cached data + */ + function _read($var) + { + return apcu_fetch($this->key_prefix . $var); + } + + /** + * Store data in the cache + * + * @access protected + * @param string $var Cache key + * @param mixed $data Data to store + * @param int $ttl Time-to-live of cached data + * @return bool True if the operation succeeded + */ + function _write($var, $data, $ttl = 2592000) + { + return apcu_store($this->key_prefix . $var, $data, $ttl); + } + + /** + * Remove an item from the cache + * + * @access protected + * @param string $var Cache key + * @return bool True if the operation succeeded + */ + function _delete($var) + { + return apcu_delete($this->key_prefix . $var); + } +} diff --git a/phpBB/phpbb/cache/driver/memcached.php b/phpBB/phpbb/cache/driver/memcached.php index a7da22d7e8..808e15afe8 100644 --- a/phpBB/phpbb/cache/driver/memcached.php +++ b/phpBB/phpbb/cache/driver/memcached.php @@ -68,7 +68,7 @@ class memcached extends \phpbb\cache\driver\memory foreach (explode(',', PHPBB_ACM_MEMCACHE) as $u) { preg_match('#(.*)/(\d+)#', $u, $parts); - $this->memcache->addServer(trim($parts[1]), (int) trim($parts[2])); + $this->memcached->addServer(trim($parts[1]), (int) trim($parts[2])); } } diff --git a/phpBB/phpbb/db/extractor/postgres_extractor.php b/phpBB/phpbb/db/extractor/postgres_extractor.php index a98e39621c..0219d2ac8d 100644 --- a/phpBB/phpbb/db/extractor/postgres_extractor.php +++ b/phpBB/phpbb/db/extractor/postgres_extractor.php @@ -85,7 +85,7 @@ class postgres_extractor extends base_extractor // We don't even care about storing the results. We already know the answer if we get rows back. if ($this->db->sql_fetchrow($result)) { - $sql_data .= "DROP SEQUENCE {$table_name}_seq;\n"; + $sql_data .= "DROP SEQUENCE IF EXISTS {$table_name}_seq;\n"; $sql_data .= "CREATE SEQUENCE {$table_name}_seq;\n"; } $this->db->sql_freeresult($result); diff --git a/phpBB/phpbb/db/tools/postgres.php b/phpBB/phpbb/db/tools/postgres.php index e2a4e668a6..077d6e06f9 100644 --- a/phpBB/phpbb/db/tools/postgres.php +++ b/phpBB/phpbb/db/tools/postgres.php @@ -448,7 +448,7 @@ class postgres extends tools // We don't even care about storing the results. We already know the answer if we get rows back. if ($this->db->sql_fetchrow($result)) { - $statements[] = "DROP SEQUENCE {$table_name}_seq;\n"; + $statements[] = "DROP SEQUENCE IF EXISTS {$table_name}_seq;\n"; } $this->db->sql_freeresult($result); diff --git a/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php index a40d457466..bce0149890 100644 --- a/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php +++ b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php @@ -186,6 +186,7 @@ class ajax_iohandler extends iohandler_base $tpl_ary['TITLE'] = $this->language->lang($input_options['label']); $tpl_ary['KEY'] = $input_name; $tpl_ary['S_EXPLAIN'] = false; + $tpl_ary['DISABLED'] = isset($input_options['disabled']) ? $input_options['disabled'] : false; if (isset($input_options['default'])) { @@ -219,6 +220,11 @@ class ajax_iohandler extends iohandler_base $this->template->assign_var('S_NOT_ONLY_BUTTON_FORM', $not_button_form); + if (!$not_button_form) + { + $this->template->destroy_block_vars('options'); + } + $this->template->set_filenames(array( 'form_install' => 'installer_form.html', )); diff --git a/phpBB/phpbb/install/module/update_filesystem/task/download_updated_files.php b/phpBB/phpbb/install/module/update_filesystem/task/download_updated_files.php index f911b7ac62..21aa93b7ea 100644 --- a/phpBB/phpbb/install/module/update_filesystem/task/download_updated_files.php +++ b/phpBB/phpbb/install/module/update_filesystem/task/download_updated_files.php @@ -78,16 +78,23 @@ class download_updated_files extends task_base } else if ($this->iohandler->get_input('update_recheck_files_submit', false)) { + $this->installer_config->set('file_updater_elem_progress', ''); + $this->installer_config->set('update_files', array()); throw new jump_to_restart_point_exception('check_update_files'); } else { - // Render download box - $this->iohandler->add_download_link( - 'phpbb_installer_update_file_download', - 'DOWNLOAD_UPDATE_METHOD', - 'DOWNLOAD_UPDATE_METHOD_EXPLAIN' - ); + $file_update_info = $this->installer_config->get('update_files', array()); + + if (count($file_update_info) > 0) + { + // Render download box + $this->iohandler->add_download_link( + 'phpbb_installer_update_file_download', + 'DOWNLOAD_UPDATE_METHOD', + 'DOWNLOAD_UPDATE_METHOD_EXPLAIN' + ); + } // Add form to continue update $this->iohandler->add_user_form_group('UPDATE_CONTINUE_UPDATE_PROCESS', array( @@ -96,8 +103,9 @@ class download_updated_files extends task_base 'type' => 'submit', ), 'database_update_submit' => array( - 'label' => 'UPDATE_CONTINUE_UPDATE_PROCESS', - 'type' => 'submit', + 'label' => 'UPDATE_CONTINUE_UPDATE_PROCESS', + 'type' => 'submit', + 'disabled' => count($file_update_info) > 0, ), )); diff --git a/phpBB/phpbb/install/module/update_filesystem/task/file_check.php b/phpBB/phpbb/install/module/update_filesystem/task/file_check.php index 47a71eb844..9daa8530c6 100644 --- a/phpBB/phpbb/install/module/update_filesystem/task/file_check.php +++ b/phpBB/phpbb/install/module/update_filesystem/task/file_check.php @@ -103,6 +103,29 @@ class file_check extends task_base $file_update_info = array(); $file_update_info['update_without_diff'] = array_diff($update_info['binary'], $update_info['deleted']); + foreach ($file_update_info['update_without_diff'] as $key => $binary_file) + { + $new_file = $new_path . $binary_file; + $file = $this->phpbb_root_path . $binary_file; + + if (!$this->filesystem->exists($file)) + { + continue; + } + + if (md5_file($file) === md5_file($new_file)) + { + // File already up to date + unset($file_update_info['update_without_diff'][$key]); + } + } + + // Remove update without diff info if empty + if (count($file_update_info['update_without_diff']) < 1) + { + unset($file_update_info['update_without_diff']); + } + // Filter out files that are already deleted $file_update_info['delete'] = array_filter( $update_info['deleted'], @@ -111,6 +134,12 @@ class file_check extends task_base return file_exists($root_path . $filename); } ); + + // Remove files to delete list if empty + if (count($file_update_info['delete']) < 1) + { + unset($file_update_info['delete']); + } } $progress_count = $this->installer_config->get('file_check_progress_count', 0); diff --git a/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php b/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php index cf1e4cf4ac..0e82f91553 100644 --- a/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php +++ b/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php @@ -129,9 +129,9 @@ class show_file_status extends task_base // Add form to continue update $this->iohandler->add_user_form_group('UPDATE_CONTINUE_FILE_UPDATE', array( - 'submit_continue_file_update' => array( - 'label' => 'UPDATE_CONTINUE_FILE_UPDATE', - 'type' => 'submit', + 'submit_continue_file_update' => array( + 'label' => 'UPDATE_CONTINUE_FILE_UPDATE', + 'type' => 'submit', ), )); diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index 70cfb83a78..923ff3e792 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -1073,4 +1073,10 @@ li.breadcrumbs span:first-child > a { .captcha-panel dd.captcha { margin-right: 0; } + + .rtl p.responsive-center { + float: none; + text-align: center; + margin-bottom: 5px; + } } diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index 741056e4c4..c34e01d0ae 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -135,6 +135,7 @@ dl.row-item { background-position: 10px 50%; /* Position of folder icon */ background-repeat: no-repeat; background-size: 32px; + image-rendering: -webkit-optimize-contrast; } dl.row-item dt { diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md index b082197166..c9941d61e5 100644 --- a/tests/RUNNING_TESTS.md +++ b/tests/RUNNING_TESTS.md @@ -30,7 +30,9 @@ Some of the functionality in phpBB and/or the test suite uses additional PHP extensions. If these extensions are not loaded, respective tests will be skipped: -- apc (APC cache driver) +- apc (APC cache driver, php5 only) +- apcu (APCu cache driver - native API, php7+) +- apcu_bc, apcu (APCu cache driver - APC API, php7+) - bz2 (compress tests) - mysql, pdo_mysql (MySQL database driver) - mysqli, pdo_mysql (MySQLi database driver) @@ -117,6 +119,14 @@ directory (above phpBB): $ phpBB/vendor/bin/phpunit +To generate an xml log file, run: + + $ phpBB/vendor/bin/phpunit --log-junit tests/tmp/log/log.xml + +If you are getting a memory exhausted error after running a few tests, you can try running: + + $ phpBB/vendor/bin/phpunit -d memory_limit=2048M + Slow tests -------------- diff --git a/tests/cache/apcu_driver_test.php b/tests/cache/apcu_driver_test.php new file mode 100644 index 0000000000..9de1d82a15 --- /dev/null +++ b/tests/cache/apcu_driver_test.php @@ -0,0 +1,58 @@ +<?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. +* +*/ + +// Important: apc.enable_cli=1 must be in php.ini. +// http://forums.devshed.com/php-development-5/apc-problem-561290.html +// http://php.net/manual/en/apc.configuration.php + +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() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); + } + + static public function setUpBeforeClass() + { + if (!extension_loaded('apcu')) + { + self::markTestSkipped('APCu extension is not loaded'); + } + + $php_ini = new \bantu\IniGetWrapper\IniGetWrapper; + + if (!$php_ini->getBool('apc.enabled')) + { + self::markTestSkipped('APCu is not enabled. Make sure apc.enabled=1 in php.ini'); + } + + if (PHP_SAPI == 'cli' && !$php_ini->getBool('apc.enable_cli')) + { + self::markTestSkipped('APCu is not enabled for CLI. Set apc.enable_cli=1 in php.ini'); + } + } + + protected function setUp() + { + parent::setUp(); + + $this->driver = new \phpbb\cache\driver\apcu; + + $this->driver->purge(); + } +} |