Changeset 702 for trunk/forum/docs/coding-guidelines.html
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/docs/coding-guidelines.html
r400 r702 58 58 <li><a href="#fileheader">File Header</a></li> 59 59 <li><a href="#locations">File Locations</a></li> 60 <li><a href="#constants">Special Constants</a></li> 60 61 </ol> 61 62 </li> … … 69 70 </ol> 70 71 </li> 71 <li><a href="#styling">Styling</a> </li>72 <li><a href="#styling">Styling</a> 72 73 <ol style="list-style-type: lower-roman;"> 73 74 <li><a href="#cfgfiles">Style Config Files</a></li> … … 87 88 </ol> 88 89 </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> 89 96 <li><a href="#changes">Guidelines Changelog</a></li> 90 97 <li><a href="#disclaimer">Copyright and disclaimer</a></li> … … 119 126 120 127 <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> 122 129 123 130 <a name="fileheader"></a><h3>1.ii. File Header</h3> … … 197 204 <li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li> 198 205 <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> 200 207 <li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li> 201 208 <li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li> … … 218 225 </ul> 219 226 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> 232 PHPBB_MSG_HANDLER (overwrite message handler) 233 PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect) 234 PHPBB_ROOT_PATH (overwrite $phpbb_root_path) 235 PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path) 236 PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $phpbb_root_path) 237 PHPBB_DISABLE_ACP_EDITOR (disable ACP style editor for templates) 238 PHPBB_DISABLE_CONFIG_CHECK (disable ACP config.php writeable check) 239 240 PHPBB_ACM_MEMCACHE_PORT (overwrite memcached port, default is 11211) 241 PHPBB_ACM_MEMCACHE_COMPRESS (overwrite memcached compress setting, default is disabled) 242 PHPBB_ACM_MEMCACHE_HOST (overwrite memcached host name, default is localhost) 243 244 PHPBB_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 220 275 </div> 221 276 … … 1110 1165 1111 1166 <p>You will note in the 3.0 templates the major sources start with <code><!-- INCLUDE overall_header.html --></code> or <code><!-- INCLUDE simple_header.html --></code>, etc. In 2.0.x control of "which" 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 "menu" 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"><!-- INCLUDE {FILE_VAR} --></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"><!-- DEFINE $SOME_VAR = 'my_file.html' --></span> 1177 <span class="comment"><!-- INCLUDE {$SOME_VAR} --></span> 1178 </pre></div> 1112 1179 1113 1180 <h4>PHP</h4> … … 1464 1531 1465 1532 <fieldset class="submit-buttons"> 1466 <input type="reset" value="{L_RESET}" name="reset" class="button2" /> 1467 <input type="submit" name="action[add_warning]" value="{L_SUBMIT}" class="button1" /> 1533 <input type="reset" value="{L_RESET}" name="reset" class="button2" /> 1534 <input type="submit" name="action[add_warning]" value="{L_SUBMIT}" class="button1" /> 1468 1535 {S_FORM_TOKEN} 1469 </fieldset> 1470 </form> 1536 </fieldset> 1537 </form> 1471 1538 </pre></div><br /> 1472 1539 … … 2253 2320 <hr /> 2254 2321 2255 <a name="changes"></a><h2>7. Guidelines Changelog</h2> 2322 <a name="vcs"></a><h2>7. VCS Guidelines</h2> 2323 2256 2324 <div class="paragraph"> 2257 2325 <div class="inner"><span class="corners-top"><span></span></span> … … 2259 2327 <div class="content"> 2260 2328 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> 2359 Authorised 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> 2261 2387 2262 2388 <h3>Revision 8732</h3> … … 2331 2457 <hr /> 2332 2458 2333 <a name="disclaimer"></a><h2> 8. Copyright and disclaimer</h2>2459 <a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2> 2334 2460 2335 2461 <div class="paragraph"> … … 2350 2476 2351 2477 <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> 2353 2479 </div> 2354 2480 </div></div>
Note:
See TracChangeset
for help on using the changeset viewer.