Skip to content

Commit 7d4047e

Browse files
authored
Merge pull request #304 from phpbb/update/phpbb_specifiers
Update phpBB specifiers and update templating coding guidelines for phpBB 4.0
2 parents 7730216 + 780cd37 commit 7d4047e

39 files changed

+587
-609
lines changed

development/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BUILDDIR = _build
99

1010
# User-friendly check for sphinx-build
1111
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12-
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
12+
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://sphinx-doc.org/)
1313
endif
1414

1515
# Internal variables.

development/cli/getting_started.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Getting started
44

55
The command line interface (CLI) is a useful utility for phpBB administrators who have access to a shell (or SSH) on the server they run phpBB on, as well as for extension developers. It provides CLI commands for managing config values, extensions, running database migration, purging the cache, and more.
66

7-
Most operating systems ship with a built in command line application. For Mac OS and Ubuntu it is called "Terminal" and for Windows it is called "Command Prompt". Third party software such as `PuTTY <http://www.putty.org>`_ and `iTerm <https://www.iterm2.com>`_ can also be used.
7+
Most operating systems ship with a built in command line application. For Mac OS and Ubuntu it is called "Terminal" and for Windows it is called "Command Prompt". Third party software such as `PuTTY <https://www.putty.org>`_ and `iTerm <https://www.iterm2.com>`_ can also be used.
88

99
To use phpBB's CLI on a web server, you will need SSH access to your web server. You can find out from your web hosting company if they offer SSH access and how to log into your web server from the CLI.
1010

@@ -61,7 +61,7 @@ General options
6161
Common options that can be used with any of phpBB's CLI commands.
6262

6363
.. csv-table::
64-
:header: "Option", "Usage"
64+
:header: Option, Usage
6565
:delim: |
6666

6767
``--help, -h`` | Display a help message
@@ -111,7 +111,7 @@ The phpBB CLI installer uses a YAML file populated with the data needed to confi
111111
112112
server:
113113
cookie_secure: false
114-
server_protocol: http://
114+
server_protocol: https://
115115
force_server_vars: false
116116
server_name: localhost
117117
server_port: 80

development/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
'sensio.sphinx.bestpractice',
3636
'sphinxcontrib.phpdomain',
3737
'sphinx_multiversion',
38-
'sphinx_rtd_theme'
38+
'sphinx_rtd_theme',
39+
'sphinx.ext.autosectionlabel'
3940
]
4041

4142
# Add any paths that contain templates here, relative to this directory.
@@ -101,6 +102,8 @@
101102
# If true, keep warnings as "system message" paragraphs in the built documents.
102103
#keep_warnings = False
103104

105+
autosectionlabel_prefix_document = True
106+
104107
# Options for sphinx_multiversion
105108
smv_tag_whitelist = 'None'
106109
smv_branch_whitelist = r'^(3.2.x|3.3.x|master)$'

development/db/dbal.rst

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Database Abstraction Layer
33
==========================
44

5-
phpBB uses a **D**\ ata\ **B**\ ase **A**\ bstraction **L**\ ayer to access the database instead of directly calling e.g. `mysql_query <http://php.net/manual/en/function.mysql-query.php>`_ functions.
5+
phpBB uses a **D**\ ata\ **B**\ ase **A**\ bstraction **L**\ ayer to access the database instead of directly calling e.g. `mysql_query <https://php.net/manual/en/function.mysql-query.php>`_ functions.
66
You usually access the :abbr:`DBAL (Database Abstraction Layer)` using the global variable ``$db``.
77
This variable is included from :class:`common.php` through :class:`includes/compatibility_globals.php`:
88

@@ -49,11 +49,10 @@ Example using :class:`config.php`:
4949
// We do not need this any longer, unset for safety purposes
5050
unset($dbpasswd);
5151
52-
Parameters
53-
^^^^^^^^^^
52+
.. rubric:: Parameters
5453

5554
.. csv-table::
56-
:header: "Parameter", "Usage"
55+
:header: Parameter, Usage
5756
:delim: #
5857

