diff options
Diffstat (limited to 'phpBB/docs/coding-guidelines.html')
-rw-r--r-- | phpBB/docs/coding-guidelines.html | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 569ffe680c..b2f6780e03 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="Rhea coding guidelines document" /> +<meta name="description" content="Proteus coding guidelines document" /> <title>phpBB3 • Coding Guidelines</title> <link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" /> @@ -20,9 +20,9 @@ <div class="inner"> <div id="doc-description"> - <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> + <a href="../index.php" id="logo"><span class="site_logo"></span></a> <h1>Coding Guidelines</h1> - <p>Rhea coding guidelines document</p> + <p>Proteus 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 Rhea, all attempts should be made to follow them as closely as possible. + These are the phpBB Coding Guidelines for Proteus, all attempts should be made to follow them as closely as possible. </p> <h1>Coding Guidelines</h1> @@ -234,9 +234,9 @@ PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of 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_ACM_MEMCACHED_PORT (overwrite memcached port, default is 11211) +PHPBB_ACM_MEMCACHED_COMPRESS (overwrite memcached compress setting, default is disabled) +PHPBB_ACM_MEMCACHED_HOST (overwrite memcached host name, default is localhost) PHPBB_ACM_REDIS_HOST (overwrite redis host name, default is localhost) PHPBB_ACM_REDIS_PORT (overwrite redis port, default is 6379) @@ -738,7 +738,7 @@ static private function f()</pre> <a name="sql"></a><h3>2.iii. SQL/SQL Layout</h3> <h4>Common SQL Guidelines: </h4> - <p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (8.3+), SQLite, Oracle8, ODBC (generalised if possible)).</p> + <p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL4/5, MSSQL (7.0 and 2000), PostgreSQL (8.3+), SQLite, Oracle8, ODBC (generalised if possible)).</p> <p>All SQL commands should utilise the DataBase Abstraction Layer (DBAL)</p> <h4>SQL code layout:</h4> @@ -1184,8 +1184,8 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp; # General Information about this style name = prosilver_duplicate copyright = © phpBB Limited, 2007 -style_version = 3.2.0 -phpbb_version = 3.2.0 +style_version = 3.3.0 +phpbb_version = 3.3.0 # Defining a different template bitfield # template_bitfield = lNg= @@ -1211,7 +1211,7 @@ parent = prosilver</pre> <td class="gensmall">TEST</td> </pre></div> -<p>Try to match text class types with existing useage, e.g. don't use the nav class where viewtopic uses gensmall for example.</p> +<p>Try to match text class types with existing usage, e.g. don't use the nav class where viewtopic uses gensmall for example.</p> <p>Row colours/classes are now defined by the template, use an <code>IF S_ROW_COUNT</code> switch, see viewtopic or viewforum for an example.</p> @@ -1223,7 +1223,7 @@ parent = prosilver</pre> <p>The separate catXXXX and thXXX classes are gone. When defining a header cell just use <code><th></code> rather than <code><th class="thHead"></code> etc. Similarly for cat, don't use <code><td class="catLeft"></code> use <code><td class="cat"></code> etc.</p> -<p>Try to retain consistency of basic layout and class useage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}<br /><span class="gensmall">{L_POST_USERNAME_EXPLAIN}</span></code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule.</p> +<p>Try to retain consistency of basic layout and class usage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}<br /><span class="gensmall">{L_POST_USERNAME_EXPLAIN}</span></code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule.</p> <p>Try to keep template conditional and other statements tabbed in line with the block to which they refer.</p> @@ -1767,7 +1767,7 @@ This may span multiple lines. <p>The <a href="http://en.wikipedia.org/wiki/Universal_Character_Set">Universal Character Set (UCS)</a> described in ISO/IEC 10646 consists of a large amount of characters. Each of them has a unique name and a code point which is an integer number. <a href="http://en.wikipedia.org/wiki/Unicode">Unicode</a> - which is an industry standard - complements the Universal Character Set with further information about the characters' properties and alternative character encodings. More information on Unicode can be found on the <a href="http://www.unicode.org/">Unicode Consortium's website</a>. One of the Unicode encodings is the <a href="http://en.wikipedia.org/wiki/UTF-8">8-bit Unicode Transformation Format (UTF-8)</a>. It encodes characters with up to four bytes aiming for maximum compatibility with the <a href="http://en.wikipedia.org/wiki/ASCII">American Standard Code for Information Interchange</a> which is a 7-bit encoding of a relatively small subset of the UCS.</p> <h4>phpBB's use of Unicode</h4> -<p>Unfortunately PHP does not faciliate the use of Unicode prior to version 6. Most functions simply treat strings as sequences of bytes assuming that each character takes up exactly one byte. This behaviour still allows for storing UTF-8 encoded text in PHP strings but many operations on strings have unexpected results. To circumvent this problem we have created some alternative functions to PHP's native string operations which use code points instead of bytes. These functions can be found in <code>/includes/utf/utf_tools.php</code>. They are also covered in the <a href="http://area51.phpbb.com/docs/code/">phpBB3 Sourcecode Documentation</a>. A lot of native PHP functions still work with UTF-8 as long as you stick to certain restrictions. For example <code>explode</code> still works as long as the first and the last character of the delimiter string are ASCII characters.</p> +<p>Unfortunately PHP does not facilitate the use of Unicode prior to version 6. Most functions simply treat strings as sequences of bytes assuming that each character takes up exactly one byte. This behaviour still allows for storing UTF-8 encoded text in PHP strings but many operations on strings have unexpected results. To circumvent this problem we have created some alternative functions to PHP's native string operations which use code points instead of bytes. These functions can be found in <code>/includes/utf/utf_tools.php</code>. They are also covered in the <a href="http://area51.phpbb.com/docs/code/">phpBB3 Sourcecode Documentation</a>. A lot of native PHP functions still work with UTF-8 as long as you stick to certain restrictions. For example <code>explode</code> still works as long as the first and the last character of the delimiter string are ASCII characters.</p> <p>phpBB only uses the ASCII and the UTF-8 character encodings. Still all Strings are UTF-8 encoded because ASCII is a subset of UTF-8. The only exceptions to this rule are code sections which deal with external systems which use other encodings and character sets. Such external data should be converted to UTF-8 using the <code>utf8_recode()</code> function supplied with phpBB. It supports a variety of other character sets and encodings, a full list can be found below.</p> @@ -1848,7 +1848,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <p>The <abbr title="Internet Engineering Task Force">IETF</abbr> recently published <a href="http://tools.ietf.org/html/rfc4646">RFC 4646</a> for tags used to identify languages, which in combination with <a href="http://tools.ietf.org/html/rfc4647">RFC 4647</a> obseletes the older <a href="http://tools.ietf.org/html/rfc3066">RFC 3006</a> and older-still <a href="http://tools.ietf.org/html/rfc1766">RFC 1766</a>. <a href="http://tools.ietf.org/html/rfc4646">RFC 4646</a> uses <a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO 639-1/ISO 639-2</a>, <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a>, <a href="http://www.unicode.org/iso15924/iso15924-codes.html">ISO 15924</a> and <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a> to define a language tag. Each complete tag is composed of subtags which are not case sensitive and can also be empty.</p> - <p>Ordering of the subtags in the case that they are all non-empty is: <code>language</code>-<code>script</code>-<code>region</code>-<code>variant</code>-<code>extension</code>-<code>privateuse</code>. Should any subtag be empty, its corresponding hyphen would also be ommited. Thus, the language tag for English will be <code>en</code> <strong>and not</strong> <code>en-----</code>.</p> + <p>Ordering of the subtags in the case that they are all non-empty is: <code>language</code>-<code>script</code>-<code>region</code>-<code>variant</code>-<code>extension</code>-<code>privateuse</code>. Should any subtag be empty, its corresponding hyphen would also be omitted. Thus, the language tag for English will be <code>en</code> <strong>and not</strong> <code>en-----</code>.</p> <p>Most language tags consist of a two- or three-letter language subtag (from <a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO 639-1/ISO 639-2</a>). Sometimes, this is followed by a two-letter or three-digit region subtag (from <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> or <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a>). Some examples are:</p> @@ -1902,7 +1902,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <p>The ultimate aim of a language tag is to convey the needed <strong>useful distingushing information</strong>, whilst keeping it as <strong>short as possible</strong>. So for example, use <code>en</code>, <code>fr</code> and <code>ja</code> as opposed to <code>en-GB</code>, <code>fr-FR</code> and <code>ja-JP</code>, since we know English, French and Japanese are the native language of Great Britain, France and Japan respectively.</p> - <p>Next is the <a href="http://www.unicode.org/iso15924/iso15924-codes.html">ISO 15924</a> language script code and when one should or shouldn't use it. For example, whilst <code>en-Latn</code> is syntaxically correct for describing English written with Latin script, real world English writing is <strong>more-or-less exclusively in the Latin script</strong>. For such languages like English that are written in a single script, the <a href="http://www.iana.org/assignments/language-subtag-registry"><abbr title="Internet Assigned Numbers Authority">IANA</abbr> Language Subtag Registry</a> has a "Suppress-Script" field meaning the script code <strong>should be ommitted</strong> unless a specific language tag requires a specific script code. Some languages are <strong>written in more than one script</strong> and in such cases, the script code <strong>is encouraged</strong> since an end-user may be able to read their language in one script, but not the other. Some examples are:</p> + <p>Next is the <a href="http://www.unicode.org/iso15924/iso15924-codes.html">ISO 15924</a> language script code and when one should or shouldn't use it. For example, whilst <code>en-Latn</code> is syntaxically correct for describing English written with Latin script, real world English writing is <strong>more-or-less exclusively in the Latin script</strong>. For such languages like English that are written in a single script, the <a href="http://www.iana.org/assignments/language-subtag-registry"><abbr title="Internet Assigned Numbers Authority">IANA</abbr> Language Subtag Registry</a> has a "Suppress-Script" field meaning the script code <strong>should be omitted</strong> unless a specific language tag requires a specific script code. Some languages are <strong>written in more than one script</strong> and in such cases, the script code <strong>is encouraged</strong> since an end-user may be able to read their language in one script, but not the other. Some examples are:</p> <table> <caption>Examples of using a language subtag in combination with a script subtag</caption> @@ -1967,7 +1967,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) </tbody> </table> - <p>Usage of the three-digit <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a> code over the two-letter <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> code should hapen if a macro-geographical entity is required and/or the <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> is ambiguous.</p> + <p>Usage of the three-digit <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a> code over the two-letter <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> code should happen if a macro-geographical entity is required and/or the <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> is ambiguous.</p> <p>Examples of English using marco-geographical regions:</p> |