Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/phpbb/phpbb into feature…
Browse files Browse the repository at this point in the history
…/passwords

Conflicts:
	phpBB/config/services.yml
  • Loading branch information
marc1706 committed Dec 29, 2013
2 parents ac131a5 + db94f80 commit 382317b
Show file tree
Hide file tree
Showing 619 changed files with 13,397 additions and 6,001 deletions.
25 changes: 20 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,33 @@ php:
- 5.3
- 5.4
- 5.5
- hhvm

env:
- DB=mariadb
- DB=mysql
- DB=postgres

before_script:
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"
services:
- redis-server

install:
- sh -c "if [ '$DB' = 'mariadb' ]; then travis/setup-mariadb.sh; fi"
- sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi"
- travis/install-php-extensions.sh
- cd phpBB
- php ../composer.phar install --dev --no-interaction --prefer-source
- cd ..
- sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi"

before_script:
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' -o '$DB' = 'mariadb' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"

script:
- cd build
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' ]; then ../phpBB/vendor/bin/phing sniff; fi"
- cd ..
- phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml

notifications:
Expand All @@ -28,3 +39,7 @@ notifications:
- [email protected]
on_success: change
on_failure: change

matrix:
allow_failures:
- php: hhvm
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ To be able to run an installation from the repo (and not from a pre-built packag
## AUTOMATED TESTING

We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below.
develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3)
develop-olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3)
develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=develop)](http://travis-ci.org/phpbb/phpbb)
develop-olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb)

## LICENSE

Expand Down
52 changes: 49 additions & 3 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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-dev" />
<property name="prevversion" value="3.0.12" />
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9, 3.0.10, 3.0.11" />
<property name="newversion" value="3.1.0-a2" />
<property name="prevversion" value="3.1.0-a1" />
<property name="olderversions" value="3.0.12" />
<!-- no configuration should be needed beyond this point -->

<property name="oldversions" value="${olderversions}, ${prevversion}" />
Expand Down Expand Up @@ -74,6 +74,40 @@
passthru="true" />
</target>

