diff options
29 files changed, 658 insertions, 136 deletions
diff --git a/build/build.xml b/build/build.xml index dbf16acfeb..ec94cf3ea6 100644 --- a/build/build.xml +++ b/build/build.xml @@ -2,9 +2,9 @@  <project name="phpBB" description="The phpBB forum software" default="all" basedir="../">  	<!-- a few settings for the build --> -	<property name="newversion" value="3.1.0-b4-dev" /> -	<property name="prevversion" value="3.1.0-b3" /> -	<property name="olderversions" value="3.0.12, 3.1.0-a1, 3.1.0-a2, 3.1.0-a3, 3.1.0-b1, 3.1.0-b2" /> +	<property name="newversion" value="3.1.0-b5-dev" /> +	<property name="prevversion" value="3.1.0-b4" /> +	<property name="olderversions" value="3.0.12, 3.1.0-a1, 3.1.0-a2, 3.1.0-a3, 3.1.0-b1, 3.1.0-b2, 3.1.0-b3" />  	<!-- no configuration should be needed beyond this point -->  	<property name="oldversions" value="${olderversions}, ${prevversion}" /> diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml index 56bf99390a..a102a8c609 100644 --- a/phpBB/config/console.yml +++ b/phpBB/config/console.yml @@ -46,6 +46,15 @@ services:          tags:              - { name: console.command } +    console.command.cron.run: +        class: phpbb\console\command\cron\run +        arguments: +            - @cron.manager +            - @cron.lock_db +            - @user +        tags: +            - { name: console.command } +      console.command.db.migrate:          class: phpbb\console\command\db\migrate          arguments: diff --git a/phpBB/cron.php b/phpBB/cron.php index e070c8f5fb..8bb49bd5d2 100644 --- a/phpBB/cron.php +++ b/phpBB/cron.php @@ -37,73 +37,33 @@ function output_image()  	flush();  } -function do_cron($cron_lock, $run_tasks) -{ -	global $config; - -	foreach ($run_tasks as $task) -	{ -		if (defined('DEBUG') && $config['use_system_cron']) -		{ -			echo "[phpBB cron] Running task '{$task->get_name()}'\n"; -		} - -		$task->run(); -	} - -	// Unloading cache and closing db after having done the dirty work. -	$cron_lock->release(); -	garbage_collection(); -} -  // 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. -// -// If DEBUG is defined and cron lock cannot be obtained, a message will be printed. -if (!$config['use_system_cron']) -{ -	$cron_type = request_var('cron_type', ''); +$cron_type = request_var('cron_type', ''); -	// Comment this line out for debugging so the page does not return an image. -	output_image(); -} +// Comment this line out for debugging so the page does not return an image. +output_image();  $cron_lock = $phpbb_container->get('cron.lock_db');  if ($cron_lock->acquire())  {  	$cron = $phpbb_container->get('cron.manager'); -	if ($config['use_system_cron']) -	{ -		$run_tasks = $cron->find_all_ready_tasks(); -	} -	else +	$task = $cron->find_task($cron_type); +	if ($task)  	{ -		// If invalid task is specified, empty $run_tasks is passed to do_cron which then does nothing -		$run_tasks = array(); -		$task = $cron->find_task($cron_type); -		if ($task) +		if ($task->is_parametrized())  		{ -			if ($task->is_parametrized()) -			{ -				$task->parse_parameters($request); -			} -			if ($task->is_ready()) -			{ -				$run_tasks = array($task); -			} +			$task->parse_parameters($request); +		} +		if ($task->is_ready()) +		{ +			$task->run(); +			garbage_collection();  		}  	} - -	do_cron($cron_lock, $run_tasks); -} -else -{ -	if (defined('DEBUG')) -	{ -		echo "Could not obtain cron lock.\n"; -	} +	$cron_lock->release();  } diff --git a/phpBB/develop/strip_icc_profiles.sh b/phpBB/develop/strip_icc_profiles.sh index 779c7ffca7..b11a63616b 100755 --- a/phpBB/develop/strip_icc_profiles.sh +++ b/phpBB/develop/strip_icc_profiles.sh @@ -1,7 +1,12 @@  #!/bin/sh  # -# @copyright (c) 2014 phpBB Group -# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# 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.  #  if [ "$#" -ne 1 ] diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 36d0ccf68d..ab3a42206e 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -46,6 +46,7 @@  <ol>  	<li><a href="#changelog">Changelog</a>  	<ol style="list-style-type: lower-roman;"> +		<li><a href="#v310b3">Changes since 3.1.0-b3</a></li>  		<li><a href="#v310b2">Changes since 3.1.0-b2</a></li>  		<li><a href="#v310b1">Changes since 3.1.0-b1</a></li>  		<li><a href="#v310a3">Changes since 3.1.0-a3</a></li> @@ -92,7 +93,114 @@  		<div class="content"> -	<a name="v310b2"></a><h3>1.i. Changes since 3.1.0-b2</h3> +	<a name="v310b3"></a><h3>1.i. Changes since 3.1.0-b3</h3> + +	<h4>Bug</h4> +	<ul> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10176">PHPBB3-10176</a>] - Imageset Appearance Problem with Google Chrome Browser. </li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11226">PHPBB3-11226</a>] - filespec::move_file() from functions_upload.php does not error correctly</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11232">PHPBB3-11232</a>] - prosilver ajax.js does not respect PHPBB_USE_BOARD_URL_PATH</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11366">PHPBB3-11366</a>] - Add "MOD Version Check" for extensions to the core</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11497">PHPBB3-11497</a>] - The extension finder keeps state, so should be instantiated on each container request, not reset manually</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12025">PHPBB3-12025</a>] - Post Preview no longer shows UNAUTHORISED_BBCODE warning for disallowed BBcodes</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12074">PHPBB3-12074</a>] - Enabling/Disabling/Data deleting of an extension should generate a log entry</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12174">PHPBB3-12174</a>] - "Download all attachments" link displayed when the topic has attachments in hidden posts only</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12185">PHPBB3-12185</a>] - Topic header in viewforum too small for translation</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12270">PHPBB3-12270</a>] - Approving a topic triggers wrong notification</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12275">PHPBB3-12275</a>] - core.modify_username_string is not triggered everytime</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12332">PHPBB3-12332</a>] - Attachments with long file names break the Uploader layout</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12357">PHPBB3-12357</a>] - generate_smilies() does not work for routes</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12402">PHPBB3-12402</a>] - CAPTCHA plugin migration fails to detect missing plugins</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12415">PHPBB3-12415</a>] - Use private message instead of "pm" accronym in cpf visibility options</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12421">PHPBB3-12421</a>] - We try to display attachments in feed even for users who don't have the right to see them</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12428">PHPBB3-12428</a>] - Incorrect from version in database update log entry</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12434">PHPBB3-12434</a>] - No error message with Plupload except for files without extension</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12435">PHPBB3-12435</a>] - purge_notifications() fails for disabled extensions</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12440">PHPBB3-12440</a>] - Change URL in browsers addressbar when a view=unread#unread link was used</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12451">PHPBB3-12451</a>] - posting.php TOO_FEW_CHARS_LIMIT should be split for plurals</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12459">PHPBB3-12459</a>] - Unapproved posts/topics are not correctly handled in feeds</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12460">PHPBB3-12460</a>] - Soft deleted posts/topics are not correctly handled in feeds</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12461">PHPBB3-12461</a>] - Statistics are wrong for topic's based feeds</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12476">PHPBB3-12476</a>] - purge_cache should increase asset version</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12486">PHPBB3-12486</a>] - "Risky" tests from phpunit 4.1</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12491">PHPBB3-12491</a>] - Conflict between USERNAME_FULL in functions.php and mcp_notes.php</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12493">PHPBB3-12493</a>] - User can not send PMs to users with PMs disabled, but PM button is visible on posts</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12498">PHPBB3-12498</a>] - IE8 displays avatar in header with wrong width</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12499">PHPBB3-12499</a>] - Incorrect call to phpbb\log\log::add() in db:migrate console command</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12500">PHPBB3-12500</a>] - user.img does not set a title attribute for resulting span</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12501">PHPBB3-12501</a>] - Weird post attachment behavior in MCP report details</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12503">PHPBB3-12503</a>] - All test cases should extend phpbb_test_case instead of PHPUnit_Framework_TestCase</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12504">PHPBB3-12504</a>] - Avatar manager test is using undefined variables</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12509">PHPBB3-12509</a>] - Extentions can't send email with new notification system</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12510">PHPBB3-12510</a>] - build_url() is not encoding url entities</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12511">PHPBB3-12511</a>] - Missing language strings in memberlist group view for mobile prosilver</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12513">PHPBB3-12513</a>] - simple_headers do not support extension loaded CSS stylesheets</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12517">PHPBB3-12517</a>] - Missing argument in call to log.add() in prune_shadow_topics.php</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12519">PHPBB3-12519</a>] - m_approve language update from soft delete patch got nucked by a merge conflict</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12520">PHPBB3-12520</a>] - Can not move text with the mouse anymore in post-box when attachments are allowed</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12522">PHPBB3-12522</a>] - Add parameter description in guesser_interface</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12525">PHPBB3-12525</a>] - CONTACT_USER used with username</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12526">PHPBB3-12526</a>] - "Undefined index: filesize" error thrown when editing a PM with attachments</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12527">PHPBB3-12527</a>] - Remove translation editor from ACP</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12529">PHPBB3-12529</a>] - phpbb\controller\resolver::getController doesn't use $phpbb_root_path to check if the template dir exist</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12533">PHPBB3-12533</a>] - The notification link should fill the parent li-container in the notifications dialog</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12534">PHPBB3-12534</a>] - Enabling and disabling extensions should not abuse the red errorbox</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12536">PHPBB3-12536</a>] - Get Versions Should Not Require Both Stable and Unstable Branches</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12540">PHPBB3-12540</a>] - WRONG_FILESIZE contains broken placeholders</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12543">PHPBB3-12543</a>] - Enter key no longer works in posting when attachment error is triggered</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12547">PHPBB3-12547</a>] - Rename jquery.js to jquery.min.js in assets directory</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12548">PHPBB3-12548</a>] - [RTL] - Posting button icons should display on left side of text</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12549">PHPBB3-12549</a>] - [RTL] - Forumlist/topiclist <dfn> tags should not be visible</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12550">PHPBB3-12550</a>] - [RTL] - Last post column breaks into second line</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12551">PHPBB3-12551</a>] - [RTL] - Breadcrumb separator does not display correctly</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12561">PHPBB3-12561</a>] - Create_schema_files.php should process colum "after" instead of adding it to the JSON</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12570">PHPBB3-12570</a>] - db_text throws an error, when set() is called with the current value</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12572">PHPBB3-12572</a>] - JavaScript console throws error when alert message title is not defined (core.js bug)</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12580">PHPBB3-12580</a>] - :link Pseudo causing over specificity issues in the theme</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12586">PHPBB3-12586</a>] - \phpbb\extension\manager::all_available() should only locate ext files two levels deep and ignore dot-files/folders</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12594">PHPBB3-12594</a>] - File headers, credit lines, etc. should reflect updated legal info</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12600">PHPBB3-12600</a>] - The cli command extension:show is broken</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12604">PHPBB3-12604</a>] - Notifications Dropdown Padding Broken When Empty</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12611">PHPBB3-12611</a>] - phpBB Group copyright notice should be removed from all images</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12614">PHPBB3-12614</a>] - Do not hide post buttons before hovering over post</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12621">PHPBB3-12621</a>] - schema.json is not up to date with migration files</li> +	</ul> +	<h4>Improvement</h4> +	<ul> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9388">PHPBB3-9388</a>] - use DOM scripting to hide unnecessary input fields</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11163">PHPBB3-11163</a>] - Include ext/ directory in installation and update packages</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12155">PHPBB3-12155</a>] - Use CSS instead of translated images for the mini post buttons</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12407">PHPBB3-12407</a>] - Allow changing of post_data and other variables with core.posting_modify_template_vars</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12431">PHPBB3-12431</a>] - Add has_poll icon to topiclists</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12433">PHPBB3-12433</a>] - QUOTE_DEPTH_EXCEEDED needs a different string for '1'</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12488">PHPBB3-12488</a>] - Add user warning indication to viewtopic posts</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12507">PHPBB3-12507</a>] - Add console command to purge the cache</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12518">PHPBB3-12518</a>] - Allow extensions to overwrite CANNOT_EDIT_* checks in posting.php and viewtopic.php</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12523">PHPBB3-12523</a>] - Add search_results.html template events search_results_topic_(before/after)</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12524">PHPBB3-12524</a>] - Add search.php core event to modify search results rowset</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12531">PHPBB3-12531</a>] - Restore default topic title links in subsilver2</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12555">PHPBB3-12555</a>] - Make use of canonical urls to avoid duplicate content</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12583">PHPBB3-12583</a>] - Add event core.mcp_warn_post_before/after</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12584">PHPBB3-12584</a>] - Add event core.mcp_warn_user_before/after</li> +	</ul> +	<h4>Sub-task</h4> +	<ul> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12576">PHPBB3-12576</a>] - Remove cron from common.php</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12585">PHPBB3-12585</a>] - Don't check the cron on each page load</li> +	</ul> +	<h4>Task</h4> +	<ul> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10839">PHPBB3-10839</a>] - Remove phpunit.xml.functional and always include functional tests</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12384">PHPBB3-12384</a>] - Run Travis CI HHVM tests against MySQLi instead of MySQL</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12495">PHPBB3-12495</a>] - Add Sami to composer dependencies and build script</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12544">PHPBB3-12544</a>] - Update Plupload to 2.1.2</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12582">PHPBB3-12582</a>] - Strip away copyrighted ICC profile from images</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12592">PHPBB3-12592</a>] - Run mysql driver on Travis CI</li> +		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12603">PHPBB3-12603</a>] - Remove hook_system.html from docs</li> +	</ul> + + +	<a name="v310b2"></a><h3>1.ii. Changes since 3.1.0-b2</h3>  	<h4>Bug</h4>  	<ul> @@ -257,7 +365,7 @@  	</ul> -	<a name="v310b1"></a><h3>1.ii. Changes since 3.1.0-b1</h3> +	<a name="v310b1"></a><h3>1.iii. Changes since 3.1.0-b1</h3>  	<h4>Bug</h4>  	<ul> @@ -325,7 +433,7 @@  		<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12302">PHPBB3-12302</a>] - Upgrade composer.phar to 1.0.0-alpha8</li>  	</ul> -	<a name="v310a3"></a><h3>1.iii. Changes since 3.1.0-a3</h3> +	<a name="v310a3"></a><h3>1.iv. Changes since 3.1.0-a3</h3>  	<h4>Bug</h4>  	<ul> @@ -472,7 +580,7 @@  	</ul> -	<a name="v310a2"></a><h3>1.iv. Changes since 3.1.0-a2</h3> +	<a name="v310a2"></a><h3>1.v. Changes since 3.1.0-a2</h3>  <h4>Bug</h4>  <ul> @@ -580,7 +688,7 @@  <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12147">PHPBB3-12147</a>] - Remove Travis CI notification configuration</li>  </ul> -	<a name="v310a1"></a><h3>1.v. Changes since 3.1.0-a1</h3> +	<a name="v310a1"></a><h3>1.vi. Changes since 3.1.0-a1</h3>  <h4>Bug</h4>  <ul> @@ -656,7 +764,7 @@  <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11998">PHPBB3-11998</a>] - Add console / command line client environment </li>  </ul> -	<a name="v30x"></a><h3>1.vi. Changes since 3.0.x</h3> +	<a name="v30x"></a><h3>1.vii. Changes since 3.0.x</h3>  <h4>Bug</h4>  <ul> @@ -1337,7 +1445,7 @@  <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11913">PHPBB3-11913</a>] - Apply reorganisation of download.phpbb.com to build_announcement.php</li>  </ul> -	<a name="v3011"></a><h3>1.vii. Changes since 3.0.11</h3> +	<a name="v3011"></a><h3>1.viii. Changes since 3.0.11</h3>  <h4>Bug</h4>  <ul> @@ -1492,7 +1600,7 @@  <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11753">PHPBB3-11753</a>] - Upgrade mysql_upgrader.php schema data.</li>  </ul> -	<a name="v3010"></a><h3>1.viii. Changes since 3.0.10</h3> +	<a name="v3010"></a><h3>1.ix. Changes since 3.0.10</h3>  <h4>Bug</h4>  <ul> @@ -1617,7 +1725,7 @@  <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10909">PHPBB3-10909</a>] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2</li>  </ul> -	<a name="v309"></a><h3>1.ix. Changes since 3.0.9</h3> +	<a name="v309"></a><h3>1.x. Changes since 3.0.9</h3>  <h4>Bug</h4>  <ul> @@ -1753,7 +1861,7 @@  <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10480">PHPBB3-10480</a>] - Automate changelog building</li>  </ul> -	<a name="v308"></a><h3>1.x. Changes since 3.0.8</h3> +	<a name="v308"></a><h3>1.xi. Changes since 3.0.8</h3>  <h4>        Bug  </h4> @@ -2121,7 +2229,7 @@  </ul> -	<a name="v307-PL1"></a><h3>1.xi. Changes since 3.0.7-PL1</h3> +	<a name="v307-PL1"></a><h3>1.xii. Changes since 3.0.7-PL1</h3>  <h4>        Security  </h4>  <ul> @@ -2579,13 +2687,13 @@  </ul> -	<a name="v307"></a><h3>1.xii. Changes since 3.0.7</h3> +	<a name="v307"></a><h3>1.xiii. Changes since 3.0.7</h3>  	<ul>  		<li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li>  	</ul> -	<a name="v306"></a><h3>1.xiii. Changes since 3.0.6</h3> +	<a name="v306"></a><h3>1.xiv. Changes since 3.0.6</h3>  	<ul>  		<li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li> @@ -2689,7 +2797,7 @@  	</ul> -	<a name="v305"></a><h3>1.xiv. Changes since 3.0.5</h3> +	<a name="v305"></a><h3>1.xv. Changes since 3.0.5</h3>  	<ul>  		<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li> @@ -2911,7 +3019,7 @@  		<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>  	</ul> -	<a name="v304"></a><h3>1.xv. Changes since 3.0.4</h3> +	<a name="v304"></a><h3>1.xvi. Changes since 3.0.4</h3>  	<ul>  		<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li> @@ -3000,7 +3108,7 @@  		<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>  	</ul> -	<a name="v303"></a><h3>1.xvi. Changes since 3.0.3</h3> +	<a name="v303"></a><h3>1.xvii. Changes since 3.0.3</h3>  	<ul>  		<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li> @@ -3032,7 +3140,7 @@  		<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>  	</ul> -	<a name="v302"></a><h3>1.xvii. Changes since 3.0.2</h3> +	<a name="v302"></a><h3>1.xviii. Changes since 3.0.2</h3>  	<ul>  		<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li> @@ -3131,7 +3239,7 @@  		<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>  	</ul> -	<a name="v301"></a><h3>1.xviii. Changes since 3.0.1</h3> +	<a name="v301"></a><h3>1.xix. Changes since 3.0.1</h3>  	<ul>  		<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li> @@ -3179,7 +3287,7 @@  		<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>  	</ul> -	<a name="v300"></a><h3>1.xix. Changes since 3.0.0</h3> +	<a name="v300"></a><h3>1.xx. Changes since 3.0.0</h3>  	<ul>  		<li>[Change] Validate birthdays (Bug #15004)</li> @@ -3250,7 +3358,7 @@  		<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>  	</ul> -	<a name="v30rc8"></a><h3>1.xx. Changes since 3.0.RC8</h3> +	<a name="v30rc8"></a><h3>1.xxi. Changes since 3.0.RC8</h3>  	<ul>  		<li>[Fix] Cleaned usernames contain only single spaces, so "a_name" and "a__name" are treated as the same name (Bug #15634)</li> @@ -3259,7 +3367,7 @@  		<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>  	</ul> -	<a name="v30rc7"></a><h3>1.xxi. Changes since 3.0.RC7</h3> +	<a name="v30rc7"></a><h3>1.xxii. Changes since 3.0.RC7</h3>  	<ul>  		<li>[Fix] Fixed MSSQL related bug in the update system</li> @@ -3294,7 +3402,7 @@  		<li>[Fix] No duplication of active topics (Bug #15474)</li>  	</ul> -	<a name="v30rc6"></a><h3>1.xxii. Changes since 3.0.RC6</h3> +	<a name="v30rc6"></a><h3>1.xxiii. Changes since 3.0.RC6</h3>  	<ul>  		<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li> @@ -3304,7 +3412,7 @@  		<li>[Fix] Able to request new password (Bug #14743)</li>  	</ul> -	<a name="v30rc5"></a><h3>1.xxiii. Changes since 3.0.RC5</h3> +	<a name="v30rc5"></a><h3>1.xxiv. Changes since 3.0.RC5</h3>  	<ul>  		<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li> @@ -3367,7 +3475,7 @@  		<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>  	</ul> -	<a name="v30rc4"></a><h3>1.xxiv. Changes since 3.0.RC4</h3> +	<a name="v30rc4"></a><h3>1.xxv. Changes since 3.0.RC4</h3>  	<ul>  		<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li> @@ -3418,7 +3526,7 @@  		<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>  	</ul> -	<a name="v30rc3"></a><h3>1.xxv. Changes since 3.0.RC3</h3> +	<a name="v30rc3"></a><h3>1.xxvi. Changes since 3.0.RC3</h3>  	<ul>  		<li>[Fix] Fixing some subsilver2 and prosilver style issues</li> @@ -3527,7 +3635,7 @@  	</ul> -	<a name="v30rc2"></a><h3>1.xxvi. Changes since 3.0.RC2</h3> +	<a name="v30rc2"></a><h3>1.xxvii. Changes since 3.0.RC2</h3>  	<ul>  		<li>[Fix] Re-allow searching within the memberlist</li> @@ -3573,7 +3681,7 @@  	</ul> -	<a name="v30rc1"></a><h3>1.xxvii. Changes since 3.0.RC1</h3> +	<a name="v30rc1"></a><h3>1.xxviii. Changes since 3.0.RC1</h3>  	<ul>  		<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li> diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 602067a0e7..cf18cafe90 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.1.0-b4-dev'); +define('PHPBB_VERSION', '3.1.0-b5-dev');  // QA-related  // define('PHPBB_QA', 1); diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 0c2d4ebf74..7daacf92f4 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -37,7 +37,7 @@ $dbms = phpbb_convert_30_dbms_to_31($dbms);  $convertor_data = array(  	'forum_name'	=> 'phpBB 2.0.x',  	'version'		=> '1.0.3', -	'phpbb_version'	=> '3.1.0-b3', +	'phpbb_version'	=> '3.1.0-b4',  	'author'		=> '<a href="https://www.phpbb.com/">phpBB Limited</a>',  	'dbms'			=> $dbms,  	'dbhost'		=> $dbhost, diff --git a/phpBB/install/schemas/schema.json b/phpBB/install/schemas/schema.json index 176691f1a6..f684fddc25 100644 --- a/phpBB/install/schemas/schema.json +++ b/phpBB/install/schemas/schema.json @@ -942,6 +942,10 @@                  "BOOL",                  0              ], +            "group_skip_auth": [ +                "BOOL", +                0 +            ],              "group_name": [                  "VCHAR_CI",                  "" @@ -1009,12 +1013,7 @@              "group_max_recipients": [                  "UINT",                  0 -            ], -            "group_skip_auth": { -                "0": "BOOL", -                "1": 0, -                "after": "group_founder_manage" -            } +            ]          },          "PRIMARY_KEY": "group_id",          "KEYS": { diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 7afed448ad..e335c1f9ba 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -272,7 +272,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.1.0-b4-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-b5-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'); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index e2f89839c5..5e4961c435 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -461,7 +461,7 @@ $lang = array_merge($lang, array(  	'UPLOAD_ICONS_PATH'			=> 'Extension group icons storage path',  	'UPLOAD_ICONS_PATH_EXPLAIN'	=> 'Path under your phpBB root directory, e.g. <samp>images/upload_icons</samp>.',  	'USE_SYSTEM_CRON'		=> 'Run periodic tasks from system cron', -	'USE_SYSTEM_CRON_EXPLAIN'		=> 'When off, phpBB will arrange for periodic tasks to be run automatically. When on, phpBB will not schedule any periodic tasks by itself; a system administrator must arrange for <code>cron.php</code> to be invoked by the system cron facility at regular intervals (e.g. every 5 minutes).', +	'USE_SYSTEM_CRON_EXPLAIN'		=> 'When off, phpBB will arrange for periodic tasks to be run automatically. When on, phpBB will not schedule any periodic tasks by itself; a system administrator must arrange for <code>bin/phpbbcli.php cron:run</code> to be run by the system cron facility at regular intervals (e.g. every 5 minutes).',  ));  // Security Settings diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index d340e467be..ace8522ec8 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -223,8 +223,14 @@ $lang = array_merge($lang, array(  	'BACK'					=> 'Back', +	'CLI_DESCRIPTION_CRON_RUN'				=> 'Runs all ready cron tasks.', +	'CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1'	=> 'Name of the task to be run', +  	'COLOUR_SWATCH'			=> 'Web-safe colour swatch',  	'CONFIG_UPDATED'		=> 'Configuration updated successfully.', +	'CRON_LOCK_ERROR'		=> 'Could not obtain cron lock.', +	'CRON_NO_SUCH_TASK'		=> 'Could not find cron task “%s”.', +	'CRON_NO_TASK'			=> 'No cron tasks need to be run right now.',  	'DEACTIVATE'				=> 'Deactivate',  	'DIRECTORY_DOES_NOT_EXIST'	=> 'The entered path “%s” does not exist.', @@ -285,6 +291,7 @@ $lang = array_merge($lang, array(  	'REMIND'							=> 'Remind',  	'RESYNC'							=> 'Resynchronise', +	'RUNNING_TASK'			=> 'Running task: %s.',  	'SELECT_ANONYMOUS'		=> 'Select anonymous user',  	'SELECT_OPTION'			=> 'Select option', diff --git a/phpBB/phpbb/console/command/cron/run.php b/phpBB/phpbb/console/command/cron/run.php new file mode 100644 index 0000000000..1029a2e085 --- /dev/null +++ b/phpBB/phpbb/console/command/cron/run.php @@ -0,0 +1,176 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited +* @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\console\command\cron; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class run extends \phpbb\console\command\command +{ +	/** @var \phpbb\cron\manager */ +	protected $cron_manager; + +	/** @var \phpbb\lock\db */ +	protected $lock_db; + +	/** @var \phpbb\user */ +	protected $user; + +	/** +	* Construct method +	* +	* @param \phpbb\cron\manager $cron_manager The cron manager containing +	*		the cron tasks to be executed. +	* @param \phpbb\lock\db $lock_db The lock for accessing database. +	* @param \phobb\user $user The user object (used to get language information) +	*/ +	public function __construct(\phpbb\cron\manager $cron_manager, \phpbb\lock\db $lock_db, \phpbb\user $user) +	{ +		$this->cron_manager = $cron_manager; +		$this->lock_db = $lock_db; +		$this->user = $user; +		parent::__construct(); +	} + +	/** +	* Sets the command name and description +	* +	* @return null +	*/ +	protected function configure() +	{ +		$this +			->setName('cron:run') +			->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_RUN')) +			->addArgument('name', InputArgument::OPTIONAL, $this->user->lang('CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1')) +		; +	} + +	/** +	* Executes the command cron:run. +	* +	* Tries to acquire the cron lock, then if no argument has been given runs all ready cron tasks. +	* If the cron lock can not be obtained, an error message is printed +	*		and the exit status is set to 1. +	* If the verbose option is specified, each start of a task is printed. +	*		Otherwise there is no output. +	* If an argument is given to the command, only the task whose name matches the +	*		argument will be started. If verbose option is specified, +	*		an info message containing the name of the task is printed. +	* If no task matches the argument given, an error message is printed +	*		and the exit status is set to 2. +	* +	* @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. +	*/ +	protected function execute(InputInterface $input, OutputInterface $output) +	{ +		if ($this->lock_db->acquire()) +		{ +			$task_name = $input->getArgument('name'); +			if ($task_name) +			{ +				$exit_status = $this->run_one($input, $output, $task_name); +			} +			else +			{ +				$exit_status = $this->run_all($input, $output); +			} + +			$this->lock_db->release(); +			return $exit_status; +		} +		else +		{ +			$output->writeln('<error>' . $this->user->lang('CRON_LOCK_ERROR') . '</error>'); +			return 1; +		} +	} + +	/* +	* Executes all ready cron tasks. +	* +	* If verbose mode is set, an info message will be printed if there is no task to +	*		be run, or else for each starting task. +	* +	* @see execute +	* @param InputInterface $input The input stream used to get the argument and verbose option. +	* @param OutputInterface $output The output stream, used for printing verbose-mode and error information. +	* @return int 0 +	*/ +	protected function run_all(InputInterface $input, OutputInterface $output) +	{ +		$run_tasks = $this->cron_manager->find_all_ready_tasks(); + +		if ($run_tasks) +		{ +			foreach ($run_tasks as $task) +			{ +				if ($input->getOption('verbose')) +				{ +					$output->writeln('<info>' . $this->user->lang('RUNNING_TASK', $task->get_name()) . '</info>'); +				} + +				$task->run(); +			} +		} +		else +		{ +			if ($input->getOption('verbose')) +			{ +				$output->writeln('<info>' . $this->user->lang('CRON_NO_TASK') . '</info>'); +			} +		} + +		return 0; +	} + +	/* +	* Executes a given cron task, if it is ready. +	* +	* If there is a task whose name matches $task_name, it is run and 0 is returned. +	*		and if verbose mode is set, print an info message with the name of the task. +	* If there is no task matching $task_name, the function prints an error message +	*		and returns with status 2. +	* +	* @see execute +	* @param string $task_name The name of the task that should be run. +	* @param InputInterface $input The input stream used to get the argument and verbose option. +	* @param OutputInterface $output The output stream, used for printing verbose-mode and error information. +	* @return int 0 if all is well, 2 if no task matches $task_name. +	*/ +	protected function run_one(InputInterface $input, OutputInterface $output, $task_name) +	{ +		$task = $this->cron_manager->find_task($task_name); +		if ($task) +		{ +			if ($input->getOption('verbose')) +			{ +				$output->writeln('<info>' . $this->user->lang('RUNNING_TASK', $task_name) . '</info>'); +			} + +			$task->run(); +			return 0; +		} +		else +		{ +			$output->writeln('<error>' . $this->user->lang('CRON_NO_SUCH_TASK', $task_name) . '</error>'); +			return 2; +		} +	} +} diff --git a/phpBB/phpbb/db/migration/data/v310/beta4.php b/phpBB/phpbb/db/migration/data/v310/beta4.php new file mode 100644 index 0000000000..3e91d95178 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/beta4.php @@ -0,0 +1,33 @@ +<?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\v310; + +class beta4 extends \phpbb\db\migration\migration +{ +	static public function depends_on() +	{ +		return array( +			'\phpbb\db\migration\data\v310\beta3', +			'\phpbb\db\migration\data\v310\extensions_version_check_force_unstable', +			'\phpbb\db\migration\data\v310\reset_missing_captcha_plugin', +		); +	} + +	public function update_data() +	{ +		return array( +			array('config.update', array('version', '3.1.0-b4')), +		); +	} +} diff --git a/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php b/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php index 5941c3aa54..1d6276f484 100644 --- a/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php +++ b/phpBB/phpbb/db/migration/data/v310/extensions_version_check_force_unstable.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package migration -* @copyright (c) 2012 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* 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.  *  */ diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg index b4a96cd811..f3dd72cb52 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.1.0-b3 -phpbb_version = 3.1.0-b3 +style_version = 3.1.0-b4 +phpbb_version = 3.1.0-b4  # Defining a different template bitfield  # template_bitfield = lNg= diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css index 7d9aae86d7..19cb547bd4 100644 --- a/phpBB/styles/prosilver/theme/buttons.css +++ b/phpBB/styles/prosilver/theme/buttons.css @@ -156,15 +156,6 @@ ul.linklist.bulletin li.small-icon:before {  	margin-top: 2px;  } -.notouch.section-viewtopic .post-buttons { -	opacity: 0; -	transition: opacity .5s; -} - -.notouch.section-viewtopic .post:hover .post-buttons { -	opacity: 1; -} -  .post-buttons li {  	float: left;  	margin-right: 3px; diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg index d7cab8ead0..b9e77bfb4f 100644 --- a/phpBB/styles/subsilver2/style.cfg +++ b/phpBB/styles/subsilver2/style.cfg @@ -21,8 +21,8 @@  # General Information about this style  name = subsilver2  copyright = © 2005 phpBB Limited -style_version = 3.1.0-b3 -phpbb_version = 3.1.0-b3 +style_version = 3.1.0-b4 +phpbb_version = 3.1.0-b4  # Defining a different template bitfield  # template_bitfield = lNg= diff --git a/tests/console/cron/fixtures/config.xml b/tests/console/cron/fixtures/config.xml new file mode 100644 index 0000000000..2cb683d409 --- /dev/null +++ b/tests/console/cron/fixtures/config.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<dataset> +	<table name="phpbb_config"> +		<column>config_name</column> +		<column>config_value</column> +		<column>is_dynamic</column> +	</table> +</dataset> diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php new file mode 100644 index 0000000000..8908c536c0 --- /dev/null +++ b/tests/console/cron/run_test.php @@ -0,0 +1,157 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited  +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Tester\CommandTester; +use phpbb\console\command\cron\run; + +require_once dirname(__FILE__) . '/tasks/simple.php'; + +class phpbb_console_command_cron_run_test extends phpbb_database_test_case +{ +	protected $db; +	protected $config; +	protected $lock; +	protected $user; +	protected $cron_manager; +	protected $command_name; +	protected $task; + +	public function getDataSet() +	{ +		return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); +	} + +	public function setUp() +	{ +		global $db, $config, $phpbb_root_path, $phpEx; + +		$db = $this->db = $this->new_dbal(); +		$config = $this->config = new \phpbb\config\config(array('cron_lock' => '0')); +		set_config(null, null, null, $this->config); +		$this->lock = new \phpbb\lock\db('cron_lock', $this->config, $this->db); + +		$this->user = $this->getMock('\phpbb\user'); +		$this->user->method('lang')->will($this->returnArgument(0)); + +		$this->task = new phpbb_cron_task_simple(); +		$tasks = array( +			$this->task, +		); +		$this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $phbEx); + +		$this->assertSame('0', $config['cron_lock']); +	} + +	public function test_normal_use() +	{ +		$command_tester = $this->get_command_tester(); +		$exit_status = $command_tester->execute(array('command' => $this->command_name)); + +		$this->assertSame('', $command_tester->getDisplay()); +		$this->assertSame(true, $this->task->executed); +		$this->assertSame(0, $exit_status); +		$this->assertSame(false, $this->lock->owns_lock()); +	} + +	public function test_verbose_mode() +	{ +		$command_tester = $this->get_command_tester(); +		$exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true)); + +		$this->assertContains('RUNNING_TASK', $command_tester->getDisplay()); +		$this->assertSame(true, $this->task->executed); +		$this->assertSame(0, $exit_status); +		$this->assertSame(false, $this->lock->owns_lock()); +	} + +	public function test_error_lock() +	{ +		$this->lock->acquire(); +		$command_tester = $this->get_command_tester(); +		$exit_status = $command_tester->execute(array('command' => $this->command_name)); + +		$this->assertContains('CRON_LOCK_ERROR', $command_tester->getDisplay()); +		$this->assertSame(false, $this->task->executed); +		$this->assertSame(1, $exit_status); +	} + +	public function test_no_task() +	{ +		$tasks = array( +		); +		$this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx); +		$command_tester = $this->get_command_tester(); +		$exit_status = $command_tester->execute(array('command' => $this->command_name)); + +		$this->assertSame('', $command_tester->getDisplay()); +		$this->assertSame(0, $exit_status); +		$this->assertSame(false, $this->lock->owns_lock()); +	} + +	public function test_no_task_verbose() +	{ +		$tasks = array( +		); +		$this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx); +		$command_tester = $this->get_command_tester(); +		$exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true)); + +		$this->assertContains('CRON_NO_TASK', $command_tester->getDisplay()); +		$this->assertSame(0, $exit_status); +		$this->assertSame(false, $this->lock->owns_lock()); +	} + +	public function test_arg_valid() +	{ +		$command_tester = $this->get_command_tester(); +		$exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'phpbb_cron_task_simple')); + +		$this->assertSame('', $command_tester->getDisplay()); +		$this->assertSame(true, $this->task->executed); +		$this->assertSame(0, $exit_status); +		$this->assertSame(false, $this->lock->owns_lock()); +	} + +	public function test_arg_invalid() +	{ +		$command_tester = $this->get_command_tester(); +		$exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'foo')); + +		$this->assertContains('CRON_NO_SUCH_TASK', $command_tester->getDisplay()); +		$this->assertSame(false, $this->task->executed); +		$this->assertSame(2, $exit_status); +		$this->assertSame(false, $this->lock->owns_lock()); +	} + +	public function test_arg_valid_verbose() +	{ +		$command_tester = $this->get_command_tester(); +		$exit_status = $command_tester->execute(array('command' => $this->command_name, 'name' => 'phpbb_cron_task_simple', '--verbose' => true)); + +		$this->assertContains('RUNNING_TASK', $command_tester->getDisplay()); +		$this->assertSame(true, $this->task->executed); +		$this->assertSame(0, $exit_status); +		$this->assertSame(false, $this->lock->owns_lock()); +	} + +	public function get_command_tester() +	{ +		$application = new Application(); +		$application->add(new run($this->cron_manager, $this->lock, $this->user)); + +		$command = $application->find('cron:run'); +		$this->command_name = $command->getName(); +		return new CommandTester($command); +	} +} diff --git a/tests/console/cron/tasks/simple.php b/tests/console/cron/tasks/simple.php new file mode 100644 index 0000000000..c814c29bde --- /dev/null +++ b/tests/console/cron/tasks/simple.php @@ -0,0 +1,27 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited  +* @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_cron_task_simple extends \phpbb\cron\task\base +{ +	public $executed = false; + +	public function get_name() +	{ +		return get_class($this); +	} + +	public function run() +	{ +		$this->executed = true; +	} +} diff --git a/tests/dbal/migration/dummy_order.php b/tests/dbal/migration/dummy_order.php index b8590f5074..5ab8f5d129 100644 --- a/tests/dbal/migration/dummy_order.php +++ b/tests/dbal/migration/dummy_order.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package testing -* @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* 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.  *  */ diff --git a/tests/dbal/migration/dummy_order_0.php b/tests/dbal/migration/dummy_order_0.php index e45bb0ad44..4caea76704 100644 --- a/tests/dbal/migration/dummy_order_0.php +++ b/tests/dbal/migration/dummy_order_0.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package testing -* @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* 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.  *  */ diff --git a/tests/dbal/migration/dummy_order_1.php b/tests/dbal/migration/dummy_order_1.php index 73f043af5d..ea512765fa 100644 --- a/tests/dbal/migration/dummy_order_1.php +++ b/tests/dbal/migration/dummy_order_1.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package testing -* @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* 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.  *  */ diff --git a/tests/dbal/migration/dummy_order_2.php b/tests/dbal/migration/dummy_order_2.php index 1483b98050..a7669b1ac8 100644 --- a/tests/dbal/migration/dummy_order_2.php +++ b/tests/dbal/migration/dummy_order_2.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package testing -* @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* 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.  *  */ diff --git a/tests/dbal/migration/dummy_order_3.php b/tests/dbal/migration/dummy_order_3.php index 79c542e088..501db09b7e 100644 --- a/tests/dbal/migration/dummy_order_3.php +++ b/tests/dbal/migration/dummy_order_3.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package testing -* @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* 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.  *  */ diff --git a/tests/dbal/migration/dummy_order_4.php b/tests/dbal/migration/dummy_order_4.php index 229a120ecf..77bb5a24b3 100644 --- a/tests/dbal/migration/dummy_order_4.php +++ b/tests/dbal/migration/dummy_order_4.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package testing -* @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* 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.  *  */ diff --git a/tests/dbal/migration/dummy_order_5.php b/tests/dbal/migration/dummy_order_5.php index 04d755009d..8f92392a8b 100644 --- a/tests/dbal/migration/dummy_order_5.php +++ b/tests/dbal/migration/dummy_order_5.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package testing -* @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* 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.  *  */ diff --git a/travis/check-image-icc-profiles.sh b/travis/check-image-icc-profiles.sh index fa9300012a..31848dc9e7 100755 --- a/travis/check-image-icc-profiles.sh +++ b/travis/check-image-icc-profiles.sh @@ -1,7 +1,12 @@  #!/bin/bash  # -# @copyright (c) 2014 phpBB Group -# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# 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.  #  set -e diff --git a/travis/setup-exiftool.sh b/travis/setup-exiftool.sh index 55bcda6c9f..04999b8600 100755 --- a/travis/setup-exiftool.sh +++ b/travis/setup-exiftool.sh @@ -1,7 +1,12 @@  #!/bin/sh  # -# @copyright (c) 2014 phpBB Group -# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# 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.  #  set -e  | 
