Skip to content

Commit 5df0b2d

Browse files
committed
Merge remote-tracking branch 'origin/develop-3.2.x'
2 parents f13f50e + 27a1802 commit 5df0b2d

42 files changed

Lines changed: 769 additions & 204 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ language: php
55

66
matrix:
77
include:
8-
- php: 5.3.3
9-
env: DB=mysqli
10-
- php: 5.3
11-
env: DB=mysqli # MyISAM
128
- php: 5.4
13-
env: DB=mysqli
9+
env: DB=none;NOTESTS=1
10+
- php: 5.4
11+
env: DB=mysqli #myisam
1412
- php: 5.4
1513
env: DB=mysql
1614
- php: 5.4
@@ -23,6 +21,10 @@ matrix:
2321
env: DB=mysqli
2422
- php: 5.6
2523
env: DB=mysqli
24+
- php: 7.0
25+
env: DB=mysqli
26+
- php: 7.1
27+
env: DB=mysqli
2628
- php: hhvm
2729
env: DB=mysqli
2830
allow_failures:
@@ -35,7 +37,7 @@ env:
3537
- SNIFF="1" # Should we run code sniffer on your code?
3638
- IMAGE_ICC="1" # Should we run icc profile sniffer on your images?
3739
- EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
38-
- PHPBB_BRANCH="3.1.x"
40+
- PHPBB_BRANCH="3.2.x"
3941

4042
branches:
4143
only:
@@ -49,14 +51,14 @@ install:
4951
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
5052
- cd ../../phpBB3
5153
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
52-
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION
53-
- ../phpbb-extensions/pages/travis/prepare-epv.sh $EPV $DB $TRAVIS_PHP_VERSION
54+
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS
55+
- ../phpbb-extensions/pages/travis/prepare-epv.sh $EPV $NOTESTS
5456

5557
before_script:
56-
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
58+
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION $NOTESTS
5759

5860
script:
59-
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi"
60-
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION; fi"
61-
- phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php
62-
- sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.5' ] && [ '$DB' = 'mysqli' ]; then phpBB/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
61+
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME $NOTESTS; fi"
62+
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION $NOTESTS; fi"
63+
- sh -c "if [ '$EPV' != '0' ] && [ '$NOTESTS' = '1' ]; then phpBB/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
64+
- sh -c "if [ '$NOTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php; fi"

acp/pages_module.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ class pages_module
1616

