Ignore:
Timestamp:
Dec 18, 2005 12:16:03 AM (18 years ago)
Author:
scdev
Message:

detabbed all files ;P

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/coding_standards.txt

    r41 r42  
    77======================================================================
    88
    9 We're following the PEAR coding standards, with minor modifications. 
     9We're following the PEAR coding standards, with minor modifications.
    1010
    1111This is essential reading:
     
    2020
    2121Auth_SQL.inc.php        One PHP Class to be included. The filename is the
    22                         type of class, underscore, name. Or if in subdirs, 
     22                        type of class, underscore, name. Or if in subdirs,
    2323                        this could be /Auth/SQL.inc.php while the class name
    2424                        remains "Auth_SQL"
     
    2929                        directly in the web root.
    3030
    31 script.cli.php          A command-line executable script, possibly executed 
     31script.cli.php          A command-line executable script, possibly executed
    3232                        with CRON, usually outputs TEXT, not HTML.
    3333
     
    4343
    4444Use an indent of 4 spaces, with no tabs. Code and especially comments should
    45 be wrapped <= 80 characters. Exceptions are made in the case where code 
     45be wrapped <= 80 characters. Exceptions are made in the case where code
    4646readability is significantly improved with longer lines.
    4747
     
    8080        action1;
    8181        break;
    82    
     82
    8383    case 2:
    8484        action2;
    8585        break;
    86    
     86
    8787    default:
    8888        defaultaction;
    8989        break;
    90    
     90
    9191    }
    9292
     
    137137======================================================================
    138138
    139 When functions return boolean values, use 'return false;' or 'return true;' 
     139When functions return boolean values, use 'return false;' or 'return true;'
    140140as opposed to 'return 0;' or 'return 1;' or 'return(-1);'.
    141141
     
    149149
    150150    $something = $blah . funky() . ".\".=" . $blab;
    151    
     151
    152152is better than:
    153    
     153
    154154    $something = $blah.funky().".\".=".$blab;
    155155
     
    159159======================================================================
    160160
    161 Use the single quote marks ' to enclose simple strings whenever possible. 
    162 Double quote marks " require extra parsing and thus slow things down, but 
    163 are necessary if entities there must be swapped-out such as variables or 
     161Use the single quote marks ' to enclose simple strings whenever possible.
     162Double quote marks " require extra parsing and thus slow things down, but
     163are necessary if entities there must be swapped-out such as variables or
    164164control characters.
    165165
     
    196196======================================================================
    197197
    198 Function comments should follow the Javadoc standard, with detailed 
     198Function comments should follow the Javadoc standard, with detailed
    199199function comments and one-line pointers along the way:
    200200http://java.sun.com/products/jdk/javadoc/writingdoccomments/index.html
    201  
     201
    202202    <?php
    203203    /**
     
    215215    {
    216216        $qid = DB::query("SHOW COLUMNS FROM $db_table LIKE '$db_col'",false);
    217            
     217
    218218        $row = mysql_fetch_row($qid);
    219219        if (preg_match('/^enum|^set/i', $row[1]) && preg_match_all("/'([^']*)'/", $row[1], $match)) {
     
    283283======================================================================
    284284
    285 All HTML should be valid XHTML 1.0 verfied with the 
     285All HTML should be valid XHTML 1.0 verfied with the
    286286W3C Markup Validation Service: http://validator.w3.org/
    287287
     
    302302    <td nowrap="nowrap">Example</td>
    303303
    304 All tags must be properly closed. Tags without a closing part must follow the 
     304All tags must be properly closed. Tags without a closing part must follow the
    305305XHTML convention and end with a space and a slash:
    306306
Note: See TracChangeset for help on using the changeset viewer.