diff --git a/.editorconfig b/.editorconfig index 98ab9f57..d2c22959 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,5 +13,4 @@ trim_trailing_whitespace = true trim_trailing_whitespace = false [*.yml] -indent_size = 4 indent_style = space diff --git a/.travis.yml b/.travis.yml index d5fe94b7..ddfec319 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,22 @@ language: php +dist: xenial matrix: include: - - php: 5.5 + - 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.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: 7.4snapshot + env: DB=mysqli - php: nightly env: DB=mysqli allow_failures: @@ -34,15 +29,21 @@ env: - SNIFF="1" # Should we run code sniffer on your code? - IMAGE_ICC="1" # Should we run icc profile sniffer on your images? - EPV="1" # Should we run EPV (Extension Pre Validator) on your code? - - PHPBB_BRANCH="3.2.x" + - PHPBB_BRANCH="3.3.x" branches: only: - master + - develop + - /^develop-.*$/ - /^\d+(\.\d+)?\.x$/ +services: + - postgresql + - mysql + install: - - travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH + - travis/prepare-phpbb.sh $PHPBB_BRANCH - cd ../../phpBB3 - travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS diff --git a/acp/ideas_module.php b/acp/ideas_module.php index 7a38cf49..52e947c7 100644 --- a/acp/ideas_module.php +++ b/acp/ideas_module.php @@ -16,10 +16,11 @@ class ideas_module public $u_action; /** - * Main ACP module - * - * @access public - */ + * Main ACP module + * + * @access public + * @throws \Exception + */ public function main() { global $phpbb_container; diff --git a/composer.json b/composer.json index 43db0db4..1072acb7 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "extra": { "display-name": "phpBB Ideas", "soft-require": { - "phpbb/phpbb": ">=3.2.0,<3.4" + "phpbb/phpbb": ">=3.2.1,<3.4" } } } diff --git a/controller/idea_controller.php b/controller/idea_controller.php index 7c4b3313..73119306 100644 --- a/controller/idea_controller.php +++ b/controller/idea_controller.php @@ -42,7 +42,7 @@ public function idea($idea_id) $mode = $this->request->variable('mode', ''); if (!empty($mode) && $this->request->is_ajax()) { - $result = call_user_func(array($this, $mode)); + $result = $this->$mode(); return new \Symfony\Component\HttpFoundation\JsonResponse($result); } diff --git a/event/listener.php b/event/listener.php index 64e77e7b..ae07e972 100644 --- a/event/listener.php +++ b/event/listener.php @@ -78,7 +78,7 @@ public function __construct(auth $auth, config $config, helper $helper, ideas $i /** * @inheritDoc */ - static public function getSubscribedEvents() + public static function getSubscribedEvents() { return array( 'core.viewforum_get_topic_data' => 'ideas_forum_redirect', @@ -334,9 +334,9 @@ public function viewonline_ideas($event) public function edit_idea_title($event) { if ($event['mode'] !== 'edit' || + $event['post_data']['topic_first_post_id'] != $event['post_id'] || !$event['update_subject'] || - !$this->is_ideas_forum($event['forum_id']) || - $event['post_data']['topic_first_post_id'] != $event['post_id']) + !$this->is_ideas_forum($event['forum_id'])) { return; } diff --git a/ext.php b/ext.php index 935a6228..4a1460db 100644 --- a/ext.php +++ b/ext.php @@ -25,13 +25,13 @@ class ext extends \phpbb\extension\base * The current phpBB version should meet or exceed * the minimum version required by this extension: * - * Requires phpBB 3.2.0 + * Requires phpBB 3.2.1 due to use of $event->update_subarray(); * * @return bool * @access public */ public function is_enableable() { - return phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>='); + return phpbb_version_compare(PHPBB_VERSION, '3.2.1', '>='); } } diff --git a/factory/ideas.php b/factory/ideas.php index 2b935862..9e8da6f1 100644 --- a/factory/ideas.php +++ b/factory/ideas.php @@ -421,7 +421,7 @@ public function set_title($idea_id, $title) * @param int $user_id The ID of the user voting. * @param int $value Up (1) or down (0)? * - * @return array Array of information. + * @return array|string Array of information or string on error. */ public function vote(&$idea, $user_id, $value) { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d680c095..ef11693e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" verbose="true" bootstrap="../../../../tests/bootstrap.php" > @@ -19,17 +18,14 @@ ./tests/ui - ./tests/functional/ + ./tests/functional/ - ./tests/ui/ + ./tests/ui - - ./tests/ - ./ diff --git a/styles/prosilver/template/ideas.js b/styles/prosilver/template/ideas.js index 7fc871b6..2713f067 100644 --- a/styles/prosilver/template/ideas.js +++ b/styles/prosilver/template/ideas.js @@ -140,7 +140,7 @@ e.preventDefault(); $obj.rfcEdit.add($obj.rfcLink).hide(); - $obj.rfcEditInput.show().focus(); + $obj.rfcEditInput.show().trigger('focus'); }); $obj.rfcEditInput.on('keydown', function(e) { @@ -190,7 +190,7 @@ e.preventDefault(); $obj.ticketEdit.add($obj.ticketLink).hide(); - $obj.ticketEditInput.show().focus(); + $obj.ticketEditInput.show().trigger('focus'); }); $obj.ticketEditInput.on('keydown', function(e) { @@ -245,7 +245,7 @@ e.preventDefault(); $obj.duplicateEdit.add($obj.duplicateLink).hide(); - $obj.duplicateEditInput.show().focus(); + $obj.duplicateEditInput.show().trigger('focus'); }); $obj.duplicateEditInput.on('keydown', function(e) { @@ -301,7 +301,7 @@ e.preventDefault(); $obj.implementedEdit.add($obj.implementedVersion).hide(); - $obj.implementedEditInput.show().focus(); + $obj.implementedEditInput.show().trigger('focus'); }); $obj.implementedEditInput.on('keydown', function(e) { @@ -310,7 +310,7 @@ e.stopPropagation(); var $this = $(this), - find = /^\d\.\d\.\d+(\-\w+)?$/, + find = /^\d\.\d\.\d+(-\w+)?$/, url = $obj.implementedEdit.attr('href'), value = $this.val(); diff --git a/styles/prosilver/theme/ideas.css b/styles/prosilver/theme/ideas.css index 73649bef..2263eae1 100644 --- a/styles/prosilver/theme/ideas.css +++ b/styles/prosilver/theme/ideas.css @@ -14,9 +14,9 @@ dd.topics { font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; - background: url('images/button-sprite.png') no-repeat; - color: #ffffff !important; + background: url("images/button-sprite.png") no-repeat; text-shadow: 0 -1px 0 rgba(0, 0, 0, 1); + color: #ffffff !important; display: inline-block; float: left; width: 65px; diff --git a/tests/controller/controller_base.php b/tests/controller/controller_base.php index fdea408a..ea54fb93 100644 --- a/tests/controller/controller_base.php +++ b/tests/controller/controller_base.php @@ -64,7 +64,7 @@ public function setUp() $this->controller_helper = $this->getMockBuilder('\phpbb\controller\helper') ->disableOriginalConstructor() ->getMock(); - $this->controller_helper->expects($this->any()) + $this->controller_helper->expects($this->atMost(1)) ->method('render') ->willReturnCallback(function ($template_file, $page_title = '', $status_code = 200, $display_online_list = false) { return new \Symfony\Component\HttpFoundation\Response($template_file, $status_code); @@ -72,17 +72,17 @@ public function setUp() $this->ideas = $this->getMockBuilder('\phpbb\ideas\factory\ideas') ->disableOriginalConstructor() ->getMock(); - $this->ideas->expects($this->any()) + $this->ideas->expects($this->atMost(3)) ->method('get_ideas') - ->will($this->returnValue(array(array()))); + ->willReturn(array(array())); $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $this->lang = new \phpbb\language\language($lang_loader); $this->link_helper = $this->getMockBuilder('\phpbb\ideas\factory\linkhelper') ->disableOriginalConstructor() ->getMock(); - $this->link_helper->expects($this->any()) + $this->link_helper->expects($this->atMost(3)) ->method('get_list_link') - ->will($this->returnValue('')); + ->willReturn(''); $this->pagination = $this->getMockBuilder('\phpbb\pagination') ->disableOriginalConstructor() ->getMock(); diff --git a/tests/controller/idea_controller_test.php b/tests/controller/idea_controller_test.php index ab6338e8..fbd913b9 100644 --- a/tests/controller/idea_controller_test.php +++ b/tests/controller/idea_controller_test.php @@ -57,14 +57,13 @@ public function controller_test_data() public function test_controller($idea_id, $mode, $callback, $is_ajax, $authorised, $expected, $status_code, $additional_data = []) { // mock some basic idea data - $this->ideas->expects($this->any()) + $this->ideas->expects($this->once()) ->method('get_idea') - ->will($this->returnValue( - array_merge(array( - 'idea_id' => $idea_id, - 'idea_author' => 2, - 'idea_status' => \phpbb\ideas\factory\ideas::$statuses['NEW'] - ), $additional_data)) + ->willReturn(array_merge(array( + 'idea_id' => $idea_id, + 'idea_author' => 2, + 'idea_status' => \phpbb\ideas\factory\ideas::$statuses['NEW'] + ), $additional_data) ); // mock a result from each method called by the idea controller @@ -72,33 +71,33 @@ public function test_controller($idea_id, $mode, $callback, $is_ajax, $authorise { $this->ideas->expects($this->once()) ->method(($callback)) - ->will($this->returnValue($authorised)); + ->willReturn($authorised); } // set if using ajax or not - $this->request->expects($this->any()) + $this->request->expects($is_ajax ? $this->once() : $this->never()) ->method('is_ajax') - ->will($this->returnValue($is_ajax)); + ->willReturn($is_ajax); // mock some useful variables requested by the idea controller - $this->request->expects($this->any()) + $this->request->expects($this->atLeastOnce()) ->method('variable') ->with($this->anything()) - ->will($this->returnValueMap(array( + ->willReturnMap(array( array('mode', '', false, \phpbb\request\request_interface::REQUEST, $mode), array('hash', '', false, \phpbb\request\request_interface::REQUEST, generate_link_hash("{$mode}_{$idea_id}")), array('status', 0, false, \phpbb\request\request_interface::REQUEST, 1), array('v', 1, false, \phpbb\request\request_interface::REQUEST, 1), - ))); + )); // mock some user permissions during testing - $this->auth->expects($this->any()) + $this->auth ->method('acl_get') ->with($this->stringContains('_'), $this->anything()) - ->will($this->returnValueMap(array( + ->willReturnMap(array( array('m_', 2, $authorised), array('f_vote', 2, $authorised), - ))); + )); // special case, expect trigger_error when a confirm_box return true if ($expected === 'trigger_error') @@ -109,7 +108,8 @@ public function test_controller($idea_id, $mode, $callback, $is_ajax, $authorise if ($status_code === 403) { - $this->setExpectedException('\phpbb\exception\http_exception', 'NO_AUTH_OPERATION'); + $this->expectException('\phpbb\exception\http_exception'); + $this->expectExceptionMessage('NO_AUTH_OPERATION'); } /** @var \phpbb\ideas\controller\idea_controller $controller */ diff --git a/tests/controller/list_controller_test.php b/tests/controller/list_controller_test.php index 1b1c1214..ca69cc05 100644 --- a/tests/controller/list_controller_test.php +++ b/tests/controller/list_controller_test.php @@ -150,15 +150,15 @@ public function controller_test_data() */ public function test_controller($status_code, $page_content, $params, $expected) { - $this->request->expects($this->any()) + $this->request->expects($this->atMost(3)) ->method('variable') - ->will($this->returnValueMap(array( + ->willReturnMap(array( array('sd', 'd', false, \phpbb\request\request_interface::REQUEST, ''), array('status', 0, false, \phpbb\request\request_interface::REQUEST, $params['status']), array('start', 0, false, \phpbb\request\request_interface::REQUEST, 0), - ))); + )); - $this->ideas->expects($this->any()) + $this->ideas->expects($this->once()) ->method('get_ideas') ->with('', $expected['sort'], 'ASC', $expected['status'], 0); diff --git a/tests/controller/post_controller_test.php b/tests/controller/post_controller_test.php index 6c66d614..9ba7f69f 100644 --- a/tests/controller/post_controller_test.php +++ b/tests/controller/post_controller_test.php @@ -120,28 +120,29 @@ public function test_post_success($is_newly_registered_user) $this->controller_helper->expects($this->once()) ->method('route') - ->will($this->returnValue('phpbb_ideas_idea_controller')); + ->willReturn('phpbb_ideas_idea_controller'); $this->request->expects($this->once()) ->method('is_set_post') - ->will($this->returnValueMap(array( + ->willReturnMap(array( array('post', true), - ))); + )); $this->auth->expects($this->once()) ->method('acl_get') ->with('f_noapprove', $this->config['ideas_forum_id']) - ->will($this->returnValue(!$is_newly_registered_user)); + ->willReturn(!$is_newly_registered_user); if ($is_newly_registered_user) { - $this->setExpectedException('\phpbb\exception\http_exception', 'IDEA_STORED_MOD'); + $this->expectException('\phpbb\exception\http_exception'); + $this->expectExceptionMessage('IDEA_STORED_MOD'); } // ideas->submit() will return an idea id on successful submit $this->ideas->expects($this->once()) ->method('submit') - ->will($this->returnValue(1)); + ->willReturn(1); $response = $controller->post(); $this->assertInstanceOf('\Symfony\Component\HttpFoundation\RedirectResponse', $response); @@ -156,19 +157,19 @@ public function test_preview() $controller = $this->get_controller('post_controller'); $this->assertInstanceOf('phpbb\ideas\controller\post_controller', $controller); - $this->request->expects($this->any()) + $this->request->expects($this->atLeastOnce()) ->method('is_set_post') - ->will($this->returnValueMap(array( + ->willReturnMap(array( array('post', false), array('preview', true), - ))); + )); $this->request->expects($this->atLeastOnce()) ->method('variable') - ->will($this->returnValueMap(array( + ->willReturnMap(array( array('title', '', true, \phpbb\request\request_interface::REQUEST, 'test title'), array('message', '', true, \phpbb\request\request_interface::REQUEST, 'test message'), - ))); + )); $this->ideas->expects($this->never()) ->method('submit'); @@ -199,22 +200,22 @@ public function test_submit_errors() $this->request->expects($this->atLeastOnce()) ->method('is_set_post') - ->will($this->returnValueMap(array( + ->willReturnMap(array( array('post', true), array('preview', false), - ))); + )); $this->request->expects($this->atLeastOnce()) ->method('variable') - ->will($this->returnValueMap(array( + ->willReturnMap(array( array('title', '', true, \phpbb\request\request_interface::REQUEST, 'test title'), array('message', '', true, \phpbb\request\request_interface::REQUEST, 'test message'), - ))); + )); // ideas->submit() will return an array of error messages on submit error $this->ideas->expects($this->once()) ->method('submit') - ->will($this->returnValue(array('error1', 'error2'))); + ->willReturn(array('error1', 'error2')); $this->template->expects($this->at(0)) ->method('assign_vars') diff --git a/tests/event/listener_test.php b/tests/event/listener_test.php index e6abad73..4394d201 100644 --- a/tests/event/listener_test.php +++ b/tests/event/listener_test.php @@ -56,7 +56,7 @@ public function setUp() $this->helper = $this->getMockBuilder('\phpbb\controller\helper') ->disableOriginalConstructor() ->getMock(); - $this->helper->expects($this->any()) + $this->helper->expects($this->atMost(1)) ->method('route') ->willReturnCallback(function ($route, array $params = array()) { return $route . '#' . serialize($params); diff --git a/tests/factory/linkhelper_test.php b/tests/factory/linkhelper_test.php index ff49af61..a9950582 100644 --- a/tests/factory/linkhelper_test.php +++ b/tests/factory/linkhelper_test.php @@ -12,7 +12,7 @@ class linkhelper_test extends \phpbb_database_test_case { - static protected function setup_extensions() + protected static function setup_extensions() { return array('phpbb/ideas'); } @@ -31,7 +31,7 @@ public function getDataSet() return $this->createXMLDataSet(__DIR__ . '/../fixtures/ideas.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); @@ -41,7 +41,7 @@ public function setUp() $this->helper = $this->getMockBuilder('\phpbb\controller\helper') ->disableOriginalConstructor() ->getMock(); - $this->helper->expects($this->any()) + $this->helper->expects($this->atMost(3)) ->method('route') ->willReturnCallback(function ($route, array $params = array()) { return $route . '#' . json_encode($params); @@ -52,12 +52,12 @@ public function setUp() $auth = $this->getMockBuilder('\phpbb\auth\auth') ->disableOriginalConstructor() ->getMock(); - $auth->expects($this->any()) + $auth ->method('acl_get') ->with($this->stringContains('_'), $this->anything()) - ->will($this->returnValueMap(array( + ->willReturnMap(array( array('u_viewprofile', true), - ))); + )); $user->data['user_id'] = ANONYMOUS; } diff --git a/tests/functional/ideas_functional_base.php b/tests/functional/ideas_functional_base.php index e617ef23..589df7fc 100644 --- a/tests/functional/ideas_functional_base.php +++ b/tests/functional/ideas_functional_base.php @@ -20,12 +20,12 @@ class ideas_functional_base extends \phpbb_functional_test_case * * @return array vendor/name of extension(s) to test */ - static protected function setup_extensions() + protected static function setup_extensions() { return array('phpbb/ideas'); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->enable_ideas(); diff --git a/tests/functional/ideas_test.php b/tests/functional/ideas_test.php index b71b45da..b8e812cd 100644 --- a/tests/functional/ideas_test.php +++ b/tests/functional/ideas_test.php @@ -135,7 +135,7 @@ public function create_idea($title, $message) // Get the new idea's ID and add it to the data array $url = $crawler->selectLink($this->lang('REMOVE_VOTE'))->link()->getUri(); - preg_match('#\/idea\/(\d+)\?#', $url, $matches); + preg_match('#/idea/(\d+)\?#', $url, $matches); $data['idea_id'] = $matches ? $matches[1] : null; return $data; diff --git a/tests/ideas/get_ideas_test.php b/tests/ideas/get_ideas_test.php index d1752cc8..ba160c94 100644 --- a/tests/ideas/get_ideas_test.php +++ b/tests/ideas/get_ideas_test.php @@ -32,7 +32,7 @@ class get_ideas_test extends ideas_base public function test_get_ideas($test_data, $expected) { // Initialize get_ideas argument values - $number = $sort = $sort_direction = $status = $where = $start = null; + $number = $sort = $sort_direction = $status = $start = null; // Update the default values array with test values foreach ($test_data as $key => $var) @@ -266,10 +266,10 @@ public function get_ideas_data() */ public function test_get_ideas_permissions($is_mod, $expected) { - $this->auth->expects($this->any()) + $this->auth ->method('acl_get') ->with('m_', $this->config['ideas_forum_id']) - ->will($this->returnValue($is_mod)); + ->willReturn($is_mod); $ideas = $this->get_ideas_object(); diff --git a/tests/ideas/ideas_base.php b/tests/ideas/ideas_base.php index 5a10ab34..6c2f54b7 100644 --- a/tests/ideas/ideas_base.php +++ b/tests/ideas/ideas_base.php @@ -12,7 +12,7 @@ class ideas_base extends \phpbb_database_test_case { - static protected function setup_extensions() + protected static function setup_extensions() { return array('phpbb/ideas'); } @@ -40,7 +40,7 @@ public function getDataSet() return $this->createXMLDataSet(__DIR__ . '/../fixtures/ideas.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/ideas/preview_idea_test.php b/tests/ideas/preview_idea_test.php index 8b8fc088..3052ab89 100644 --- a/tests/ideas/preview_idea_test.php +++ b/tests/ideas/preview_idea_test.php @@ -12,7 +12,7 @@ class preview_idea_test extends \phpbb\ideas\tests\ideas\ideas_base { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/ideas/submit_idea_test.php b/tests/ideas/submit_idea_test.php index b47a2bd9..7de28a95 100644 --- a/tests/ideas/submit_idea_test.php +++ b/tests/ideas/submit_idea_test.php @@ -12,7 +12,7 @@ class submit_idea_test extends \phpbb\ideas\tests\ideas\ideas_base { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/ui/ideas_test.php b/tests/ui/ideas_test.php index 94c04c6f..079f9ed8 100644 --- a/tests/ui/ideas_test.php +++ b/tests/ui/ideas_test.php @@ -34,6 +34,7 @@ public static function setUpBeforeClass() * * @throws \Facebook\WebDriver\Exception\NoSuchElementException * @throws \Facebook\WebDriver\Exception\TimeOutException + * @throws \Facebook\WebDriver\Exception\WebDriverCurlException */ public function test_js_actions() { @@ -79,37 +80,4 @@ public function test_js_actions() $this->waitForAjax(); $this->assertEquals($test, $this->find_element('cssSelector', '#ticketlink')->getText()); } - - /** - * Wait for AJAX, this should be added to the framework. - * - * @param string $framework javascript frameworks jquery|prototype|dojo - * @throws \Facebook\WebDriver\Exception\NoSuchElementException - * @throws \Facebook\WebDriver\Exception\TimeOutException - */ - public function waitForAjax($framework = 'jquery') - { - switch ($framework) - { - case 'jquery': - $code = 'return jQuery.active;'; - break; - case 'prototype': - $code = 'return Ajax.activeRequestCount;'; - break; - case 'dojo': - $code = 'return dojo.io.XMLHTTPTransport.inFlight.length;'; - break; - default: - throw new \RuntimeException('Unsupported framework'); - break; - } - // wait for at most 30s, retry every 2000ms (2s) - $driver = $this->getDriver(); - $driver->wait(30, 2000)->until( - function () use ($driver, $code) { - return !$driver->executeScript($code); - } - ); - } } diff --git a/travis/prepare-epv.sh b/travis/prepare-epv.sh index 51e91a8a..31c7c2fe 100755 --- a/travis/prepare-epv.sh +++ b/travis/prepare-epv.sh @@ -14,7 +14,7 @@ set -x EPV=$1 NOTESTS=$2 -if [ "$EPV" == "1" -a "$NOTESTS" == "1" ] +if [ "$EPV" == "1" ] && [ "$NOTESTS" == "1" ] then cd phpBB composer remove sami/sami --update-with-dependencies --dev --no-interaction diff --git a/travis/prepare-phpbb.sh b/travis/prepare-phpbb.sh index 01770ad6..a2cc81ca 100755 --- a/travis/prepare-phpbb.sh +++ b/travis/prepare-phpbb.sh @@ -11,9 +11,7 @@ set -e set -x -EXTNAME=$1 -BRANCH=$2 -EXTPATH_TEMP=$3 +BRANCH=$1 # Copy extension to a temp folder mkdir ../../tmp @@ -21,4 +19,4 @@ cp -R . ../../tmp cd ../../ # Clone phpBB -git clone --depth=1 "git://github.com/phpbb/phpbb.git" "phpBB3" --branch=$BRANCH +git clone --depth=1 "git://github.com/phpbb/phpbb.git" "phpBB3" --branch="$BRANCH"