Changeset 479


Ignore:
Timestamp:
May 3, 2014 11:09:03 PM (10 years ago)
Author:
anonymous
Message:

Convert tabs to spaces, and lineendings to LF in all files.

Location:
trunk
Files:
44 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/file_importer.php

    r468 r479  
    3333// $app =& App::getInstance();
    3434// $db =& DB::getInstance();
    35 //  
     35//  
    3636//
    3737// // Test arguments.
  • trunk/bin/module_maker/skel/admin.php

    r468 r479  
    234234{
    235235    global $lock;
    236     $db =& DB::getInstance();
    237     $app =& App::getInstance();
     236    $db =& DB::getInstance();
     237    $app =& App::getInstance();
    238238
    239239    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id);
     
    276276    global $lock;
    277277    global $cache;
    278     $db =& DB::getInstance();
    279     $app =& App::getInstance();
     278    $db =& DB::getInstance();
     279    $app =& App::getInstance();
    280280
    281281    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id);
     
    312312    global $auth;
    313313    global $cache;
    314     $db =& DB::getInstance();
    315     $app =& App::getInstance();
     314    $db =& DB::getInstance();
     315    $app =& App::getInstance();
    316316
    317317    // Remove any stale cached list data.
     
    332332function updateRecord($frm)
    333333{
    334     global $auth;
    335     global $lock;
     334    global $auth;
     335    global $lock;
    336336    global $cache;
    337     $db =& DB::getInstance();
    338     $app =& App::getInstance();
     337    $db =& DB::getInstance();
     338    $app =& App::getInstance();
    339339
    340340    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%']);
     
    364364    global $tmp_prefs;
    365365    global $cache;
    366     $db =& DB::getInstance();
    367     $app =& App::getInstance();
     366    $db =& DB::getInstance();
     367    $app =& App::getInstance();
    368368
    369369    $where_clause = '';
     
    443443{
    444444    global $cache;
    445     $db =& DB::getInstance();
    446     $app =& App::getInstance();
     445    $db =& DB::getInstance();
     446    $app =& App::getInstance();
    447447
    448448    if (!is_array($ranks)) {
  • trunk/docs/examples/contact_form/contact.php

    r468 r479  
    5252    // Validate submitted data.
    5353    validateInput();
    54     if ($fv->anyErrors()) {
     54    if ($fv->anyErrors()) {
    5555        // Re-populate form values with the user data so they can make corrections.
    56         $frm = resetForm(getFormData());
    57     } else {
     56        $frm = resetForm(getFormData());
     57    } else {
    5858        // Setup email object.
    5959        $email = new Email(array(
     
    7474        $frm = resetForm();
    7575        $app->raiseMsg(_("<strong>Thank You!</strong> Your message has been sent."), MSG_SUCCESS, __FILE__, __LINE__);
    76     }
     76    }
    7777} else {
    7878    // Reset form values to display a blank form.
     
    9696function resetForm($new_values = array())
    9797{
    98     $default = array(
    99         'name' => '',
    100         'email' => '',
    101         'message' => '',
    102     );
    103     return array_merge($default, $new_values);
     98    $default = array(
     99        'name' => '',
     100        'email' => '',
     101        'message' => '',
     102    );
     103    return array_merge($default, $new_values);
    104104}
    105105
  • trunk/docs/examples/contact_form/header.ihtml

    r413 r479  
    11<<?php echo '?xml version="1.0" encoding="' . $app->getParam('character_set') . '"?'; ?>>
    22<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    3     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     3    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    44<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    55<head>
  • trunk/lib/ACL.inc.php

    r478 r479  
    5656    public function __construct()
    5757    {
    58         $app =& App::getInstance();
     58        $app =& App::getInstance();
    5959
    6060        // Configure the cache object.
     
    9393    public function setParam($params)
    9494    {
    95         $app =& App::getInstance();
     95        $app =& App::getInstance();
    9696
    9797        if (isset($params) && is_array($params)) {
     
    112112    public function getParam($param)
    113113    {
    114         $app =& App::getInstance();
     114        $app =& App::getInstance();
    115115
    116116        if (array_key_exists($param, $this->_params)) {
     
    131131    public function initDB($recreate_db=false)
    132132    {
    133         $app =& App::getInstance();
    134         $db =& DB::getInstance();
     133        $app =& App::getInstance();
     134        $db =& DB::getInstance();
    135135
    136136        static $_db_tested = false;
     
    715715    public function requireAllow($aro, $aco=null, $axo=null, $message='', $type=MSG_NOTICE, $file=null, $line=null)
    716716    {
    717         $app =& App::getInstance();
     717        $app =& App::getInstance();
    718718
    719719        if (!$this->check($aro, $aco, $axo)) {
  • trunk/lib/App.inc.php

    r478 r479  
    180180        $this->timer->start('_app');
    181181
    182         // The codebase now requires a minimum PHP version.
    183         $codebase_minimum_php_version = '5.3.0';
    184         if (version_compare(PHP_VERSION, $codebase_minimum_php_version, '<')) {
    185             $this->logMsg(sprintf('Codebase minimum PHP version of %s not satisfied (you have %s). ', $codebase_minimum_php_version, phpversion()), LOG_NOTICE, __FILE__, __LINE__);
    186         }
     182        // The codebase now requires a minimum PHP version.
     183        $codebase_minimum_php_version = '5.3.0';
     184        if (version_compare(PHP_VERSION, $codebase_minimum_php_version, '<')) {
     185            $this->logMsg(sprintf('Codebase minimum PHP version of %s not satisfied (you have %s). ', $codebase_minimum_php_version, phpversion()), LOG_NOTICE, __FILE__, __LINE__);
     186        }
    187187    }
    188188
     
    615615        $message = strip_tags(preg_replace('/\s+/', ' ', $message), (!empty($strip_tags_allow[1]) ? join('> ', $strip_tags_allow[1]) . '>' : null));
    616616
    617         // Serialize multi-line messages.
    618         $message = preg_replace('/\s+/m', ' ', $message);
     617        // Serialize multi-line messages.
     618        $message = preg_replace('/\s+/m', ' ', $message);
    619619
    620620        // Store this event under a unique key, counting each time it occurs so that it only gets reported a limited number of times.
     
    12611261    }
    12621262
    1263     /*
    1264     * Sets a cookie, with error checking and some sane defaults.
    1265     *
    1266     * @access   public
    1267     * @param    string  $name       The name of the cookie.
    1268     * @param    string  $value      The value of the cookie.
    1269     * @param    string  $expire     The time the cookie expires, as a unix timestamp or string value passed to strtotime.
    1270     * @param    string  $path       The path on the server in which the cookie will be available on
    1271     * @param    string  $domain     The domain that the cookie is available to
    1272     * @param    bool    $secure     Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client.
    1273     * @param    bool    $httponly   When TRUE the cookie will be made accessible only through the HTTP protocol (makes cookies unreadable to javascript).
    1274     * @return   bool                True on success, false on error.
    1275     * @author   Quinn Comendant <quinn@strangecode.com>
    1276     * @version  1.0
    1277     * @since    02 May 2014 16:36:34
    1278     */
    1279     public function setCookie($name, $value, $expire='+10 years', $path=null, $domain=null, $secure=null, $httponly=null)
    1280     {
    1281         if (!is_scalar($name)) {
    1282             $this->logMsg(sprintf('Cookie name must be scalar, is not: %s', getDump($name)), LOG_NOTICE, __FILE__, __LINE__);
    1283             return false;
    1284         }
    1285         if (!is_scalar($value)) {
    1286             $this->logMsg(sprintf('Cookie "%s" value must be scalar, is not: %s', $name, getDump($value)), LOG_NOTICE, __FILE__, __LINE__);
    1287             return false;
    1288         }
    1289 
    1290         // Defaults.
    1291         $expire = (is_numeric($expire) ? $expire : (is_string($expire) ? strtotime($expire) : $expire));
    1292         $secure = $secure ?: ('' != getenv('HTTPS') && $this->getParam('ssl_enabled'));
    1293         $httponly = $httponly ?: true;
    1294 
    1295         // Make sure the expiration date is a valid 32bit integer.
    1296         if (is_int($expire) && $expire > 2147483647) {
    1297             $this->logMsg(sprintf('Cookie "%s" expire time exceeds a 32bit integer (%s)', $key, date('r', $expire)), LOG_NOTICE, __FILE__, __LINE__);
    1298         }
    1299 
    1300         // Measure total cookie length and warn if larger than max recommended size of 4093.
    1301         // https://stackoverflow.com/questions/640938/what-is-the-maximum-size-of-a-web-browsers-cookies-key
    1302         // The date the header name include 51 bytes: Set-Cookie: ; expires=Fri, 03-May-2024 00:04:47 GMT
    1303         $cookielen = strlen($name . $value . $path . $domain . ($secure ? '; secure' : '') . ($httponly ? '; httponly' : '')) + 51;
    1304         if ($cookielen > 4093) {
    1305             $this->logMsg(sprintf('Cookie "%s" has a size greater than 4093 bytes (is %s bytes)', $key, $cookielen), LOG_NOTICE, __FILE__, __LINE__);
    1306         }
    1307 
    1308         // Ensure PHP version allow use of httponly.
    1309         if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
    1310             $ret = setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
    1311         } else {
    1312             $ret = setcookie($name, $value, $expire, $path, $domain, $secure);
    1313         }
    1314 
    1315         if (false === $ret) {
    1316             $this->logMsg(sprintf('Failed to set cookie (%s=%s) probably due to output before headers.', $name, $value), LOG_NOTICE, __FILE__, __LINE__);
    1317         }
    1318         return $ret;
    1319     }
     1263    /*
     1264    * Sets a cookie, with error checking and some sane defaults.
     1265    *
     1266    * @access   public
     1267    * @param    string  $name       The name of the cookie.
     1268    * @param    string  $value      The value of the cookie.
     1269    * @param    string  $expire     The time the cookie expires, as a unix timestamp or string value passed to strtotime.
     1270    * @param    string  $path       The path on the server in which the cookie will be available on
     1271    * @param    string  $domain     The domain that the cookie is available to
     1272    * @param    bool    $secure     Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client.
     1273    * @param    bool    $httponly   When TRUE the cookie will be made accessible only through the HTTP protocol (makes cookies unreadable to javascript).
     1274    * @return   bool                True on success, false on error.
     1275    * @author   Quinn Comendant <quinn@strangecode.com>
     1276    * @version  1.0
     1277    * @since    02 May 2014 16:36:34
     1278    */
     1279    public function setCookie($name, $value, $expire='+10 years', $path=null, $domain=null, $secure=null, $httponly=null)
     1280    {
     1281        if (!is_scalar($name)) {
     1282            $this->logMsg(sprintf('Cookie name must be scalar, is not: %s', getDump($name)), LOG_NOTICE, __FILE__, __LINE__);
     1283            return false;
     1284        }
     1285        if (!is_scalar($value)) {
     1286            $this->logMsg(sprintf('Cookie "%s" value must be scalar, is not: %s', $name, getDump($value)), LOG_NOTICE, __FILE__, __LINE__);
     1287            return false;
     1288        }
     1289
     1290        // Defaults.
     1291        $expire = (is_numeric($expire) ? $expire : (is_string($expire) ? strtotime($expire) : $expire));
     1292        $secure = $secure ?: ('' != getenv('HTTPS') && $this->getParam('ssl_enabled'));
     1293        $httponly = $httponly ?: true;
     1294
     1295        // Make sure the expiration date is a valid 32bit integer.
     1296        if (is_int($expire) && $expire > 2147483647) {
     1297            $this->logMsg(sprintf('Cookie "%s" expire time exceeds a 32bit integer (%s)', $key, date('r', $expire)), LOG_NOTICE, __FILE__, __LINE__);
     1298        }
     1299
     1300        // Measure total cookie length and warn if larger than max recommended size of 4093.
     1301        // https://stackoverflow.com/questions/640938/what-is-the-maximum-size-of-a-web-browsers-cookies-key
     1302        // The date the header name include 51 bytes: Set-Cookie: ; expires=Fri, 03-May-2024 00:04:47 GMT
     1303        $cookielen = strlen($name . $value . $path . $domain . ($secure ? '; secure' : '') . ($httponly ? '; httponly' : '')) + 51;
     1304        if ($cookielen > 4093) {
     1305            $this->logMsg(sprintf('Cookie "%s" has a size greater than 4093 bytes (is %s bytes)', $key, $cookielen), LOG_NOTICE, __FILE__, __LINE__);
     1306        }
     1307
     1308        // Ensure PHP version allow use of httponly.
     1309        if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
     1310            $ret = setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
     1311        } else {
     1312            $ret = setcookie($name, $value, $expire, $path, $domain, $secure);
     1313        }
     1314
     1315        if (false === $ret) {
     1316            $this->logMsg(sprintf('Failed to set cookie (%s=%s) probably due to output before headers.', $name, $value), LOG_NOTICE, __FILE__, __LINE__);
     1317        }
     1318        return $ret;
     1319    }
    13201320} // End.
  • trunk/lib/Auth_SQL.inc.php

    r478 r479  
    129129    public function __construct($namespace='')
    130130    {
    131         $app =& App::getInstance();
     131        $app =& App::getInstance();
    132132
    133133        $this->_ns = $namespace;
     
    155155    public function initDB($recreate_db=false)
    156156    {
    157         $app =& App::getInstance();
    158         $db =& DB::getInstance();
     157        $app =& App::getInstance();
     158        $db =& DB::getInstance();
    159159
    160160
     
    276276    public function getParam($param)
    277277    {
    278         $app =& App::getInstance();
     278        $app =& App::getInstance();
    279279
    280280        if (array_key_exists($param, $this->_params)) {
     
    293293    public function clear()
    294294    {
    295         $db =& DB::getInstance();
     295        $db =& DB::getInstance();
    296296
    297297        $this->initDB();
     
    363363    public function authenticate($username, $password)
    364364    {
    365         $app =& App::getInstance();
    366         $db =& DB::getInstance();
     365        $app =& App::getInstance();
     366        $db =& DB::getInstance();
    367367
    368368        $this->initDB();
     
    414414    public function login($username, $password)
    415415    {
    416         $app =& App::getInstance();
    417         $db =& DB::getInstance();
     416        $app =& App::getInstance();
     417        $db =& DB::getInstance();
    418418
    419419        $this->initDB();
     
    541541    public function isLoggedIn($user_id=null)
    542542    {
    543         $app =& App::getInstance();
    544         $db =& DB::getInstance();
     543        $app =& App::getInstance();
     544        $db =& DB::getInstance();
    545545
    546546        $this->initDB();
     
    673673    public function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null)
    674674    {
    675         $app =& App::getInstance();
     675        $app =& App::getInstance();
    676676
    677677        if (!$this->isLoggedIn()) {
     
    695695    public function blockAccount($user_id=null, $reason='')
    696696    {
    697         $app =& App::getInstance();
    698         $db =& DB::getInstance();
     697        $app =& App::getInstance();
     698        $db =& DB::getInstance();
    699699
    700700        $this->initDB();
     
    725725    public function isBlocked($user_id=null)
    726726    {
    727         $db =& DB::getInstance();
     727        $db =& DB::getInstance();
    728728
    729729        $this->initDB();
     
    747747    public function unblockAccount($user_id=null)
    748748    {
    749         $db =& DB::getInstance();
     749        $db =& DB::getInstance();
    750750
    751751        $this->initDB();
     
    771771    public function usernameExists($username)
    772772    {
    773         $db =& DB::getInstance();
     773        $db =& DB::getInstance();
    774774
    775775        $this->initDB();
     
    791791    public function getUsername($user_id)
    792792    {
    793         $db =& DB::getInstance();
     793        $db =& DB::getInstance();
    794794
    795795        $this->initDB();
     
    903903    public function setPassword($user_id=null, $password)
    904904    {
    905         $app =& App::getInstance();
    906         $db =& DB::getInstance();
     905        $app =& App::getInstance();
     906        $db =& DB::getInstance();
    907907
    908908        $this->initDB();
     
    953953    public function resetPassword($user_id=null, $reason='')
    954954    {
    955         $app =& App::getInstance();
    956         $db =& DB::getInstance();
     955        $app =& App::getInstance();
     956        $db =& DB::getInstance();
    957957
    958958        $this->initDB();
     
    10401040    public function requireAccessClearance($security_zone, $message='')
    10411041    {
    1042         $app =& App::getInstance();
     1042        $app =& App::getInstance();
    10431043
    10441044        $zone_members = preg_split('/,\s*/', $security_zone);
  • trunk/lib/AuthorizeNet.inc.php

    r478 r479  
    155155    public function setParam($params)
    156156    {
    157         $app =& App::getInstance();
     157        $app =& App::getInstance();
    158158
    159159        if (isset($params) && is_array($params)) {
     
    174174    public function getParam($param)
    175175    {
    176         $app =& App::getInstance();
     176        $app =& App::getInstance();
    177177
    178178        if (array_key_exists($param, $this->_params)) {
     
    194194    public function process()
    195195    {
    196         $app =& App::getInstance();
     196        $app =& App::getInstance();
    197197
    198198        if (empty($this->_params['x_login'])) {
  • trunk/lib/CSS.inc.php

    r478 r479  
    5050    public function setParam($params)
    5151    {
    52         $app =& App::getInstance();
     52        $app =& App::getInstance();
    5353
    5454        if (isset($params) && is_array($params)) {
     
    6969    public function getParam($param)
    7070    {
    71         $app =& App::getInstance();
     71        $app =& App::getInstance();
    7272
    7373        if (array_key_exists($param, $this->_params)) {
     
    8989    public function setFile($file, $realms='')
    9090    {
    91         $app =& App::getInstance();
     91        $app =& App::getInstance();
    9292
    9393        if (!is_array($realms)) {
     
    117117    public function headers($realm='')
    118118    {
    119         $app =& App::getInstance();
     119        $app =& App::getInstance();
    120120
    121121        $realm = '' == $realm ? 'default' : $realm;
  • trunk/lib/Cache.inc.php

    r478 r479  
    110110    public function setParam($params)
    111111    {
    112         $app =& App::getInstance();
     112        $app =& App::getInstance();
    113113
    114114        if (isset($params) && is_array($params)) {
     
    129129    public function getParam($param)
    130130    {
    131         $app =& App::getInstance();
     131        $app =& App::getInstance();
    132132
    133133        if (array_key_exists($param, $this->_params)) {
     
    151151    public function set($key, $var, $allow_oversized=false)
    152152    {
    153         $app =& App::getInstance();
     153        $app =& App::getInstance();
    154154
    155155        if (true !== $this->getParam('enabled')) {
  • trunk/lib/Captcha.inc.php

    r468 r479  
    149149    public function __construct()
    150150    {
    151         $app =& App::getInstance();
     151        $app =& App::getInstance();
    152152   
    153153        $this->secret_key = $app->getParam('signing_key');
     
    166166    public function getAsciiNumber($num=null)
    167167    {
    168         $app =& App::getInstance();
     168        $app =& App::getInstance();
    169169   
    170170        if (!isset($num)) {
  • trunk/lib/Cart.inc.php

    r478 r479  
    8282    public function __construct($namespace='')
    8383    {
    84         $app =& App::getInstance();
     84        $app =& App::getInstance();
    8585
    8686        $this->_ns = $namespace;
     
    114114    public function getParam($param)
    115115    {
    116         $app =& App::getInstance();
     116        $app =& App::getInstance();
    117117   
    118118        if (array_key_exists($param, $this->_params)) {
     
    279279    public function sum($key='extended_price')
    280280    {
    281         $sum = 0;
     281        $sum = 0;
    282282        switch ($key) {
    283283        case 'items' :
     
    285285            break;
    286286
    287         case 'extended_price' :
     287        case 'extended_price' :
    288288            foreach ($_SESSION['_cart'][$this->_ns]['items'] as $item_id => $specs) {
    289289                $sum += isset($specs[$key]) && is_numeric($specs[$key]) ? $specs[$key] : 0;
  • trunk/lib/Currency.inc.php

    r478 r479  
    5454    public function __construct($params=array())
    5555    {
    56         $app =& App::getInstance();
     56        $app =& App::getInstance();
    5757
    5858        // Set custom parameters.
     
    9696    public function getParam($param)
    9797    {
    98         $app =& App::getInstance();
     98        $app =& App::getInstance();
    9999   
    100100        if (array_key_exists($param, $this->_params)) {
  • trunk/lib/DB.inc.php

    r478 r479  
    101101    public function setParam($params)
    102102    {
    103         $app =& App::getInstance();
     103        $app =& App::getInstance();
    104104
    105105        if (isset($params) && is_array($params)) {
     
    120120    public function getParam($param)
    121121    {
    122         $app =& App::getInstance();
     122        $app =& App::getInstance();
    123123
    124124        if (array_key_exists($param, $this->_params)) {
     
    139139    public function connect()
    140140    {
    141         $app =& App::getInstance();
     141        $app =& App::getInstance();
    142142
    143143        if (!$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass')) {
     
    339339    public function tableExists($table, $use_cached_results=true)
    340340    {
    341         $app =& App::getInstance();
     341        $app =& App::getInstance();
    342342
    343343        if (!$this->_connected) {
  • trunk/lib/DBSessionHandler.inc.php

    r468 r479  
    5353    public function __construct($db, $params=array())
    5454    {
    55         $app =& App::getInstance();
     55        $app =& App::getInstance();
    5656   
    5757        $this->_params = array_merge($this->_params, $params);
     
    9696    public function initDB($recreate_db=false)
    9797    {
    98         $app =& App::getInstance();
     98        $app =& App::getInstance();
    9999   
    100100        static $_db_tested = false;
  • trunk/lib/Email.inc.php

    r478 r479  
    120120    public function setParam($params)
    121121    {
    122         $app =& App::getInstance();
     122        $app =& App::getInstance();
    123123
    124124        if (isset($params) && is_array($params)) {
     
    147147    public function getParam($param)
    148148    {
    149         $app =& App::getInstance();
     149        $app =& App::getInstance();
    150150
    151151        if (array_key_exists($param, $this->_params)) {
     
    167167    public function setTemplate($template)
    168168    {
    169         $app =& App::getInstance();
     169        $app =& App::getInstance();
    170170
    171171        // Load file, using include_path.
     
    191191    public function setString($string)
    192192    {
    193         $app =& App::getInstance();
     193        $app =& App::getInstance();
    194194
    195195        if ('' == trim($string)) {
     
    215215    public function replace($replacements)
    216216    {
    217         $app =& App::getInstance();
     217        $app =& App::getInstance();
    218218
    219219        // Ensure template exists.
     
    252252    public function send($to=null, $from=null, $subject=null, $headers=null)
    253253    {
    254         $app =& App::getInstance();
     254        $app =& App::getInstance();
    255255
    256256        // Use arguments if provided.
     
    335335        if (ini_get('safe_mode')) {
    336336            $ret = mb_send_mail($final_to, $this->_params['subject'], $final_body, $final_headers);
    337         } else {
     337        } else {
    338338            $ret = mb_send_mail($final_to, $this->_params['subject'], $final_body, $final_headers, $envelope_sender_header);
    339339        }
     
    366366    public function validEmail($email)
    367367    {
    368         $app =& App::getInstance();
     368        $app =& App::getInstance();
    369369
    370370        // If an array, check values recursively.
  • trunk/lib/FormValidator.inc.php

    r478 r479  
    7979    public function setParam($params)
    8080    {
    81         $app =& App::getInstance();
     81        $app =& App::getInstance();
    8282
    8383        if (isset($params) && is_array($params)) {
     
    9898    public function getParam($param)
    9999    {
    100         $app =& App::getInstance();
     100        $app =& App::getInstance();
    101101
    102102        if (array_key_exists($param, $this->_params)) {
     
    465465    public function validateEmail($form_name, $strict=false)
    466466    {
    467         $app =& App::getInstance();
     467        $app =& App::getInstance();
    468468
    469469        $email = getFormData($form_name);
  • trunk/lib/Hierarchy.inc.php

    r468 r479  
    115115    public function toStringID($child_type=null, $child_id=null)
    116116    {
    117             $app =& App::getInstance();
     117            $app =& App::getInstance();
    118118
    119119            if (!isset($child_type) || !isset($child_id)) {
     
    149149    public function toArrayID(&$node)
    150150    {
    151             $app =& App::getInstance();
     151            $app =& App::getInstance();
    152152
    153153            if (preg_match('/^([[:alnum:]]+)__-?([[:digit:]]+)$/', $node, $node_parts)) {
     
    169169    public function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='')
    170170    {
    171         $app =& App::getInstance();
    172         $db =& DB::getInstance();
     171        $app =& App::getInstance();
     172        $db =& DB::getInstance();
    173173
    174174        if (!isset($child_type) || !isset($child_id)) {
     
    248248    public function deleteNode($child_type=null, $child_id=null)
    249249    {
    250         $app =& App::getInstance();
    251         $db =& DB::getInstance();
     250        $app =& App::getInstance();
     251        $db =& DB::getInstance();
    252252
    253253        if (!isset($child_type) || !isset($child_id)) {
     
    298298    public function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='')
    299299    {
    300             $app =& App::getInstance();
    301             $db =& DB::getInstance();
    302 
    303             if (!isset($child_type) || !isset($child_id)) {
     300            $app =& App::getInstance();
     301            $db =& DB::getInstance();
     302
     303            if (!isset($child_type) || !isset($child_id)) {
    304304            if ($this->node_init) {
    305305                $child_type =& $this->child_type;
     
    375375    public function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='')
    376376    {
    377         $app =& App::getInstance();
    378         $db =& DB::getInstance();
     377        $app =& App::getInstance();
     378        $db =& DB::getInstance();
    379379
    380380        if (!isset($child_type) || !isset($child_id)) {
     
    426426    public function getNode($child_type=null, $child_id=null)
    427427    {
    428         $app =& App::getInstance();
    429         $db =& DB::getInstance();
     428        $app =& App::getInstance();
     429        $db =& DB::getInstance();
    430430
    431431        if (!isset($child_type) || !isset($child_id)) {
     
    470470    public function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='')
    471471    {
    472         $app =& App::getInstance();
    473         $db =& DB::getInstance();
     472        $app =& App::getInstance();
     473        $db =& DB::getInstance();
    474474
    475475        if (!isset($child_type) || !isset($child_id)) {
     
    522522    public function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null)
    523523    {
    524         $app =& App::getInstance();
    525         $db =& DB::getInstance();
     524        $app =& App::getInstance();
     525        $db =& DB::getInstance();
    526526
    527527        if (!isset($child_type) || !isset($child_id)) {
     
    563563    public function isLeaf($child_type=null, $child_id=null)
    564564    {
    565         $app =& App::getInstance();
     565        $app =& App::getInstance();
    566566
    567567        if (!isset($child_type) || !isset($child_id)) {
     
    624624    public function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true)
    625625    {
    626         $db =& DB::getInstance();
     626        $db =& DB::getInstance();
    627627
    628628        static $output = array();
     
    678678    public function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null)
    679679    {
    680         $app =& App::getInstance();
    681         $db =& DB::getInstance();
     680        $app =& App::getInstance();
     681        $db =& DB::getInstance();
    682682
    683683        if (!isset($child_type) || !isset($child_id)) {
     
    730730    public function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true)
    731731    {
    732         $app =& App::getInstance();
     732        $app =& App::getInstance();
    733733
    734734        static $output = array();
     
    803803    public function rebuildSubnodeQty($type_constraint=null)
    804804    {
    805         $db =& DB::getInstance();
     805        $db =& DB::getInstance();
    806806
    807807        // Reset all the category counters to zero.
     
    827827    public function setSubnodeQtyToParents($child_type, $child_id, $num_children)
    828828    {
    829         $db =& DB::getInstance();
     829        $db =& DB::getInstance();
    830830
    831831        $db->query("
  • trunk/lib/Image.inc.php

    r468 r479  
    4444    {
    4545        if (!is_array($params)) {
    46             trigger_error(sprintf('Parameters not specified properly.', null), E_USER_ERROR);
     46            trigger_error(sprintf('Parameters not specified properly.', null), E_USER_ERROR);
    4747        }
    4848        $defaults = array(
  • trunk/lib/ImageThumb.inc.php

    r478 r479  
    118118    public function setParam($params)
    119119    {
    120         $app =& App::getInstance();
     120        $app =& App::getInstance();
    121121
    122122        if (isset($params) && is_array($params)) {
     
    162162    public function getParam($param)
    163163    {
    164         $app =& App::getInstance();
     164        $app =& App::getInstance();
    165165
    166166        if (array_key_exists($param, $this->_params)) {
     
    182182    public function setSpec($spec, $index=null)
    183183    {
    184         $app =& App::getInstance();
     184        $app =& App::getInstance();
    185185
    186186        // A little sanity checking.
     
    273273    public function processAll($runtime_specs=null)
    274274    {
    275         $app =& App::getInstance();
     275        $app =& App::getInstance();
    276276
    277277        // Ensure we have a source.
     
    315315    public function processFile($file_name, $runtime_specs=null)
    316316    {
    317         $app =& App::getInstance();
     317        $app =& App::getInstance();
    318318
    319319        // Source file determined by provided file_name.
     
    454454    private function _resizeWithNetpbm($source_file, $dest_file, $spec)
    455455    {
    456         $app =& App::getInstance();
     456        $app =& App::getInstance();
    457457
    458458        // Define pnmscale arguments.
     
    523523    private function _resizeWithGD($source_file, $dest_file, $spec)
    524524    {
    525         $app =& App::getInstance();
     525        $app =& App::getInstance();
    526526
    527527        // Get original file dimensions and type.
     
    664664    public function deleteThumbs($file_name, $use_glob=false)
    665665    {
    666         $app =& App::getInstance();
     666        $app =& App::getInstance();
    667667
    668668        // Ensure we have a source.
     
    702702    public function deleteOriginal($file_name)
    703703    {
    704         $app =& App::getInstance();
     704        $app =& App::getInstance();
    705705
    706706        // Ensure we have a source.
     
    735735    public function exists($file_name)
    736736    {
    737         $app =& App::getInstance();
     737        $app =& App::getInstance();
    738738
    739739        // Ensure we have a source.
     
    768768    private function _createDestDirs($filename=null)
    769769    {
    770         $app =& App::getInstance();
     770        $app =& App::getInstance();
    771771
    772772        // Keep track of directories we've already created.
     
    826826    private function _raiseMsg($message, $type, $file, $line)
    827827    {
    828         $app =& App::getInstance();
     828        $app =& App::getInstance();
    829829
    830830        if ($this->getParam('display_messages') === true || (is_int($this->getParam('display_messages')) && $this->getParam('display_messages') & $type > 0)) {
  • trunk/lib/JS.inc.php

    r478 r479  
    5050    public function setParam($params)
    5151    {
    52         $app =& App::getInstance();
     52        $app =& App::getInstance();
    5353
    5454        if (isset($params) && is_array($params)) {
     
    6969    public function getParam($param)
    7070    {
    71         $app =& App::getInstance();
     71        $app =& App::getInstance();
    7272
    7373        if (array_key_exists($param, $this->_params)) {
     
    8989    public function setFile($file, $realms='')
    9090    {
    91         $app =& App::getInstance();
     91        $app =& App::getInstance();
    9292
    9393        if (!is_array($realms)) {
     
    117117    public function headers($realm='')
    118118    {
    119         $app =& App::getInstance();
     119        $app =& App::getInstance();
    120120
    121121        $realm = '' == $realm ? 'default' : $realm;
  • trunk/lib/Lock.inc.php

    r478 r479  
    7575    public function __construct($auth_object)
    7676    {
    77         $app =& App::getInstance();
     77        $app =& App::getInstance();
    7878
    7979        if (!method_exists($auth_object, 'get') || !method_exists($auth_object, 'getUsername')) {
     
    9898    public function initDB($recreate_db=false)
    9999    {
    100         $app =& App::getInstance();
    101         $db =& DB::getInstance();
     100        $app =& App::getInstance();
     101        $db =& DB::getInstance();
    102102
    103103        static $_db_tested = false;
     
    160160    public function getParam($param)
    161161    {
    162         $app =& App::getInstance();
     162        $app =& App::getInstance();
    163163
    164164        if (array_key_exists($param, $this->_params)) {
     
    181181    public function select($record_table_or_lock_id, $record_key=null, $record_val=null)
    182182    {
    183         $app =& App::getInstance();
    184         $db =& DB::getInstance();
     183        $app =& App::getInstance();
     184        $db =& DB::getInstance();
    185185
    186186        $this->initDB();
     
    233233    public function isMine()
    234234    {
    235         $db =& DB::getInstance();
     235        $db =& DB::getInstance();
    236236
    237237        $this->initDB();
     
    261261    public function set($record_table, $record_key, $record_val, $title='')
    262262    {
    263         $db =& DB::getInstance();
     263        $db =& DB::getInstance();
    264264
    265265        $this->initDB();
     
    307307    public function remove()
    308308    {
    309         $app =& App::getInstance();
    310         $db =& DB::getInstance();
     309        $app =& App::getInstance();
     310        $db =& DB::getInstance();
    311311
    312312        $this->initDB();
     
    329329    public function removeAll($user_id=null)
    330330    {
    331         $app =& App::getInstance();
    332         $db =& DB::getInstance();
     331        $app =& App::getInstance();
     332        $db =& DB::getInstance();
    333333
    334334        $this->initDB();
     
    353353    public function _auto_timeout()
    354354    {
    355         $db =& DB::getInstance();
     355        $db =& DB::getInstance();
    356356
    357357        static $_timeout_run = false;
     
    374374    public function dieErrorPage()
    375375    {
    376         $app =& App::getInstance();
     376        $app =& App::getInstance();
    377377
    378378        $app->dieURL(sprintf('%s?lock_id=%s&boomerang=%s', $this->getParam('error_url'), $this->data['lock_id'], urlencode(absoluteMe())));
     
    384384    public function printErrorHTML()
    385385    {
    386         $app =& App::getInstance();
     386        $app =& App::getInstance();
    387387
    388388        ?>
  • trunk/lib/MCVE.inc.php

    r468 r479  
    4545    public function __construct($username, $password)
    4646    {
    47         $app =& App::getInstance();
     47        $app =& App::getInstance();
    4848
    4949        // Ensure PHP was compiled with the MCVE functions.
     
    6060    private function _connect()
    6161    {
    62         $app =& App::getInstance();
     62        $app =& App::getInstance();
    6363
    6464        if ($this->connected) {
     
    146146    public function sendTrans($tid, $type='', $hide_msg=false)
    147147    {
    148         $app =& App::getInstance();
     148        $app =& App::getInstance();
    149149
    150150        // Finalize structuring of  to MCVE and ready it to be sent
  • trunk/lib/Navigation.inc.php

    r478 r479  
    5555    public function __construct($params=null)
    5656    {
    57         $app =& App::getInstance();
     57        $app =& App::getInstance();
    5858
    5959        if (isset($params) && is_array($params)) {
     
    9393    public function setParam($params)
    9494    {
    95         $app =& App::getInstance();
     95        $app =& App::getInstance();
    9696
    9797        if (isset($params) && is_array($params)) {
     
    112112    public function getParam($param)
    113113    {
    114         $app =& App::getInstance();
     114        $app =& App::getInstance();
    115115
    116116        if (array_key_exists($param, $this->_params)) {
     
    229229    public function getBreadcrumbs()
    230230    {
    231         $app =& App::getInstance();
     231        $app =& App::getInstance();
    232232
    233233        if ($this->getParam('breadcrumbs')) {
  • trunk/lib/PEdit.inc.php

    r478 r479  
    123123    public function setParam($params)
    124124    {
    125         $app =& App::getInstance();
     125        $app =& App::getInstance();
    126126
    127127        if (isset($params) && is_array($params)) {
     
    142142    public function getParam($param)
    143143    {
    144         $app =& App::getInstance();
     144        $app =& App::getInstance();
    145145
    146146        if (array_key_exists($param, $this->_params)) {
     
    161161    public function start($initialize_data_file=false)
    162162    {
    163         $app =& App::getInstance();
     163        $app =& App::getInstance();
    164164
    165165        if (!is_dir($this->getParam('data_dir'))) {
     
    219219    public function set($name, $options=array())
    220220    {
    221         $app =& App::getInstance();
     221        $app =& App::getInstance();
    222222
    223223        $name = preg_replace('/\s/', '_', $name);
     
    253253    public function formBegin()
    254254    {
    255         $app =& App::getInstance();
     255        $app =& App::getInstance();
    256256
    257257        if (!$this->_authorized || empty($this->_data)) {
     
    401401    public function printVersions()
    402402    {
    403         $app =& App::getInstance();
     403        $app =& App::getInstance();
    404404
    405405        if ($this->_authorized && $this->op == 'Versions') {
     
    444444    private function _fileHash()
    445445    {
    446         $app =& App::getInstance();
     446        $app =& App::getInstance();
    447447
    448448        return md5($app->getParam('signing_key') . $_SERVER['PHP_SELF']);
     
    459459    private function _loadDataFile()
    460460    {
    461         $app =& App::getInstance();
     461        $app =& App::getInstance();
    462462
    463463        if (!file_exists($this->_data_file)) {
     
    498498    private function _initializeDataFile()
    499499    {
    500         $app =& App::getInstance();
     500        $app =& App::getInstance();
    501501
    502502        $app->logMsg(sprintf('Initializing data file: %s', $this->_data_file), LOG_INFO, __FILE__, __LINE__);
     
    514514    private function _writeData()
    515515    {
    516         $app =& App::getInstance();
     516        $app =& App::getInstance();
    517517
    518518        if (!$this->_authorized) {
     
    562562    private function _filePutContents($filename, $content)
    563563    {
    564         $app =& App::getInstance();
     564        $app =& App::getInstance();
    565565
    566566        // Ensure requested filename is within the pedit data dir.
     
    612612    private function _createVersion()
    613613    {
    614         $app =& App::getInstance();
     614        $app =& App::getInstance();
    615615
    616616        if (!$this->_authorized) {
     
    650650    private function _deleteOldVersions()
    651651    {
    652         $app =& App::getInstance();
     652        $app =& App::getInstance();
    653653
    654654        $version_files = $this->_getVersions();
     
    709709    private function _restoreVersion($version)
    710710    {
    711         $app =& App::getInstance();
     711        $app =& App::getInstance();
    712712
    713713        if (!$this->_authorized) {
  • trunk/lib/PageNumbers.inc.php

    r468 r479  
    9595    public function setPerPage($per_page, $default=25, $save_value=true)
    9696    {
    97         // (1) By provided argument, if valid.
     97        // (1) By provided argument, if valid.
    9898        // (2) By saved preference, if available.
    9999        // (3) Set to default value if provided and valid.
     
    160160    public function calculate()
    161161    {
    162         $app =& App::getInstance();
     162        $app =& App::getInstance();
    163163
    164164        if (!$this->set_per_page_initialized) {
     
    214214    public function getLimitSQL()
    215215    {
    216         $app =& App::getInstance();
    217         $db =& DB::getInstance();
     216        $app =& App::getInstance();
     217        $db =& DB::getInstance();
    218218
    219219        if (is_numeric($this->first_item) && is_numeric($this->_per_page)) {
     
    232232    public function printPerPageLinks($query_key='per_page')
    233233    {
    234         $app =& App::getInstance();
     234        $app =& App::getInstance();
    235235
    236236        $sp = '';
     
    262262    public function getPageNumURL($page_number, $carry_args=null)
    263263    {
    264         $app =& App::getInstance();
     264        $app =& App::getInstance();
    265265
    266266        return $app->oHREF($this->url_base . $page_number, $carry_args);
  • trunk/lib/PageSequence.inc.php

    r473 r479  
    153153    public function setCurrent($step_id)
    154154    {
    155         $app =& App::getInstance();
     155        $app =& App::getInstance();
    156156
    157157        if (false !== ($pos = $this->getPosition($step_id))) {
     
    279279    public function printEditLink($step_id=null)
    280280    {
    281         $app =& App::getInstance();
     281        $app =& App::getInstance();
    282282
    283283        $pos = isset($step_id) ? $this->getPosition($step_id) : $this->getPosition();
     
    344344    private function _auto_timeout()
    345345    {
    346         $app =& App::getInstance();
     346        $app =& App::getInstance();
    347347
    348348        if (isset($_SESSION[$this->seq]['last_access_time'])
  • trunk/lib/PayPal.inc.php

    r478 r479  
    9797    public function setButtonDefaults($type, $options)
    9898    {
    99         $app =& App::getInstance();
     99        $app =& App::getInstance();
    100100
    101101        if (!is_array($options) || empty($options)) {
     
    129129    public function newButton($type, $name, $options=null)
    130130    {
    131         $app =& App::getInstance();
     131        $app =& App::getInstance();
    132132
    133133        if (!isset($this->_default_button_options[$type])) {
     
    164164    public function getLink($name)
    165165    {
    166         $app =& App::getInstance();
     166        $app =& App::getInstance();
    167167
    168168        if (!isset($this->_buttons[$name])) {
     
    236236    public function setParam($params)
    237237    {
    238         $app =& App::getInstance();
     238        $app =& App::getInstance();
    239239
    240240        if (isset($params) && is_array($params)) {
     
    255255    public function getParam($param)
    256256    {
    257         $app =& App::getInstance();
     257        $app =& App::getInstance();
    258258   
    259259        if (array_key_exists($param, $this->_params)) {
     
    292292    public function processIPN()
    293293    {
    294         $app =& App::getInstance();
     294        $app =& App::getInstance();
    295295
    296296        if (getPost('test_ipn') == '1' || $this->getParam('test_mode')) {
     
    353353    public function verifiedIPN()
    354354    {
    355         $app =& App::getInstance();
     355        $app =& App::getInstance();
    356356
    357357        if (!isset($this->_ipn_response)) {
  • trunk/lib/Prefs.inc.php

    r478 r479  
    259259        }
    260260        if (!is_scalar($val) && !is_array($val) && !is_object($val)) {
    261             $app->logMsg(sprintf('Value is not a string-compatible type (%s=%s)', $key, getDump($val)), LOG_WARNING, __FILE__, __LINE__);
     261            $app->logMsg(sprintf('Value is not a compatible data type (%s=%s)', $key, getDump($val)), LOG_WARNING, __FILE__, __LINE__);
    262262            return false;
    263263        }
  • trunk/lib/ScriptTimer.inc.php

    r468 r479  
    3131    private $_timing_cumulative_times = array();
    3232   
    33     public function start($name='default')
    34     {
     33    public function start($name='default')
     34    {
    3535        $this->_timing_start_times[$name] = explode(' ', microtime());
    36     }
    37    
    38     public function stop($name='default')
    39     {
    40         if (!isset($this->_timing_stop_times[$name]) || !isset($this->_timing_cumulative_times[$name])) {
    41             $this->_timing_stop_times[$name] = null;
    42             $this->_timing_cumulative_times[$name] = null;
    43         }
     36    }
     37   
     38    public function stop($name='default')
     39    {
     40        if (!isset($this->_timing_stop_times[$name]) || !isset($this->_timing_cumulative_times[$name])) {
     41            $this->_timing_stop_times[$name] = null;
     42            $this->_timing_cumulative_times[$name] = null;
     43        }
    4444        $this->_timing_stop_times[$name] = explode(' ', microtime());
    4545        $this->_timing_cumulative_times[$name] += $this->getTime($name);
    46     }
    47    
    48     public function getTime($name='default')
    49     {
     46    }
     47   
     48    public function getTime($name='default')
     49    {
    5050        if (!isset($this->_timing_start_times[$name])) {
    51             return 0;
     51            return 0;
    5252        }
    5353        if (!isset($this->_timing_stop_times[$name])) {
     
    6060        $current += $stop_time[0] - $this->_timing_start_times[$name][0];
    6161        return $current;
    62     }
    63    
    64     public function printAll($sort_by_time=false)
    65     {
    66         $names = array_map('strlen', array_keys($this->_timing_start_times));
    67         sort($names);
    68         $name_len = end($names);
    69        
    70         if ($sort_by_time) {
    71            arsort($this->_timing_cumulative_times, SORT_NUMERIC);
    72         }
    73        
    74         $this->_timing_cumulative_times['TOTAL'] = array_sum($this->_timing_cumulative_times);
     62    }
     63   
     64    public function printAll($sort_by_time=false)
     65    {
     66        $names = array_map('strlen', array_keys($this->_timing_start_times));
     67        sort($names);
     68        $name_len = end($names);
     69       
     70        if ($sort_by_time) {
     71           arsort($this->_timing_cumulative_times, SORT_NUMERIC);
     72        }
     73       
     74        $this->_timing_cumulative_times['TOTAL'] = array_sum($this->_timing_cumulative_times);
    7575
    7676        echo '<pre>';
    77         foreach ($this->_timing_cumulative_times as $name => $time) {
    78             printf("\n%-{$name_len}s $this->time_format", $name, $time);
    79         }
     77        foreach ($this->_timing_cumulative_times as $name => $time) {
     78            printf("\n%-{$name_len}s $this->time_format", $name, $time);
     79        }
    8080        echo '</pre>';
    81     }
     81    }
    8282}
  • trunk/lib/SortOrder.inc.php

    r468 r479  
    176176    public function getSortOrderSQL()
    177177    {
    178         $app =& App::getInstance();
    179         $db =& DB::getInstance();
     178        $app =& App::getInstance();
     179        $db =& DB::getInstance();
    180180
    181181        if (!isset($this->_columns[mb_strtolower($this->sort_by)])) {
     
    207207    public function printSortHeader($col, $col_name, $default_order='ASC')
    208208    {
    209         $app =& App::getInstance();
     209        $app =& App::getInstance();
    210210
    211211        if (isset($this->_columns[$col])) {
  • trunk/lib/SpellCheck.inc.php

    r478 r479  
    8282    public function __construct($params)
    8383    {
    84         $app =& App::getInstance();
     84        $app =& App::getInstance();
    8585
    8686        if (!extension_loaded('pspell')) {
     
    120120    public function setParam($params)
    121121    {
    122         $app =& App::getInstance();
     122        $app =& App::getInstance();
    123123
    124124        if (isset($params) && is_array($params)) {
     
    139139    public function getParam($param)
    140140    {
    141         $app =& App::getInstance();
     141        $app =& App::getInstance();
    142142   
    143143        if (array_key_exists($param, $this->_params)) {
     
    214214    public function add($word)
    215215    {
    216         $app =& App::getInstance();
     216        $app =& App::getInstance();
    217217
    218218        if ($this->_use_personal_wordlist) {
     
    239239    public function save()
    240240    {
    241         $app =& App::getInstance();
     241        $app =& App::getInstance();
    242242
    243243        if ($this->_use_personal_wordlist) {
  • trunk/lib/TemplateGlue.inc.php

    r468 r479  
    7474function getSetEnumFieldValues($db_table, $db_col, $sort=false)
    7575{
    76     $app =& App::getInstance();
    77     $db =& DB::getInstance();
     76    $app =& App::getInstance();
     77    $db =& DB::getInstance();
    7878
    7979    $qid = $db->query("SHOW COLUMNS FROM " . $db->escapeString($db_table) . " LIKE '" . $db->escapeString($db_col) . "'",false);
     
    315315function printSelectForm($db_table, $key_column, $val_column, $preselected, $first=false, $extra_clause='', $sql_format='SELECT %1$s, %2$s FROM %3$s %4$s')
    316316{
    317     $db =& DB::getInstance();
     317    $db =& DB::getInstance();
    318318
    319319    // Sometimes preselected comes as a comma list.
     
    359359function printDBCheckboxes($db_table, $key_column, $val_column, $preselected, $columns=1, $extra_clause='', $vert_columns=false)
    360360{
    361     $db =& DB::getInstance();
     361    $db =& DB::getInstance();
    362362
    363363    // Sometimes preselected comes as a comma list.
  • trunk/lib/Upload.inc.php

    r478 r479  
    7676    public function setParam($params)
    7777    {
    78         $app =& App::getInstance();
     78        $app =& App::getInstance();
    7979
    8080        if (isset($params) && is_array($params)) {
     
    120120    public function getParam($param)
    121121    {
    122         $app =& App::getInstance();
     122        $app =& App::getInstance();
    123123
    124124        if (array_key_exists($param, $this->_params)) {
     
    146146    public function process($form_name, $custom_file_name=null)
    147147    {
    148         $app =& App::getInstance();
     148        $app =& App::getInstance();
    149149
    150150        // Ensure we have a upload directory.
     
    353353    public function deleteFile($file_name, $use_glob=false)
    354354    {
    355         $app =& App::getInstance();
     355        $app =& App::getInstance();
    356356
    357357        // Ensure we have a upload directory.
     
    386386    public function moveFile($old_name, $new_name)
    387387    {
    388         $app =& App::getInstance();
     388        $app =& App::getInstance();
    389389
    390390        // Ensure we have an upload directory.
     
    421421    public function exists($file_name)
    422422    {
    423         $app =& App::getInstance();
     423        $app =& App::getInstance();
    424424
    425425        // Ensure we have a upload directory.
     
    518518    public function _raiseMsg($message, $type, $file, $line)
    519519    {
    520         $app =& App::getInstance();
     520        $app =& App::getInstance();
    521521
    522522        if ($this->getParam('display_messages') === true || (is_int($this->getParam('display_messages')) && $this->getParam('display_messages') & $type > 0)) {
  • trunk/lib/Utilities.inc.php

    r477 r479  
    2929 * Print variable dump.
    3030 *
    31  * @param  mixed    $var        The variable to dump.
    32  * @param  bool     $display    Print the dump in <pre> tags or hide it in html comments (non-CLI only).
    33  * @param  bool     $var_dump   Use var_dump instead of print_r.
    34  * @param  string   $file       Value of __FILE__.
    35  * @param  string   $line       Value of __LINE__
     31 * @param  mixed    $var        The variable to dump.
     32 * @param  bool     $display    Print the dump in <pre> tags or hide it in html comments (non-CLI only).
     33 * @param  bool     $var_dump   Use var_dump instead of print_r.
     34 * @param  string   $file       Value of __FILE__.
     35 * @param  string   $line       Value of __LINE__
    3636 */
    3737function dump($var, $display=false, $var_dump=false, $file='', $line='')
     
    4545        var_dump($var);
    4646    } else {
    47         // Print human-readable descriptions of invisible types.
    48         if (null === $var) {
    49             echo '(null)';
    50         } else if (true === $var) {
    51             echo '(bool: true)';
    52         } else if (false === $var) {
    53             echo '(bool: false)';
    54         } else if (is_scalar($var) && '' === $var) {
    55             echo '(empty string)';
    56         } else if (is_scalar($var) && preg_match('/^\s+$/', $var)) {
    57             echo '(only white space)';
    58         } else {
    59             print_r($var);
    60         }
     47        // Print human-readable descriptions of invisible types.
     48        if (null === $var) {
     49            echo '(null)';
     50        } else if (true === $var) {
     51            echo '(bool: true)';
     52        } else if (false === $var) {
     53            echo '(bool: false)';
     54        } else if (is_scalar($var) && '' === $var) {
     55            echo '(empty string)';
     56        } else if (is_scalar($var) && preg_match('/^\s+$/', $var)) {
     57            echo '(only white space)';
     58        } else {
     59            print_r($var);
     60        }
    6161    }
    6262    if (defined('_CLI')) {
     
    144144function oTxt($text, $preserve_html=false)
    145145{
    146     $app =& App::getInstance();
     146    $app =& App::getInstance();
    147147
    148148    $search = array();
     
    546546function filePutContents($filename, $content)
    547547{
    548     $app =& App::getInstance();
     548    $app =& App::getInstance();
    549549
    550550    // Open file for writing and truncate to zero length.
     
    754754function escapedList($in, $separator="', '")
    755755{
    756     $db =& DB::getInstance();
     756    $db =& DB::getInstance();
    757757
    758758    if (is_array($in) && !empty($in)) {
     
    982982function mailmanAddMember($email, $list, $send_welcome_message=false)
    983983{
    984     $app =& App::getInstance();
    985 
    986     $add_members = '/usr/lib/mailman/bin/add_members';
     984    $app =& App::getInstance();
     985
     986    $add_members = '/usr/lib/mailman/bin/add_members';
    987987    // FIXME: checking of executable is disabled.
    988988    if (true || is_executable($add_members) && is_readable($add_members)) {
     
    10141014function mailmanRemoveMember($email, $list, $send_user_ack=false)
    10151015{
    1016     $app =& App::getInstance();
     1016    $app =& App::getInstance();
    10171017
    10181018    $remove_members = '/usr/lib/mailman/bin/remove_members';
  • trunk/lib/Validator.inc.php

    r470 r479  
    251251    static public function validateStrDate($val)
    252252    {
    253         if (is_string($val) && '' === trim($val)) {
    254             // Don't be too bothered about empty strings.
    255             return true;
    256         }
     253        if (is_string($val) && '' === trim($val)) {
     254            // Don't be too bothered about empty strings.
     255            return true;
     256        }
    257257
    258258        $timestamp = strtotime($val);
  • trunk/lib/Version.inc.php

    r478 r479  
    8282    public function __construct($auth_object)
    8383    {
    84         $app =& App::getInstance();
     84        $app =& App::getInstance();
    8585
    8686        if (!method_exists($auth_object, 'get') || !method_exists($auth_object, 'getUsername')) {
     
    105105    public function initDB($recreate_db=false)
    106106    {
    107         $app =& App::getInstance();
    108         $db =& DB::getInstance();
     107        $app =& App::getInstance();
     108        $db =& DB::getInstance();
    109109
    110110        static $_db_tested = false;
     
    173173    public function getParam($param)
    174174    {
    175         $app =& App::getInstance();
     175        $app =& App::getInstance();
    176176
    177177        if (array_key_exists($param, $this->_params)) {
     
    195195    public function create($record_table, $record_key, $record_val, $title='', $notes='')
    196196    {
    197         $app =& App::getInstance();
    198         $db =& DB::getInstance();
     197        $app =& App::getInstance();
     198        $db =& DB::getInstance();
    199199
    200200        $this->initDB();
     
    256256    public function restore($version_id)
    257257    {
    258         $app =& App::getInstance();
    259         $db =& DB::getInstance();
     258        $app =& App::getInstance();
     259        $db =& DB::getInstance();
    260260
    261261        $this->initDB();
     
    317317    public function deleteOld($record_table, $record_key, $record_val)
    318318    {
    319         $db =& DB::getInstance();
     319        $db =& DB::getInstance();
    320320
    321321        $this->initDB();
     
    384384    public function getList($record_table, $record_key, $record_val)
    385385    {
    386         $db =& DB::getInstance();
     386        $db =& DB::getInstance();
    387387
    388388        $this->initDB();
     
    421421    public function getVerson($version_id)
    422422    {
    423         $db =& DB::getInstance();
     423        $db =& DB::getInstance();
    424424
    425425        $this->initDB();
     
    442442    public function getData($version_id)
    443443    {
    444         $db =& DB::getInstance();
     444        $db =& DB::getInstance();
    445445
    446446        $this->initDB();
     
    468468    public function getCurrent($record_table, $record_key, $record_val)
    469469    {
    470         $db =& DB::getInstance();
     470        $db =& DB::getInstance();
    471471
    472472        $this->initDB();
  • trunk/services/admins.php

    r468 r479  
    280280    global $auth;
    281281    global $lock;
    282     $app =& App::getInstance();
    283     $db =& DB::getInstance();
     282    $app =& App::getInstance();
     283    $db =& DB::getInstance();
    284284
    285285    $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id);
     
    339339    global $lock;
    340340    global $cache;
    341     $app =& App::getInstance();
    342     $db =& DB::getInstance();
     341    $app =& App::getInstance();
     342    $db =& DB::getInstance();
    343343
    344344    $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id);
     
    385385    global $auth;
    386386    global $cache;
    387     $app =& App::getInstance();
    388     $db =& DB::getInstance();
     387    $app =& App::getInstance();
     388    $db =& DB::getInstance();
    389389
    390390    // Remove any stale cached list data.
     
    428428    global $lock;
    429429    global $cache;
    430     $app =& App::getInstance();
    431     $db =& DB::getInstance();
     430    $app =& App::getInstance();
     431    $db =& DB::getInstance();
    432432
    433433    $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $frm['admin_id']);
     
    474474    global $cache;
    475475    global $auth;
    476     $db =& DB::getInstance();
     476    $db =& DB::getInstance();
    477477
    478478    $where_clause = '';
  • trunk/services/logs.php

    r468 r479  
    159159function deleteLog($log_file)
    160160{
    161     $app =& App::getInstance();
     161    $app =& App::getInstance();
    162162
    163163    if (!file_exists($app->getParam('log_directory') . '/' . $log_file)) {
     
    186186function clearLog($log_file)
    187187{
    188     $app =& App::getInstance();
     188    $app =& App::getInstance();
    189189
    190190    if (!$fp = fopen($app->getParam('log_directory') . '/' . $log_file, 'r+')) {
     
    211211function archiveLog($log_file)
    212212{
    213     $app =& App::getInstance();
     213    $app =& App::getInstance();
    214214
    215215    $old_file_name = $log_file;
     
    233233function printLog($log_file)
    234234{
    235     $app =& App::getInstance();
     235    $app =& App::getInstance();
    236236
    237237    if (!is_file($app->getParam('log_directory') . '/' . $log_file)) {
     
    246246function &getLog($log_file, $search_query='')
    247247{
    248     $app =& App::getInstance();
     248    $app =& App::getInstance();
    249249
    250250    $log = array();
     
    271271{
    272272    global $valid_file_extensions;
    273     $app =& App::getInstance();
     273    $app =& App::getInstance();
    274274
    275275    // Get a list of all files in the log directory.
  • trunk/tests/AppTest.php

    r468 r479  
    9494    function test_dbquery()
    9595    {
    96         $db =& DB::getInstance();
     96        $db =& DB::getInstance();
    9797
    9898        $qid = $db->query("SELECT 2 + 2");
  • trunk/tests/AuthSQLTest.php

    r468 r479  
    3838    function setUp()
    3939    {
    40         require dirname(__FILE__) . '/_config.inc.php';
     40        require dirname(__FILE__) . '/_config.inc.php';
    4141        require_once '../lib/Auth_SQL.inc.php';
    4242        $this->Auth_SQL = new Auth_SQL('testauth');
     
    7575    function tearDown()
    7676    {
    77         $db =& DB::getInstance();
    78 
    79         unset($this->Auth_SQL);
     77        $db =& DB::getInstance();
     78
     79        unset($this->Auth_SQL);
    8080        $db->query("DROP TABLE IF EXISTS test_user_tbl");
    8181        $db->query("DROP TABLE IF EXISTS test_login_tbl");
     
    163163    function test_blockaccount()
    164164    {
    165         $db =& DB::getInstance();
     165        $db =& DB::getInstance();
    166166
    167167        $this->Auth_SQL->login('testuser', 'testpass');
     
    177177    function test_unblockaccount()
    178178    {
    179         $db =& DB::getInstance();
     179        $db =& DB::getInstance();
    180180
    181181        $db->query("
     
    239239    function test_setpassword()
    240240    {
    241         $db =& DB::getInstance();
     241        $db =& DB::getInstance();
    242242
    243243        $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1_HARDENED));
  • trunk/tests/Auth_SQLTest.php

    r468 r479  
    4242    function setUp()
    4343    {
    44         require dirname(__FILE__) . '/_config.inc.php';
     44        require dirname(__FILE__) . '/_config.inc.php';
    4545        require_once '../lib/Auth_SQL.inc.php';
    4646        $this->Auth_SQL =& new Auth_SQL('testauth');
     
    7979    function tearDown()
    8080    {
    81         $db =& DB::getInstance();
    82 
    83         unset($this->Auth_SQL);
     81        $db =& DB::getInstance();
     82
     83        unset($this->Auth_SQL);
    8484        $db->query("DROP TABLE IF EXISTS test_user_tbl");
    8585        $db->query("DROP TABLE IF EXISTS test_login_tbl");
     
    163163    function test_blockaccount()
    164164    {
    165         $db =& DB::getInstance();
     165        $db =& DB::getInstance();
    166166
    167167        $this->Auth_SQL->login('testuser', 'testpass');
     
    177177    function test_unblockaccount()
    178178    {
    179         $db =& DB::getInstance();
     179        $db =& DB::getInstance();
    180180
    181181        $db->query("
     
    239239    function test_setpassword()
    240240    {
    241         $db =& DB::getInstance();
     241        $db =& DB::getInstance();
    242242
    243243        $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1_HARDENED));
  • trunk/tests/LockTest.php

    r468 r479  
    3737
    3838    function setUp()
    39     {   
     39    {   
    4040        require dirname(__FILE__) . '/_config.inc.php';
    4141        require_once '../lib/Lock.inc.php';
     
    8686    function tearDown()
    8787    {
    88         $db =& DB::getInstance();
    89    
     88        $db =& DB::getInstance();
     89   
    9090        unset($this->Lock);
    9191        unset($this->Auth_SQL);
  • trunk/tests/VersionTest.php

    r468 r479  
    3737
    3838    function setUp()
    39     {   
     39    {   
    4040        require dirname(__FILE__) . '/_config.inc.php';
    4141        require_once '../lib/Version.inc.php';
     
    8383    function tearDown()
    8484    {
    85         $db =& DB::getInstance();
    86    
     85        $db =& DB::getInstance();
     86   
    8787        unset($this->Version);
    8888        unset($this->Auth_SQL);
Note: See TracChangeset for help on using the changeset viewer.