Ignore:
Timestamp:
Mar 31, 2010, 6:32:40 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Aktualizace fóra.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/forum/docs/coding-guidelines.html

    r400 r702  
    5858                <li><a href="#fileheader">File Header</a></li>
    5959                <li><a href="#locations">File Locations</a></li>
     60                <li><a href="#constants">Special Constants</a></li>
    6061        </ol>
    6162        </li>
     
    6970        </ol>
    7071        </li>
    71         <li><a href="#styling">Styling</a></li>
     72        <li><a href="#styling">Styling</a>
    7273        <ol style="list-style-type: lower-roman;">
    7374                <li><a href="#cfgfiles">Style Config Files</a></li>
     
    8788        </ol>
    8889        </li>
     90        <li><a href="#vcs">VCS Guidelines</a>
     91        <ol style="list-style-type: lower-roman;">
     92                <li><a href="#repostruct">Repository structure</a></li>
     93                <li><a href="#commitmessage">Commit messages</a></li>
     94        </ol>
     95        </li>
    8996        <li><a href="#changes">Guidelines Changelog</a></li>
    9097        <li><a href="#disclaimer">Copyright and disclaimer</a></li>
     
    119126
    120127        <h3>Linefeeds:</h3>
    121         <p>Ensure that your editor is saving files in the UNIX (LF) line ending format. This means that lines are terminated with a newline, not with Windows Line endings (CR/LF combo) as they are on Win32 or Classic Mac (CR) Line endings. Any decent editor should be able to do this, but it might not always be the default setting. Know your editor. If you want advice for an editor for your Operating System, just ask one of the developers. Some of them do their editing on Win32.
     128        <p>Ensure that your editor is saving files in the UNIX (LF) line ending format. This means that lines are terminated with a newline, not with Windows Line endings (CR/LF combo) as they are on Win32 or Classic Mac (CR) Line endings. Any decent editor should be able to do this, but it might not always be the default setting. Know your editor. If you want advice for an editor for your Operating System, just ask one of the developers. Some of them do their editing on Win32.</p>
    122129
    123130        <a name="fileheader"></a><h3>1.ii. File Header</h3>
     
    197204                                <li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li>
    198205                                <li><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL</li>
    199                                 <li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x/4.1.x/5.x
     206                                <li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x/4.1.x/5.x</li>
    200207                                <li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li>
    201208                                <li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
     
    218225        </ul>
    219226
     227        <a name="constants"></a><h3>1.iv. Special Constants</h3>
     228
     229        <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>
     230
     231        <div class="codebox"><pre>
     232PHPBB_MSG_HANDLER          (overwrite message handler)
     233PHPBB_DB_NEW_LINK          (overwrite new_link parameter for sql_connect)
     234PHPBB_ROOT_PATH            (overwrite $phpbb_root_path)
     235PHPBB_ADMIN_PATH           (overwrite $phpbb_admin_path)
     236PHPBB_USE_BOARD_URL_PATH   (use generate_board_url() for image paths instead of $phpbb_root_path)
     237PHPBB_DISABLE_ACP_EDITOR   (disable ACP style editor for templates)
     238PHPBB_DISABLE_CONFIG_CHECK (disable ACP config.php writeable check)
     239
     240PHPBB_ACM_MEMCACHE_PORT     (overwrite memcached port, default is 11211)
     241PHPBB_ACM_MEMCACHE_COMPRESS (overwrite memcached compress setting, default is disabled)
     242PHPBB_ACM_MEMCACHE_HOST     (overwrite memcached host name, default is localhost)
     243
     244PHPBB_QA                   (Set board to QA-Mode, which means the updater also checks for RC-releases)
     245</pre></div>
     246
     247<h4>PHPBB_USE_BOARD_URL_PATH</h4>
     248
     249<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>
     250
     251<ul>
     252        <li>/includes/session.php - user::img()</li>
     253        <li>/includes/functions_content.php - smiley_text()</li>
     254</ul>
     255
     256<p>Path locations for the following template variables are affected by this too:</p>
     257
     258<ul>
     259        <li>{T_THEME_PATH} - styles/xxx/theme</li>
     260        <li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
     261        <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>
     262        <li>{T_IMAGESET_PATH} - styles/xxx/imageset</li>
     263        <li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li>
     264        <li>{T_IMAGES_PATH} - images/</li>
     265        <li>{T_SMILIES_PATH} - $config['smilies_path']/</li>
     266        <li>{T_AVATAR_PATH} - $config['avatar_path']/</li>
     267        <li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li>
     268        <li>{T_ICONS_PATH} - $config['icons_path']/</li>
     269        <li>{T_RANKS_PATH} - $config['ranks_path']/</li>
     270        <li>{T_UPLOAD_PATH} - $config['upload_path']/</li>
     271        <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li>
     272        <li>New template variable {BOARD_URL} for the board url + script path.</li>
     273</ul>
     274
    220275                </div>
    221276
     
    11101165
    11111166<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>
     1167
     1168<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>
     1169<div class="codebox"><pre>
     1170<span class="comment">&lt;!-- INCLUDE {FILE_VAR} --&gt;</span>
     1171</pre></div>
     1172
     1173<p>Template defined variables can also be utilised.</p>
     1174
     1175<div class="codebox"><pre>
     1176<span class="comment">&lt;!-- DEFINE $SOME_VAR = 'my_file.html' --&gt;</span>
     1177<span class="comment">&lt;!-- INCLUDE {$SOME_VAR} --&gt;</span>
     1178</pre></div>
    11121179
    11131180<h4>PHP</h4>
     
    14641531
    14651532        &lt;fieldset class="submit-buttons"&gt;
    1466                 &lt;input type=&quot;reset&quot; value=&quot;{L_RESET}&quot; name=&quot;reset&quot; class=&quot;button2&quot; /&gt&nbsp;
    1467                 &lt;input type=&quot;submit&quot; name=&quot;action[add_warning]&quot; value=&quot;{L_SUBMIT}&quot; class=&quot;button1&quot; /&gt
     1533                &lt;input type=&quot;reset&quot; value=&quot;{L_RESET}&quot; name=&quot;reset&quot; class=&quot;button2&quot; /&gt;&nbsp;
     1534                &lt;input type=&quot;submit&quot; name=&quot;action[add_warning]&quot; value=&quot;{L_SUBMIT}&quot; class=&quot;button1&quot; /&gt;
    14681535                {S_FORM_TOKEN}
    1469         &lt;/fieldset&gt
    1470 &lt;/form&gt
     1536        &lt;/fieldset&gt;
     1537&lt;/form&gt;
    14711538                </pre></div><br />
    14721539
     
    22532320        <hr />
    22542321
    2255 <a name="changes"></a><h2>7. Guidelines Changelog</h2>
     2322<a name="vcs"></a><h2>7. VCS Guidelines</h2>
     2323
    22562324        <div class="paragraph">
    22572325                <div class="inner"><span class="corners-top"><span></span></span>
     
    22592327                <div class="content">
    22602328
     2329        <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>.</p>
     2330
     2331        <a name="repostruct"></a><h3>7.i. Repository Structure</h3>
     2332
     2333        <ul>
     2334                <li><strong>trunk</strong><br />The latest unstable development version with new features etc. Contains the actual board in <code>/trunk/phpBB</code></li>
     2335                <li><strong>branches</strong><br />Development branches of stable phpBB releases. Copied from <code>/trunk</code> at the time of release.
     2336                        <ul>
     2337                                <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>
     2338                                <li><strong>phpBB2</strong><code>/branches/phpBB-2_0_0/phpBB</code><br />Old phpBB2 development branch.</li>
     2339                        </ul>
     2340                </li>
     2341                <li><strong>tags</strong><br />Released versions. Copies of trunk or the respective branch, made at the time of release.
     2342                        <ul>
     2343                                <li><code>/tags/release_3_0_BX</code><br />Beta release X of the 3.0 line.</li>
     2344                                <li><code>/tags/release_3_0_RCX</code><br />Release candidate X of the 3.0 line.</li>
     2345                                <li><code>/tags/release_3_0_X-RCY</code><br />Release candidate Y of the stable 3.0.X release.</li>
     2346                                <li><code>/tags/release_3_0_X</code><br />Stable <strong>3.0.X</strong> release.</li>
     2347                                <li><code>/tags/release_2_0_X</code><br />Old stable 2.0.X release.</li>
     2348                        </ul>
     2349                </li>
     2350        </ul>
     2351
     2352        <a name="commitmessage"></a><h3>7.ii. Commit Messages</h3>
     2353
     2354        <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>
     2355
     2356        <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>
     2357
     2358        <div class="codebox"><pre>
     2359Authorised by: developer1[, developer2[, ...]]
     2360        </pre></div>
     2361
     2362                </div>
     2363
     2364                <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
     2365
     2366                <span class="corners-bottom"><span></span></span></div>
     2367        </div>
     2368
     2369        <hr />
     2370
     2371<a name="changes"></a><h2>8. Guidelines Changelog</h2>
     2372        <div class="paragraph">
     2373                <div class="inner"><span class="corners-top"><span></span></span>
     2374
     2375                <div class="content">
     2376<h3>Revision 10007</h3>
     2377
     2378<ul>
     2379        <li>Added <a href="#constants">Special Constants</a> section.</li>
     2380</ul>
     2381
     2382<h3>Revision 9817</h3>
     2383
     2384<ul>
     2385        <li>Added VCS section.</li>
     2386</ul>
    22612387
    22622388<h3>Revision 8732</h3>
     
    23312457        <hr />
    23322458
    2333 <a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2>
     2459<a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2>
    23342460
    23352461        <div class="paragraph">
     
    23502476
    23512477        <div id="page-footer">
    2352                 <div class="version"> $Id: coding-guidelines.html 9036 2008-10-25 14:16:17Z acydburn $ </div>
     2478                <div class="version"> $Id$ </div>
    23532479        </div>
    23542480</div></div>
Note: See TracChangeset for help on using the changeset viewer.