5958
Host # The host of the database. |br| When using config.php you should use $dbhost instead.
@@ -115,10 +114,10 @@ Example:
115114
// Now run the query...
116115
$result = $db->sql_query($sql);
117116
118-
Parameters
119-
^^^^^^^^^^
117+
.. rubric:: Parameters
118+
120119
.. csv-table::
121-
:header: "Parameter", "Usage"
120+
:header: Parameter, Usage
122121
:delim: #
123122

124123
Query Type # Type of query which needs to be created (SELECT, SELECT_DISTINCT)
@@ -155,10 +154,10 @@ Example:
155154
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $data);
156155
$db->sql_query($sql);
157156
158-
Parameters
159-
^^^^^^^^^^
157+
.. rubric:: Parameters
158+
160159
.. csv-table::
161-
:header: "Parameter", "Usage"
160+
:header: Parameter, Usage
162161
:delim: #
163162

164163
Query Type # Type of query which needs to be created (UPDATE, INSERT, INSERT_SELECT or SELECT)
@@ -179,10 +178,10 @@ Example:
179178
WHERE ' . $db->sql_in_set('user_id', $sql_in);
180179
181180
182-
Parameters
183-
^^^^^^^^^^
181+
.. rubric:: Parameters
182+
184183
.. csv-table::
185-
:header: "Parameter", "Usage"
184+
:header: Parameter, Usage
186185
:delim: |
187186

188187
Column | Name of the sql column that shall be compared
@@ -204,10 +203,10 @@ Example:
204203
WHERE post_id = ' . (int) $integer . "
205204
AND post_text = '" . $db->sql_escape($string) . "'";
206205
207-
Parameters
208-
^^^^^^^^^^
206+
.. rubric:: Parameters
207+
209208
.. csv-table::
210-
:header: "Parameter", "Usage"
209+
:header: Parameter, Usage
211210
:delim: |
212211

213212
String | The string that needs to be escaped.
@@ -220,10 +219,10 @@ Defined in the base driver (``_sql_like_expression`` is defined in the specific
220219

221220
The ``sql_not_like_expression`` is identical to ``sql_like_expression`` apart from that it builds a NOT LIKE statement.
222221

223-
Parameters
224-
^^^^^^^^^^
222+
.. rubric:: Parameters
223+
225224
.. csv-table::
226-
:header: "Parameter", "Usage"
225+
:header: Parameter, Usage
227226
:delim: |
228227

229228
Expression | The expression to use. Every wildcard is escaped, except $db->get_any_char() and $db->get_one_char()
@@ -266,10 +265,10 @@ Example:
266265
WHERE ' . $db->sql_lower_text('log_data') . ' ' . $like;
267266
$result = $db->sql_query_limit($sql, 10);
268267
269-
Parameters
270-
^^^^^^^^^^
268+
.. rubric:: Parameters
269+
271270
.. csv-table::
272-
:header: "Parameter", "Usage"
271+
:header: Parameter, Usage
273272
:delim: |
274273

275274
Column name | The column name to LOWER the value for.
@@ -295,10 +294,10 @@ Example:
295294
$result = $db->sql_query($sql);
296295
297296
298-
Parameters
299-
^^^^^^^^^^
297+
.. rubric:: Parameters
298+
300299
.. csv-table::
301-
:header: "Parameter", "Usage"
300+
:header: Parameter, Usage
302301
:delim: |
303302

304303
Query | Contains the SQL query which shall be executed
@@ -320,10 +319,10 @@ Example:
320319
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
321320
322321
323-
Parameters
324-
^^^^^^^^^^
322+
.. rubric:: Parameters
323+
325324
.. csv-table::
326-
:header: "Parameter", "Usage"
325+
:header: Parameter, Usage
327326
:delim: |
328327

329328
Query | Contains the SQL query which shall be executed.
@@ -356,10 +355,10 @@ Example:
356355
$db->sql_multi_insert(USER_GROUP_TABLE, $sql_ary);
357356
358357
359-
Parameters
360-
^^^^^^^^^^
358+
.. rubric:: Parameters
359+
361360
.. csv-table::
362-
:header: "Parameter", "Usage"
361+
:header: Parameter, Usage
363362
:delim: |
364363

365364
Table name | Table name to run the statements on.
@@ -424,10 +423,10 @@ Example:
424423
$total_posts = (int) $db->sql_fetchfield('num_posts');
425424
426425
427-
Parameters
428-
^^^^^^^^^^
426+
.. rubric:: Parameters
427+
429428
.. csv-table::
430-
:header: "Parameter", "Usage"
429+
:header: Parameter, Usage
431430
:delim: #
432431

433432
Field # Name of the field that needs to be fetched.
@@ -438,11 +437,10 @@ sql_fetchrowset
438437
---------------
439438
Returns an array with the result of using the ``sql_fetchrow`` method on every row. Defined in the base driver.
440439

440+
.. rubric:: Parameters
441441

442-
Parameters
443-
^^^^^^^^^^
444442
.. csv-table::
445-
:header: "Parameter", "Usage"
443+
:header: Parameter, Usage
446444
:delim: #
447445

448446
Result (Optional) # The result that is being evaluated. |br| This result comes from a call to the sql_query method. |br| If left empty the last result will be called.
@@ -476,11 +474,10 @@ Example with a while-loop:
476474
$config[$row['config_name']] = $row['config_value'];
477475
}
478476
477+
.. rubric:: Parameters
479478

