Changeset 42 for trunk/docs


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

detabbed all files ;P

Location:
trunk/docs
Files:
4 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
  • trunk/docs/example_config.inc.php

    r41 r42  
    1212// To work around a PHP bug always include this config file with: require_once dirname(__FILE__) . '/_config.inc.php';
    1313if (!preg_match('!^(/|[A-Z]:)!', __FILE__)) {
    14     trigger_error('_config.inc.php include must be specified with an absolute file path (eg: "require_once dirname(__FILE__) . \'/_config.inc.php\';"', E_USER_ERROR);
     14    trigger_error('_config.inc.php include must be specified with an absolute file path (eg: "require_once dirname(__FILE__) . \'/_config.inc.php\';"', E_USER_ERROR);
    1515}
    1616
     
    1919define('COMMON_BASE', realpath(dirname(__FILE__) . '/../'));
    2020
    21 // The DocRoot for this application. SITE_BASE is ifferent from $_SERVER['DOCUMENT_ROOT'] because the 
     21// The DocRoot for this application. SITE_BASE is ifferent from $_SERVER['DOCUMENT_ROOT'] because the
    2222// latter does not change when using the apache Alias directive or URL Rewriting to define a site.
    2323define('SITE_BASE', dirname(__FILE__));
  • trunk/docs/file_layout.txt

    r41 r42  
    55======================================================================================
    66
    7 codebase/ 
    8     bin/ 
     7codebase/
     8    bin/
    99        (generic command-line scripts and applications)
    1010        file_importer.php
     
    1616            list_template.cli.php
    1717            module.cli.php
    18             skel/ 
     18            skel/
    1919                (templates for generating modules)
    2020                adm_form.ihtml
     
    3232        file_layout.txt
    3333        software_licence.txt
    34         todo.txt   
     34        todo.txt
    3535    lib/
    3636        App.inc.php (functions dealing with sessions, href/url/IP manipulation, directories.)
     
    6161        Upload.inc.php (class that manages uploading of files.)
    6262        Utilities.inc.php (functions for general utility: setting defaults, num/string functions, etc.)
    63     services/ 
     63    services/
    6464        (codebase scripts that are only useful when web accessible, i.e. to be used in a doc root)
    6565        admins.php
     
    7979======================================================================================
    8080
    81 global/ 
     81global/
    8282    (global level configuration and libraries for a group of sites/apps)
    8383    config.inc.php (system-wide configuration)
    8484    db_auth.inc.php (db-authentication for CLI scripts. chown'ed by user executing cron, NOT apache).
    8585
    86 docs/ 
     86docs/
    8787    (documents specific to a group of sites/apps)
    8888    tei_db.mysql (db schema)
    89    
    90 bin/ 
     89
     90bin/
    9191    (global level command-line scripts)
    92    
    93 admin/ 
     92
     93admin/
    9494    (DocumentRoot for the admin application)
    9595    _config.inc.php
     
    107107    versions.php (manage db record versions)
    108108
    109 html/ 
     109html/
    110110    (DocumentRoot of main site application)
    111111    _config.inc.php (configuration options and defaults specific to this site. included first in each script.)
  • trunk/docs/revision_history.txt

    r41 r42  
    1010    - will still run if info missing: db creds, log dir, session info.
    1111    - can be located in /usr/local/lib/php if necessary, so accessible by all sites.
    12    
     12
    1313remove interdependencies:
    1414    - App() is the only dependency for other classes. It includes Utilities.inc.php silently.
    1515    - Update libs requiring external files, such as html templates and email templates, classes now self-contained.
    16    
     16
    1717Things with modified interfaces:
    1818    - App
     
    4141        - lang
    4242    - $dbh database handler
    43    
     43
    4444App object:
    4545    - object belongs to a realm, keeping messages and session data within specific site/app.
    4646    - uses the singleton pattern so only one instance of App exists for each app.
    4747    - app object can be accessed globally without reference to object name by calling methods statically, e.g. App:logMsg()
    48     - seperate application and codebase parameters from site configuration variables. 
     48    - seperate application and codebase parameters from site configuration variables.
    4949      Use $app->getParam('var') or App::getParam('var') to get app params.
    5050      F or site configurations do whatever you want (I'm using $cfg['node']['features'] format for configurations)
    51    
     51
    5252App configuration parameters
    5353    - defaults part of the app class
Note: See TracChangeset for help on using the changeset viewer.