aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/docs/coding-guidelines.html
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-03-02 01:05:40 +0100
committerNils Adermann <naderman@naderman.de>2010-03-02 01:05:40 +0100
commit021c186be91095397d4e76801738373989360a52 (patch)
tree4a5b42c0ebcaeb0be77edacb839bf164fe2dadc0 /phpBB/docs/coding-guidelines.html
parent4f9c3b8f5c0181c2ebf367436f3c0336d8f2251d (diff)
parent3ddedd5ff228cdcc3c0b05000affe3944afc7854 (diff)
downloadforums-021c186be91095397d4e76801738373989360a52.tar
forums-021c186be91095397d4e76801738373989360a52.tar.gz
forums-021c186be91095397d4e76801738373989360a52.tar.bz2
forums-021c186be91095397d4e76801738373989360a52.tar.xz
forums-021c186be91095397d4e76801738373989360a52.zip
Merge commit 'release-3.0.6-RC1'
Diffstat (limited to 'phpBB/docs/coding-guidelines.html')
-rw-r--r--phpBB/docs/coding-guidelines.html141
1 files changed, 139 insertions, 2 deletions
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index bfd134faac..8ac2e4e89d 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -57,6 +57,7 @@
<li><a href="#editorsettings">Editor Settings</a></li>
<li><a href="#fileheader">File Header</a></li>
<li><a href="#locations">File Locations</a></li>
+ <li><a href="#constants">Special Constants</a></li>
</ol>
</li>
<li><a href="#code">Code Layout/Guidelines</a>
@@ -86,6 +87,12 @@
<li><a href="#writingstyle">Writing Style</a></li>
</ol>
</li>
+ <li><a href="#vcs">VCS Guidelines</a>
+ <ol style="list-style-type: lower-roman;">
+ <li><a href="#repostruct">Repository structure</a></li>
+ <li><a href="#commitmessage">Commit messages</a></li>
+ </ol>
+ </li>
<li><a href="#changes">Guidelines Changelog</a></li>
<li><a href="#disclaimer">Copyright and disclaimer</a></li>
</ol>
@@ -217,6 +224,54 @@ class ...
<li><strong>styles</strong><br /><code>/styles</code>, <code>style.php</code><br />phpBB Styles/Templates/Themes/Imagesets</li>
</ul>
+ <a name="constants"></a></h3>1.iv. Special Constants</h3>
+
+ <p>There are some special constants application developers are able to utilize to bend some of phpBB's internal functionality to suit their needs.</p>
+
+ <div class="codebox"><pre>
+PHPBB_MSG_HANDLER (overwrite message handler)
+PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect)
+PHPBB_ROOT_PATH (overwrite $phpbb_root_path)
+PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path)
+PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $phpbb_root_path)
+PHPBB_DISABLE_ACP_EDITOR (disable ACP style editor for templates)
+PHPBB_DISABLE_CONFIG_CHECK (disable ACP config.php writeable check)
+
+PHPBB_ACM_MEMCACHE_PORT (overwrite memcached port, default is 11211)
+PHPBB_ACM_MEMCACHE_COMPRESS (overwrite memcached compress setting, default is disabled)
+PHPBB_ACM_MEMCACHE_HOST (overwrite memcached host name, default is localhost)
+
+PHPBB_QA (Set board to QA-Mode, which means the updater also checks for RC-releases)
+</pre></div>
+
+<h4>PHPBB_USE_BOARD_URL_PATH</h4>
+
+<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
+
+<ul>
+ <li>/includes/session.php - user::img()</li>
+ <li>/includes/functions_content.php - smiley_text()</li>
+</ul>
+
+<p>Path locations for the following template variables are affected by this too:</p>
+
+<ul>
+ <li>{T_THEME_PATH} - styles/xxx/theme</li>
+ <li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
+ <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>
+ <li>{T_IMAGESET_PATH} - styles/xxx/imageset</li>
+ <li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li>
+ <li>{T_IMAGES_PATH} - images/</li>
+ <li>{T_SMILIES_PATH} - $config['smilies_path']/</li>
+ <li>{T_AVATAR_PATH} - $config['avatar_path']/</li>
+ <li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li>
+ <li>{T_ICONS_PATH} - $config['icons_path']/</li>
+ <li>{T_RANKS_PATH} - $config['ranks_path']/</li>
+ <li>{T_UPLOAD_PATH} - $config['upload_path']/</li>
+ <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li>
+ <li>New template variable {BOARD_URL} for the board url + script path.</li>
+</ul>
+
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
@@ -1110,6 +1165,29 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<p>You will note in the 3.0 templates the major sources start with <code>&lt;!-- INCLUDE overall_header.html --&gt;</code> or <code>&lt;!-- INCLUDE simple_header.html --&gt;</code>, etc. In 2.0.x control of &quot;which&quot; header to use was defined entirely within the code. In 3.0.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common &quot;menu&quot; bar or some such. No need to modify loads of files as with 2.0.x.</p>
+<p>Added in <strong>3.0.6</strong> is the ability to include a file using a template variable to specify the file, this functionality only works for root variables (i.e. not block variables).</p>
+<div class="codebox"><pre>
+<span class="comment">&lt;!-- INCLUDE {FILE_VAR} --&gt;</span>
+</pre></div>
+
+<p>Template defined variables can also be utilised.
+
+<div class="codebox"><pre>
+<span class="comment">&lt;!-- DEFINE $SOME_VAR = 'my_file.html' --&gt;</span>
+<span class="comment">&lt;!-- INCLUDE {$SOME_VAR} --&gt;</span>
+</pre></div>
+<!-- no longer added in 3.0.6
+<p>Also added in <strong>3.0.6</strong> is the ability to increment or decrement a variable on use. This can be used for instances like tabindexes, where the amount of entries is not statically known.
+The INC (for incrementing) and DEC (for decrementing) commands will print the <strong>current</strong> state of a defined var and then increment/decrement it by one (postincrement/postdecrement).</p>
+
+<div class="codebox"><pre>
+<span class="comment">&lt;!-- DEFINE $SOME_VAR = 1 --&gt;</span>
+<span class="comment">&lt;!-- INC $SOME_VAR --&gt;</span>
+Result: 1<br />
+<span class="comment">{$SOME_VAR}</span>
+Result: 2<br />
+</pre></div>
+//-->
<h4>PHP</h4>
<p>A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:</p>
@@ -2252,12 +2330,71 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<hr />
-<a name="changes"></a><h2>7. Guidelines Changelog</h2>
+<a name="vcs"></a><h2>7. VCS Guidelines</h2>
+
+ <div class="paragraph">
+ <div class="inner"><span class="corners-top"><span></span></span>
+
+ <div class="content">
+
+ <p>The version control system for phpBB3 is subversion. The repository is available at <a href="http://code.phpbb.com/svn/phpbb" title="repository">http://code.phpbb.com/svn/phpbb</a>.
+
+ <a name="repostruct"></a><h3>7.i. Repository Structure</h3>
+
+ <ul>
+ <li><strong>trunk</strong><br />The latest unstable development version with new features etc. Contains the actual board in <code>/trunk/phpBB</code></li>
+ <li><strong>branches</strong><br />Development branches of stable phpBB releases. Copied from <code>/trunk</code> at the time of release.
+ <ul>
+ <li><strong>phpBB3.0</strong><code>/branches/phpBB-3_0_0/phpBB</code><br />Development branch of the stable 3.0 line. Bug fixes are applied here.</li>
+ <li><strong>phpBB2</strong><code>/branches/phpBB-2_0_0/phpBB</code><br />Old phpBB2 development branch.</li>
+ </ul>
+ </li>
+ <li><strong>tags</strong><br />Released versions. Copies of trunk or the respective branch, made at the time of release.
+ <ul>
+ <li><code>/tags/release_3_0_BX</code><br />Beta release X of the 3.0 line.</li>
+ <li><code>/tags/release_3_0_RCX</code><br />Release candidate X of the 3.0 line.</li>
+ <li><code>/tags/release_3_0_X-RCY</code><br />Release candidate Y of the stable 3.0.X release.</li>
+ <li><code>/tags/release_3_0_X</code><br />Stable <strong>3.0.X</strong> release.</li>
+ <li><code>/tags/release_2_0_X</code><br />Old stable 2.0.X release.</li>
+ </ul>
+ </li>
+ </ul>
+
+ <a name="commitmessage"></a><h3>7.ii. Commit Messages</h3>
+
+ <p>The commit message should contain a brief explanation of all changes made within the commit. Often identical to the changelog entry. A bug ticket can be referenced by specifying the ticket ID with a hash, e.g. #12345. A reference to another revision should simply be prefixed with r, e.g. r12345.</p>
+
+ <p>Junior Developers need to have their patches approved by a development team member first. The commit message must end in a line with the following format:</p>
+
+ <div class="codebox"><pre>
+Authorised by: developer1[, developer2[, ...]]
+ </pre></div>
+
+ </div>
+
+ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
+
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+
+ <hr />
+
+<a name="changes"></a><h2>8. Guidelines Changelog</h2>
<div class="paragraph">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
+<h3>Revision 10007</h3>
+
+<ul>
+ <li>Added <a href="#constants">Special Constants</a> section.</li>
+</ul>
+
+<h3>Revision 9817</h3>
+<ul>
+ <li>Added VCS section.</li>
+</ul>
<h3>Revision 8732</h3>
@@ -2330,7 +2467,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<hr />
-<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2>
+<a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2>
<div class="paragraph">
<div class="inner"><span class="corners-top"><span></span></span>