480-
Parameters
481-
^^^^^^^^^^
482479
.. csv-table::
483-
:header: "Parameter", "Usage"
480+
:header: Parameter, Usage
484481
:delim: #
485482

486483
Result (Optional) # The result that is being evaluated. |br| The result comes from a call to the sql_query method. |br| If left empty the last result will be called.
@@ -489,11 +486,10 @@ sql_rowseek
489486
-----------
490487
Seeks to given row number. The row number is zero-based. Defined in the specific drivers.
491488

489+
.. rubric:: Parameters
492490

493-
Parameters
494-
^^^^^^^^^^
495491
.. csv-table::
496-
:header: "Parameter", "Usage"
492+
:header: Parameter, Usage
497493
:delim: #
498494

499495
Row number # The number of the row which needs to be found (zero-based).
@@ -519,11 +515,10 @@ Example:
519515
// We don't need to do anything with our query anymore, so lets set it free
520516
$db->sql_freeresult($result);
521517
518+
.. rubric:: Parameters
522519

523-
Parameters
524-
^^^^^^^^^^
525520
.. csv-table::
526-
:header: "Parameter", "Usage"
521+
:header: Parameter, Usage
527522
:delim: #
528523

529524
Result (Optional) # The result that is being evaluated. |br| This result comes from a call to the sql_query method. |br| If left empty the last result will be called.

development/development/css/css_guidelines.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,12 @@ Our project makes use of several tools to lint and keep code up to standards.
323323

324324
.. note:: This is used to help automatically re-format your code on-the-fly to meet standards during the build process via ``gulp`` as well as on save in your editor.
325325

326-
.. note:: Our editors of choice are `PhpStorm`_ & `ATOM`_ which provide useful plugins to make use of these tools. Check out the `Editor Setup`_ section of the docs for more information
326+
.. note:: Our editors of choice are `PhpStorm`_ & `Visual Studio Code`_ which provide useful plugins to make use of these tools. Check out the `Editor Setup`_ section of the docs for more information
327327

328-
.. _stylelint.io: http://www.stylelint.io
328+
.. _stylelint.io: https://stylelint.io/
329329
.. _postcss-sorting: https://github.com/hudochenkov/postcss-sorting
330330
.. _postcss-pxtorem: https://github.com/cuth/postcss-pxtorem
331331
.. _stylefmt: https://github.com/morishitter/stylefmt
332332
.. _PhpStorm: https://www.jetbrains.com/phpstorm/
333-
.. _ATOM: http://www.atom.io
333+
.. _Visual Studio Code: https://code.visualstudio.com/
334334
.. _Editor Setup: /editor-setup