<target name="sniff">
<exec command="phpBB/vendor/bin/phpcs
-s
--extensions=php
--standard=build/code_sniffer/ruleset-php-strict.xml
--ignore=phpBB/phpbb/db/migration/data/v30x/*
phpBB/phpbb"
dir="." returnProperty="retval-php-strict" passthru="true" />
<exec command="phpBB/vendor/bin/phpcs
-s
--extensions=php
--standard=build/code_sniffer/ruleset-php-legacy.xml
--ignore=phpBB/cache/*
--ignore=phpBB/develop/*
--ignore=phpBB/includes/diff/*.php
--ignore=phpBB/includes/sphinxapi.php
--ignore=phpBB/includes/utf/data/*
--ignore=phpBB/install/data/*
--ignore=phpBB/install/database_update.php
--ignore=phpBB/phpbb/*
--ignore=phpBB/vendor/*
phpBB"
dir="." returnProperty="retval-php-legacy" passthru="true" />
<if>
<or>
<not><equals arg1="${retval-php-strict}" arg2="0" /></not>
<not><equals arg1="${retval-php-legacy}" arg2="0" /></not>
</or>
<then>
<fail message="PHP Code Sniffer failed." />
</then>
</if>
</target>

<target name="docs">
<!-- only works if you setup phpdoctor:
git clone https://github.com/peej/phpdoctor.git
Expand Down Expand Up @@ -169,6 +203,18 @@
<exec dir="${dir}" command="sha256sum ${filename} > ${filename}.sha256" />
</target>

<target name="announcement" depends="prepare">
<echo msg="Writing download links and checksums for email announcement to save/announcement_email_${newversion}.txt" />
<exec dir="build" escape="false"
command="php -f build_announcement.php email '${newversion}' 'new_version/release_files' sha256 >
save/announcement_email_${newversion}.txt" />

<echo msg="Writing download links and checksums for bbcode announcement to save/announcement_bbcode_${newversion}.txt" />
<exec dir="build" escape="false"
command="php -f build_announcement.php bbcode '${newversion}' 'new_version/release_files' sha256 >
save/announcement_bbcode_${newversion}.txt" />
</target>

<target name="changelog" depends="prepare">
<exec dir="build" escape="false"
command="php -f build_changelog.php '${newversion}' >
Expand Down
80 changes: 80 additions & 0 deletions build/build_announcement.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env php
<?php
/**
*
* @package build
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

if (php_sapi_name() !== 'cli' || $_SERVER['argc'] != 5)
{
echo "Usage (CLI only): build_announcement.php email|bbcode new_version release_files_dir checksum_algorithm\n";
exit(1);
}

$mode = $_SERVER['argv'][1];
$version = $_SERVER['argv'][2];
$root = $_SERVER['argv'][3];
$checksum_algorithm = $_SERVER['argv'][4];

$series_version = substr($version, 0, 3);
$base_url = "https://download.phpbb.com/pub/release/$series_version";

if (version_compare($version, "$series_version.0", '<'))
{
// Everything before 3.x.0, i.e. unstable (e.g. alpha, beta, rc)
$url = "$base_url/unstable/$version";
}
else if (strpos($version, 'RC') !== false)
{
// Release candidate of stable release
$url = "$base_url/qa/$version";
}
else
{
// Stable release (e.g. 3.x.0, 3.x.1, 3.x.2, 3.x.3-PL1)
$url = "$base_url/$version";
}

if ($mode === 'bbcode')
{
$template = "[url=%1\$s/%2\$s]%2\$s[/url]\n{$checksum_algorithm}sum: %3\$s\n";
}
else
{
$template = "%s/%s\n{$checksum_algorithm}sum: %s\n";
}

function phpbb_rnatsort($array)
{
$strrnatcmp = function($a, $b)
{
return strnatcmp($b, $a);
};
usort($array, $strrnatcmp);
return $array;
}

function phpbb_string_ends_with($haystack, $needle)
{
return substr($haystack, -strlen($needle)) === $needle;
}

function phpbb_get_checksum($checksum_file)
{
return array_shift(explode(' ', file_get_contents($checksum_file)));
}

foreach (phpbb_rnatsort(array_diff(scandir($root), array('.', '..'))) as $filename)
{
if (phpbb_string_ends_with($filename, $checksum_algorithm))
{
continue;
}
else
{
printf($template, $url, $filename, phpbb_get_checksum("$root/$filename.$checksum_algorithm"));
}
}
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions build/code_sniffer/ruleset-minimum.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<ruleset name="phpBB Minimum Standard">

<description>phpBB minimum coding standard</description>

<!-- All code files MUST use only UTF-8 without BOM. -->
<rule ref="Generic.Files.ByteOrderMark" />

<!-- All code files MUST use the Unix LF (linefeed) line ending. -->
<rule ref="Generic.Files.LineEndings" />

<!-- Tabs MUST be used for indentation -->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent" />

</ruleset>
44 changes: 44 additions & 0 deletions build/code_sniffer/ruleset-php-legacy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<ruleset name="phpBB PHP Legacy Standard">

<description>phpBB legacy coding standard for PHP files</description>

<rule ref="./ruleset-minimum.xml" />

<!-- "for (; bar; )" should be "while (bar)" instead -->
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" />

<!-- A method MUST not only call its parent -->
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />

<!-- The body of each structure MUST be enclosed by braces. -->
<rule ref="Generic.ControlStructures.InlineControlStructure" />

<!-- There MUST not be more than one statement per line. -->
<rule ref="Generic.Formatting.DisallowMultipleStatements" />

<!-- Call-time pass-by-reference MUST not be used. -->
<rule ref="Generic.Functions.CallTimePassByReference.NotAllowed" />

<!-- Class constants MUST be declared in all upper case with underscore separators. -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />

<!-- Only <?php, no short tags. -->
<rule ref="Generic.PHP.DisallowShortOpenTag.EchoFound" />

<!-- Method arguments with default values MUST go at the end of the argument list. -->
<rule ref="PEAR.Functions.ValidDefaultValue" />

<!-- In the argument list, there MUST NOT be a space before each comma,
and there MUST be one space after each comma. -->
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
<property name="equalsSpacing" value="1"/>
</properties>
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" />

<!-- The ?> closing tag MUST be omitted from files containing only PHP. -->
<rule ref="Zend.Files.ClosingTag" />

</ruleset>
51 changes: 51 additions & 0 deletions build/code_sniffer/ruleset-php-strict.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<ruleset name="phpBB PHP Strict Standard">

<description>phpBB coding standard for PHP files</description>

<rule ref="./ruleset-php-legacy.xml" />

<!-- There SHOULD NOT be more than 80 characters per line
There MUST NOT be more than 120 characters per line -->
<!--
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="80"/>
<property name="absoluteLineLimit" value="120"/>
</properties>
</rule>
-->

<!-- The PHP constants true, false, and null MUST be in lower case. -->
<rule ref="Generic.PHP.LowerCaseConstant" />

<!-- PHP keywords MUST be in lower case. -->
<rule ref="Generic.PHP.LowerCaseKeyword" />

<!-- There MUST NOT be trailing whitespace at the end of lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />

<!-- There MUST NOT be whitespace before the first content of a file -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />

<!-- There MUST NOT be whitespace after the last content of a file -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />

<!-- Functions MUST NOT contain multiple empty lines in a row -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />

<!-- Classes etc. MUST be namespaced -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace" />

<!-- A file MUST not contain more than one class/interface -->
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses" />

<!-- Files containing classes MUST not have any side-effects -->
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols" />

<!-- When present, all use declarations MUST go after the namespace declaration.
There MUST be one use keyword per declaration.
There MUST be one blank line after the use block. -->
<rule ref="PSR2.Namespaces.UseDeclaration" />

</ruleset>
Binary file removed phpBB/adm/images/corners_left.gif
Binary file not shown.
Binary file removed phpBB/adm/images/corners_left2.gif
Binary file not shown.
Binary file removed phpBB/adm/images/corners_right.gif
Binary file not shown.
Binary file removed phpBB/adm/images/corners_right2.gif
Binary file not shown.
Binary file added phpBB/adm/images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified phpBB/adm/images/no_avatar.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed phpBB/adm/images/toggle.gif
Binary file not shown.
14 changes: 7 additions & 7 deletions phpBB/adm/style/acp_attachments.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ <h2>{L_UPLOADING_FILES}</h2>
{
if (newimage == 'no_image')
{
document.getElementById('image_upload_icon').src = "{PHPBB_ROOT_PATH}images/spacer.gif";
document.getElementById('image_upload_icon').src = "{ROOT_PATH}images/spacer.gif";
}
else
{
document.getElementById('image_upload_icon').src = "{PHPBB_ROOT_PATH}{IMG_PATH}/" + newimage;
document.getElementById('image_upload_icon').src = "{ROOT_PATH}{IMG_PATH}/" + newimage;
}
}

Expand Down Expand Up @@ -192,7 +192,7 @@ <h2>{L_UPLOADING_FILES}</h2>
<dd><select name="upload_icon" id="upload_icon" onchange="update_image(this.options[selectedIndex].value);">
<option value="no_image"<!-- IF S_NO_IMAGE --> selected="selected"<!-- ENDIF -->>{L_NO_IMAGE}</option>{S_FILENAME_LIST}
</select></dd>
<dd>&nbsp;<img <!-- IF S_NO_IMAGE -->src="{PHPBB_ROOT_PATH}images/spacer.gif"<!-- ELSE -->src="{UPLOAD_ICON_SRC}"<!-- ENDIF --> id="image_upload_icon" alt="" title="" />&nbsp;</dd>
<dd>&nbsp;<img <!-- IF S_NO_IMAGE -->src="{ROOT_PATH}images/spacer.gif"<!-- ELSE -->src="{UPLOAD_ICON_SRC}"<!-- ENDIF --> id="image_upload_icon" alt="" title="" />&nbsp;</dd>
</dl>
<dl>
<dt><label for="extgroup_filesize">{L_MAX_EXTGROUP_FILESIZE}{L_COLON}</label></dt>
Expand Down Expand Up @@ -224,7 +224,7 @@ <h2>{L_UPLOADING_FILES}</h2>
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>

<table cellspacing="1">
<table class="table1">
<col class="row1" /><col class="row1" /><col class="row2" />
<thead>
<tr>
Expand Down Expand Up @@ -291,7 +291,7 @@ <h2>{L_UPLOADING_FILES}</h2>
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>

<table cellspacing="1">
<table class="table1">
<col class="row1" /><col class="row1" /><col class="row2" />
<thead>
<tr>
Expand Down Expand Up @@ -331,7 +331,7 @@ <h2>{L_UPLOADING_FILES}</h2>
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>

<table cellspacing="1">
<table class="table1">
<thead>
<tr>
<th>{L_FILENAME}</th>
Expand Down Expand Up @@ -389,7 +389,7 @@ <h2>{L_UPLOADING_FILES}</h2>
<!-- ENDIF -->
</div>

<table cellspacing="1">
<table class="table1">
<thead>
<tr>
<th>{L_FILENAME}</th>
Expand Down
Loading

0 comments on commit 382317b

Please sign in to comment.