aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/docs/coding-guidelines.html
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/docs/coding-guidelines.html')
-rw-r--r--phpBB/docs/coding-guidelines.html30
1 files changed, 15 insertions, 15 deletions
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 56b71006c7..569ffe680c 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
-<meta name="description" content="Ascraeus coding guidelines document" />
+<meta name="description" content="Rhea coding guidelines document" />
<title>phpBB3 &bull; Coding Guidelines</title>
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
@@ -22,7 +22,7 @@
<div id="doc-description">
<a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
<h1>Coding Guidelines</h1>
- <p>Ascraeus coding guidelines document</p>
+ <p>Rhea coding guidelines document</p>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
@@ -37,7 +37,7 @@
<!-- BEGIN DOCUMENT -->
<p class="paragraph main-description">
- These are the phpBB Coding Guidelines for Ascraeus, all attempts should be made to follow them as closely as possible.
+ These are the phpBB Coding Guidelines for Rhea, all attempts should be made to follow them as closely as possible.
</p>
<h1>Coding Guidelines</h1>
@@ -627,7 +627,7 @@ $min = ($i &lt; $j) ? $i : $j;</pre>
<pre>if (isset($forum) &amp;&amp; $forum == 5)</pre>
</div>
- <p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) &amp;&amp; sizeof($array) &gt; 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p>
+ <p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) &amp;&amp; count($array) &gt; 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p>
<h4>Switch statements:</h4>
<p>Switch/case code blocks can get a bit long sometimes. To have some level of notice and being in-line with the opening/closing brace requirement (where they are on the same line for better readability), this also applies to switch/case code blocks and the breaks. An example:</p>
@@ -994,9 +994,9 @@ $sql = $db-&gt;sql_build_query('SELECT', $sql_array);</pre>
<h4>Operations in loop definition: </h4>
<p>Always try to optimize your loops if operations are going on at the comparing part, since this part is executed every time the loop is parsed through. For assignments a descriptive name should be chosen. Example:</p>
- <p class="bad">// On every iteration the sizeof function is called</p>
+ <p class="bad">// On every iteration the count function is called</p>
<div class="codebox"><pre>
-for ($i = 0; $i &lt; sizeof($post_data); $i++)
+for ($i = 0; $i &lt; count($post_data); $i++)
{
do_something();
}</pre>
@@ -1004,7 +1004,7 @@ for ($i = 0; $i &lt; sizeof($post_data); $i++)
<p class="good">// You are able to assign the (not changing) result within the loop itself</p>
<div class="codebox"><pre>
-for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
+for ($i = 0, $size = count($post_data); $i &lt; $size; $i++)
{
do_something();
}</pre>
@@ -1184,8 +1184,8 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
# General Information about this style
name = prosilver_duplicate
copyright = © phpBB Limited, 2007
-style_version = 3.1.0
-phpbb_version = 3.1.0
+style_version = 3.2.0
+phpbb_version = 3.2.0
# Defining a different template bitfield
# template_bitfield = lNg=
@@ -1674,8 +1674,8 @@ div
# General Information about this style
name = Custom Style
copyright = © phpBB Limited, 2007
-style_version = 3.1.0-b1
-phpbb_version = 3.1.0-b1
+style_version = 3.2.0-b1
+phpbb_version = 3.2.0-b1
# Defining a different template bitfield
# template_bitfield = lNg=
@@ -1722,7 +1722,7 @@ This may span multiple lines.
+ first/file/path.html
+ second/file/path.html
* Purpose: Same as above.
-* Since: 3.1.0-b1
+* Since: 3.2.0-b1
</pre></div>
<li>An event that is found multiple times in a file should have the number of instances in parenthesis next to the filename.
<div class="codebox"><pre>event_name
@@ -1731,7 +1731,7 @@ This may span multiple lines.
+ first/file/path.html (2)
+ second/file/path.html
* Purpose: Same as above.
-* Since: 3.1.0-b1
+* Since: 3.2.0-b1
</pre></div></li>
<li>An actual example event documentation:
<div class="codebox"><pre>forumlist_body_last_post_title_prepend
@@ -1740,7 +1740,7 @@ This may span multiple lines.
+ styles/prosilver/template/forumlist_body.html
+ styles/subsilver2/template/forumlist_body.html
* Purpose: Add content before the post title of the latest post in a forum on the forum list.
-* Since: 3.1.0-a1
+* Since: 3.2.0-a1
</pre></div></ul><br />
</div>
@@ -2387,7 +2387,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
You have <code>[1/21/31] slon</code>, <code>[2/3/4] slona</code>, <code>[0/5/6] slonova</code> and <code>[7/8/9/11] ...</code> and some more difficult rules.
</p>
- <p>The <a href="https://wiki.phpbb.com/Plural_Rules">plural system</a> takes care of this and can be used as follows:</p>
+ <p>The <a href="https://area51.phpbb.com/docs/dev/32x/language/plurals.html">plural system</a> takes care of this and can be used as follows:</p>
<p>The PHP code will basically look like this:</p>