development/development/css/css_selectors.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ Further Reading
248248
- `Writing efficient CSS selectors`_
249249

250250

251-
.. _Shoot to kill; CSS selector intent: http://csswizardry.com/2012/07/shoot-to-kill-css-selector-intent/
252-
.. _‘Scope’ in CSS: http://csswizardry.com/2013/05/scope-in-css/
253-
.. _Keep your CSS selectors short: http://csswizardry.com/2012/05/keep-your-css-selectors-short/
254-
.. _About HTML semantics and front-end architecture: http://nicolasgallagher.com/about-html-semantics-front-end-architecture/
255-
.. _Naming UI components in OOCSS: http://csswizardry.com/2014/03/naming-ui-components-in-oocss/
256-
.. _Writing efficient CSS selectors: http://csswizardry.com/2011/09/writing-efficient-css-selectors/
251+
.. _Shoot to kill; CSS selector intent: https://csswizardry.com/2012/07/shoot-to-kill-css-selector-intent/
252+
.. _‘Scope’ in CSS: https://csswizardry.com/2013/05/scope-in-css/
253+
.. _Keep your CSS selectors short: https://csswizardry.com/2012/05/keep-your-css-selectors-short/
254+
.. _About HTML semantics and front-end architecture: https://nicolasgallagher.com/about-html-semantics-front-end-architecture/
255+
.. _Naming UI components in OOCSS: https://csswizardry.com/2014/03/naming-ui-components-in-oocss/
256+
.. _Writing efficient CSS selectors: https://csswizardry.com/2011/09/writing-efficient-css-selectors/

development/development/css/css_specificity.rst

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ This goes some way to providing our CSS with scope and encapsulation, but does s
169169

170170
Now we have better scoped CSS with minimal specificity—the best of both worlds.
171171

172-
Further Reading
173-
^^^^^^^^^^^^^^^
172+
.. seealso::
174173

175-
- `‘Scope’ in CSS`_
174+
- `‘Scope’ in CSS`_
176175

177176
``!important``
178177
~~~~~~~~~~~~~~
@@ -272,12 +271,11 @@ Here we are selecting based on an attribute rather than an ID, and attribute sel
272271

273272
Do keep in mind that these are hacks, and should not be used unless you have no better alternative.
274273

275-
Further Reading
276-
^^^^^^^^^^^^^^^
274+
.. seealso::
277275

278-
- `Hacks for dealing with specificity`_
276+
- `Hacks for dealing with specificity`_
279277

280-
.. _jsfiddle.net/0yb7rque: http://jsfiddle.net/csswizardry/0yb7rque/
281-
.. _known bug: https://twitter.com/codepo8/status/505004085398224896
282-
.. _‘Scope’ in CSS: http://csswizardry.com/2013/05/scope-in-css/
283-
.. _Hacks for dealing with specificity: http://csswizardry.com/2014/07/hacks-for-dealing-with-specificity/
278+
.. _jsfiddle.net/0yb7rque: https://jsfiddle.net/csswizardry/0yb7rque/
279+
.. _known bug: https://web.archive.org/web/20200512073642/https://twitter.com/codepo8/status/505004085398224896
280+
.. _‘Scope’ in CSS: https://csswizardry.com/2013/05/scope-in-css/
281+
.. _Hacks for dealing with specificity: https://csswizardry.com/2014/07/hacks-for-dealing-with-specificity/

development/development/css/css_standards.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,4 @@ Preprocessor Comments
255255

256256
With most—if not all—preprocessors, we have the option to write comments that will not get compiled out into our resulting CSS file. As a rule, use these comments to speed up and prevent errors in the minification step.
257257

258-
.. _EditorConfig: http://editorconfig.org/
258+
.. _EditorConfig: https://editorconfig.org/

0 commit comments

Comments
 (0)