1717
public function main($id, $mode)
1818
{
19-
global $cache, $phpbb_container, $request, $user;
19+
global $cache, $phpbb_container, $request;
20+
21+
/** @var \phpbb\language\language $lang */
22+
$lang = $phpbb_container->get('language');
2023

2124
// Add the pages ACP lang file
22-
$user->add_lang_ext('phpbb/pages', 'pages_acp');
25+
$lang->add_lang('pages_acp', 'phpbb/pages');
2326

2427
// Get an instance of the admin controller
2528
$admin_controller = $phpbb_container->get('phpbb.pages.admin.controller');
@@ -35,14 +38,14 @@ public function main($id, $mode)
3538
$this->tpl_name = 'manage_pages';
3639

3740
// Set the page title for our ACP page
38-
$this->page_title = $user->lang('ACP_PAGES_MANAGE');
41+
$this->page_title = $lang->lang('ACP_PAGES_MANAGE');
3942

4043
// Perform any actions submitted by the user
4144
switch ($action)
4245
{
4346
case 'add':
4447
// Set the page title for our ACP page
45-
$this->page_title = $user->lang('ACP_PAGES_CREATE_PAGE');
48+
$this->page_title = $lang->lang('ACP_PAGES_CREATE_PAGE');
4649

4750
// Load the add page handle in the admin controller
4851
$admin_controller->add_page();
@@ -53,7 +56,7 @@ public function main($id, $mode)
5356

5457
case 'edit':
5558
// Set the page title for our ACP page
56-
$this->page_title = $user->lang('ACP_PAGES_EDIT_PAGE');
59+
$this->page_title = $lang->lang('ACP_PAGES_EDIT_PAGE');
5760

5861
// Load the edit page handle in the admin controller
5962
$admin_controller->edit_page($page_id);
@@ -72,7 +75,7 @@ public function main($id, $mode)
7275
else
7376
{
7477
// Request confirmation from the user to delete the page
75-
confirm_box(false, $user->lang('ACP_PAGES_DELETE_CONFIRM'), build_hidden_fields(array(
78+
confirm_box(false, $lang->lang('ACP_PAGES_DELETE_CONFIRM'), build_hidden_fields(array(
7679
'page_id' => $page_id,
7780
'mode' => $mode,
7881
'action' => $action,

composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "phpbb-extension",
44
"description": "An extension which allows you to add static pages to your phpBB forum",
55
"homepage": "https://www.phpbb.com",
6-
"version": "1.0.5-dev",
6+
"version": "2.0.0-dev",
77
"keywords": ["phpbb", "extension", "static", "pages"],
88
"license": "GPL-2.0",
99
"authors": [
@@ -19,6 +19,11 @@
1919
"homepage": "http://michaelcullum.com",
2020
"role": "Extensions Team Consultant"
2121
},
22+
{
23+
"name": "Tristan Darricau",
24+
"email": "phpbb@nicofuma.fr",
25+
"role": "Extensions Team Consultant"
26+
},
2227
{
2328
"name": "Matt Friedman",
2429
"homepage": "http://mattfriedman.me",
@@ -44,7 +49,8 @@
4449
}
4550
],
4651
"require": {
47-
"php": ">=5.3.3",
52+
"php": ">=5.4",
53+
"phpbb/phpbb": ">=3.2.0@dev",
4854
"composer/installers": "~1.0"
4955
},
5056
"require-dev": {
@@ -53,7 +59,7 @@
5359
"extra": {
5460
"display-name": "Pages",
5561
"soft-require": {
56-
"phpbb/phpbb": ">=3.1.3,<3.3.0@dev"
62+
"phpbb/phpbb": ">=3.2.0@dev,<3.3.0@dev"
5763
},
5864
"version-check": {
5965
"host": "www.phpbb.com",

composer.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/routing.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Dynamic routing for Pages 2.0.x
2+
phpbb_pages_dynamic_controller:
3+
resource: phpbb_pages_new_controller # can be any name, it is not used, but must be present
4+
type: phpbb_pages_route
5+
6+
# Legacy routing from Pages 1.0.x, for backwards compatibility
17
phpbb_pages_main_controller:
28
path: /page/{route}
39
defaults: { _controller: phpbb.pages.controller:display }

config/services.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ services:
55
phpbb.pages.admin.controller:
66
class: phpbb\pages\controller\admin_controller
77
arguments:
8+
- '@cache.driver'
89
- '@controller.helper'
10+
- '@language'
911
- '@log'
1012
- '@phpbb.pages.operator'
1113
- '@request'
@@ -22,6 +24,7 @@ services:
2224
- '@auth'
2325
- '@service_container'
2426
- '@controller.helper'
27+
- '@language'
2528
- '@template'
2629
- '@user'
2730

@@ -30,6 +33,7 @@ services:
3033
arguments:
3134
- '@auth'
3235
- '@controller.helper'
36+
- '@language'
3337
- '@phpbb.pages.operator'
3438
- '@template'
3539
- '@user'
@@ -40,13 +44,13 @@ services:
4044

4145
phpbb.pages.entity:
4246
class: phpbb\pages\entity\page
43-
scope: prototype # scope MUST be prototype for this to work!
47+
shared: false # service MUST not be shared for this to work!
4448
arguments:
4549
- '@dbal.conn'
4650
- '@config'
4751
- '@dispatcher'
4852
- '%phpbb.pages.tables.pages%'
49-
- '@?text_formatter.utils' # optional to allow bc with phpBB 3.1
53+
- '@text_formatter.utils'
5054

5155
phpbb.pages.operator:
5256
class: phpbb\pages\operators\page
@@ -58,3 +62,35 @@ services:
5862
- '%phpbb.pages.tables.pages%'
5963
- '%phpbb.pages.tables.pages_links%'
6064
- '%phpbb.pages.tables.pages_pages_links%'
65+
66+
phpbb.pages.routing.loader:
67+
class: phpbb\pages\routing\page_loader
68+
arguments:
69+
- '@dbal.conn'
70+
- '%phpbb.pages.tables.pages%'
71+
tags:
72+
- { name: routing.loader }
73+
74+
phpbb.pages.text_reparser.page_text:
75+
class: phpbb\pages\textreparser\plugins\pages_text
76+
arguments:
77+
- '@dbal.conn'
78+
- '%phpbb.pages.tables.pages%'
79+
calls:
80+
- [set_name, [phpbb_pages_text]]
81+
tags:
82+
- { name: text_reparser.plugin }
83+
84+
phpbb.pages.cron.task.text_reparser:
85+
class: phpbb\cron\task\text_reparser\reparser
86+
arguments:
87+
- '@config'
88+
- '@config_text'
89+
- '@text_reparser.lock'
90+
- '@text_reparser.manager'
91+
- '@text_reparser_collection'
92+
calls:
93+
- [set_name, [cron.task.text_reparser.phpbb_pages]]
94+
- [set_reparser, [phpbb.pages.text_reparser.page_text]]
95+
tags:
96+
- { name: cron.task }

0 commit comments

Comments
 (0)