Changeset 479
- Timestamp:
- May 3, 2014 11:09:03 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/file_importer.php
r468 r479 33 33 // $app =& App::getInstance(); 34 34 // $db =& DB::getInstance(); 35 // 35 // 36 36 // 37 37 // // Test arguments. -
trunk/bin/module_maker/skel/admin.php
r468 r479 234 234 { 235 235 global $lock; 236 237 236 $db =& DB::getInstance(); 237 $app =& App::getInstance(); 238 238 239 239 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id); … … 276 276 global $lock; 277 277 global $cache; 278 279 278 $db =& DB::getInstance(); 279 $app =& App::getInstance(); 280 280 281 281 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id); … … 312 312 global $auth; 313 313 global $cache; 314 315 314 $db =& DB::getInstance(); 315 $app =& App::getInstance(); 316 316 317 317 // Remove any stale cached list data. … … 332 332 function updateRecord($frm) 333 333 { 334 335 334 global $auth; 335 global $lock; 336 336 global $cache; 337 338 337 $db =& DB::getInstance(); 338 $app =& App::getInstance(); 339 339 340 340 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%']); … … 364 364 global $tmp_prefs; 365 365 global $cache; 366 367 366 $db =& DB::getInstance(); 367 $app =& App::getInstance(); 368 368 369 369 $where_clause = ''; … … 443 443 { 444 444 global $cache; 445 446 445 $db =& DB::getInstance(); 446 $app =& App::getInstance(); 447 447 448 448 if (!is_array($ranks)) { -
trunk/docs/examples/contact_form/contact.php
r468 r479 52 52 // Validate submitted data. 53 53 validateInput(); 54 54 if ($fv->anyErrors()) { 55 55 // Re-populate form values with the user data so they can make corrections. 56 57 56 $frm = resetForm(getFormData()); 57 } else { 58 58 // Setup email object. 59 59 $email = new Email(array( … … 74 74 $frm = resetForm(); 75 75 $app->raiseMsg(_("<strong>Thank You!</strong> Your message has been sent."), MSG_SUCCESS, __FILE__, __LINE__); 76 76 } 77 77 } else { 78 78 // Reset form values to display a blank form. … … 96 96 function resetForm($new_values = array()) 97 97 { 98 99 100 101 102 103 98 $default = array( 99 'name' => '', 100 'email' => '', 101 'message' => '', 102 ); 103 return array_merge($default, $new_values); 104 104 } 105 105 -
trunk/docs/examples/contact_form/header.ihtml
r413 r479 1 1 <<?php echo '?xml version="1.0" encoding="' . $app->getParam('character_set') . '"?'; ?>> 2 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 3 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4 4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 5 5 <head> -
trunk/lib/ACL.inc.php
r478 r479 56 56 public function __construct() 57 57 { 58 58 $app =& App::getInstance(); 59 59 60 60 // Configure the cache object. … … 93 93 public function setParam($params) 94 94 { 95 95 $app =& App::getInstance(); 96 96 97 97 if (isset($params) && is_array($params)) { … … 112 112 public function getParam($param) 113 113 { 114 114 $app =& App::getInstance(); 115 115 116 116 if (array_key_exists($param, $this->_params)) { … … 131 131 public function initDB($recreate_db=false) 132 132 { 133 134 133 $app =& App::getInstance(); 134 $db =& DB::getInstance(); 135 135 136 136 static $_db_tested = false; … … 715 715 public function requireAllow($aro, $aco=null, $axo=null, $message='', $type=MSG_NOTICE, $file=null, $line=null) 716 716 { 717 717 $app =& App::getInstance(); 718 718 719 719 if (!$this->check($aro, $aco, $axo)) { -
trunk/lib/App.inc.php
r478 r479 180 180 $this->timer->start('_app'); 181 181 182 183 184 185 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 } 187 187 } 188 188 … … 615 615 $message = strip_tags(preg_replace('/\s+/', ' ', $message), (!empty($strip_tags_allow[1]) ? join('> ', $strip_tags_allow[1]) . '>' : null)); 616 616 617 618 617 // Serialize multi-line messages. 618 $message = preg_replace('/\s+/m', ' ', $message); 619 619 620 620 // Store this event under a unique key, counting each time it occurs so that it only gets reported a limited number of times. … … 1261 1261 } 1262 1262 1263 1264 1265 1266 1267 * @param string $nameThe name of the cookie.1268 * @param string $valueThe value of the cookie.1269 * @param string $expireThe time the cookie expires, as a unix timestamp or string value passed to strtotime.1270 * @param string $pathThe path on the server in which the cookie will be available on1271 * @param string $domainThe domain that the cookie is available to1272 * @param bool $secureIndicates that the cookie should only be transmitted over a secure HTTPS connection from the client.1273 * @param bool $httponlyWhen TRUE the cookie will be made accessible only through the HTTP protocol (makes cookies unreadable to javascript).1274 * @return boolTrue on success, false on error.1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 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 } 1320 1320 } // End. -
trunk/lib/Auth_SQL.inc.php
r478 r479 129 129 public function __construct($namespace='') 130 130 { 131 131 $app =& App::getInstance(); 132 132 133 133 $this->_ns = $namespace; … … 155 155 public function initDB($recreate_db=false) 156 156 { 157 158 157 $app =& App::getInstance(); 158 $db =& DB::getInstance(); 159 159 160 160 … … 276 276 public function getParam($param) 277 277 { 278 278 $app =& App::getInstance(); 279 279 280 280 if (array_key_exists($param, $this->_params)) { … … 293 293 public function clear() 294 294 { 295 295 $db =& DB::getInstance(); 296 296 297 297 $this->initDB(); … … 363 363 public function authenticate($username, $password) 364 364 { 365 366 365 $app =& App::getInstance(); 366 $db =& DB::getInstance(); 367 367 368 368 $this->initDB(); … … 414 414 public function login($username, $password) 415 415 { 416 417 416 $app =& App::getInstance(); 417 $db =& DB::getInstance(); 418 418 419 419 $this->initDB(); … … 541 541 public function isLoggedIn($user_id=null) 542 542 { 543 544 543 $app =& App::getInstance(); 544 $db =& DB::getInstance(); 545 545 546 546 $this->initDB(); … … 673 673 public function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null) 674 674 { 675 675 $app =& App::getInstance(); 676 676 677 677 if (!$this->isLoggedIn()) { … … 695 695 public function blockAccount($user_id=null, $reason='') 696 696 { 697 698 697 $app =& App::getInstance(); 698 $db =& DB::getInstance(); 699 699 700 700 $this->initDB(); … … 725 725 public function isBlocked($user_id=null) 726 726 { 727 727 $db =& DB::getInstance(); 728 728 729 729 $this->initDB(); … … 747 747 public function unblockAccount($user_id=null) 748 748 { 749 749 $db =& DB::getInstance(); 750 750 751 751 $this->initDB(); … … 771 771 public function usernameExists($username) 772 772 { 773 773 $db =& DB::getInstance(); 774 774 775 775 $this->initDB(); … … 791 791 public function getUsername($user_id) 792 792 { 793 793 $db =& DB::getInstance(); 794 794 795 795 $this->initDB(); … … 903 903 public function setPassword($user_id=null, $password) 904 904 { 905 906 905 $app =& App::getInstance(); 906 $db =& DB::getInstance(); 907 907 908 908 $this->initDB(); … … 953 953 public function resetPassword($user_id=null, $reason='') 954 954 { 955 956 955 $app =& App::getInstance(); 956 $db =& DB::getInstance(); 957 957 958 958 $this->initDB(); … … 1040 1040 public function requireAccessClearance($security_zone, $message='') 1041 1041 { 1042 1042 $app =& App::getInstance(); 1043 1043 1044 1044 $zone_members = preg_split('/,\s*/', $security_zone); -
trunk/lib/AuthorizeNet.inc.php
r478 r479 155 155 public function setParam($params) 156 156 { 157 157 $app =& App::getInstance(); 158 158 159 159 if (isset($params) && is_array($params)) { … … 174 174 public function getParam($param) 175 175 { 176 176 $app =& App::getInstance(); 177 177 178 178 if (array_key_exists($param, $this->_params)) { … … 194 194 public function process() 195 195 { 196 196 $app =& App::getInstance(); 197 197 198 198 if (empty($this->_params['x_login'])) { -
trunk/lib/CSS.inc.php
r478 r479 50 50 public function setParam($params) 51 51 { 52 52 $app =& App::getInstance(); 53 53 54 54 if (isset($params) && is_array($params)) { … … 69 69 public function getParam($param) 70 70 { 71 71 $app =& App::getInstance(); 72 72 73 73 if (array_key_exists($param, $this->_params)) { … … 89 89 public function setFile($file, $realms='') 90 90 { 91 91 $app =& App::getInstance(); 92 92 93 93 if (!is_array($realms)) { … … 117 117 public function headers($realm='') 118 118 { 119 119 $app =& App::getInstance(); 120 120 121 121 $realm = '' == $realm ? 'default' : $realm; -
trunk/lib/Cache.inc.php
r478 r479 110 110 public function setParam($params) 111 111 { 112 112 $app =& App::getInstance(); 113 113 114 114 if (isset($params) && is_array($params)) { … … 129 129 public function getParam($param) 130 130 { 131 131 $app =& App::getInstance(); 132 132 133 133 if (array_key_exists($param, $this->_params)) { … … 151 151 public function set($key, $var, $allow_oversized=false) 152 152 { 153 153 $app =& App::getInstance(); 154 154 155 155 if (true !== $this->getParam('enabled')) { -
trunk/lib/Captcha.inc.php
r468 r479 149 149 public function __construct() 150 150 { 151 151 $app =& App::getInstance(); 152 152 153 153 $this->secret_key = $app->getParam('signing_key'); … … 166 166 public function getAsciiNumber($num=null) 167 167 { 168 168 $app =& App::getInstance(); 169 169 170 170 if (!isset($num)) { -
trunk/lib/Cart.inc.php
r478 r479 82 82 public function __construct($namespace='') 83 83 { 84 84 $app =& App::getInstance(); 85 85 86 86 $this->_ns = $namespace; … … 114 114 public function getParam($param) 115 115 { 116 116 $app =& App::getInstance(); 117 117 118 118 if (array_key_exists($param, $this->_params)) { … … 279 279 public function sum($key='extended_price') 280 280 { 281 281 $sum = 0; 282 282 switch ($key) { 283 283 case 'items' : … … 285 285 break; 286 286 287 287 case 'extended_price' : 288 288 foreach ($_SESSION['_cart'][$this->_ns]['items'] as $item_id => $specs) { 289 289 $sum += isset($specs[$key]) && is_numeric($specs[$key]) ? $specs[$key] : 0; -
trunk/lib/Currency.inc.php
r478 r479 54 54 public function __construct($params=array()) 55 55 { 56 56 $app =& App::getInstance(); 57 57 58 58 // Set custom parameters. … … 96 96 public function getParam($param) 97 97 { 98 98 $app =& App::getInstance(); 99 99 100 100 if (array_key_exists($param, $this->_params)) { -
trunk/lib/DB.inc.php
r478 r479 101 101 public function setParam($params) 102 102 { 103 103 $app =& App::getInstance(); 104 104 105 105 if (isset($params) && is_array($params)) { … … 120 120 public function getParam($param) 121 121 { 122 122 $app =& App::getInstance(); 123 123 124 124 if (array_key_exists($param, $this->_params)) { … … 139 139 public function connect() 140 140 { 141 141 $app =& App::getInstance(); 142 142 143 143 if (!$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass')) { … … 339 339 public function tableExists($table, $use_cached_results=true) 340 340 { 341 341 $app =& App::getInstance(); 342 342 343 343 if (!$this->_connected) { -
trunk/lib/DBSessionHandler.inc.php
r468 r479 53 53 public function __construct($db, $params=array()) 54 54 { 55 55 $app =& App::getInstance(); 56 56 57 57 $this->_params = array_merge($this->_params, $params); … … 96 96 public function initDB($recreate_db=false) 97 97 { 98 98 $app =& App::getInstance(); 99 99 100 100 static $_db_tested = false; -
trunk/lib/Email.inc.php
r478 r479 120 120 public function setParam($params) 121 121 { 122 122 $app =& App::getInstance(); 123 123 124 124 if (isset($params) && is_array($params)) { … … 147 147 public function getParam($param) 148 148 { 149 149 $app =& App::getInstance(); 150 150 151 151 if (array_key_exists($param, $this->_params)) { … … 167 167 public function setTemplate($template) 168 168 { 169 169 $app =& App::getInstance(); 170 170 171 171 // Load file, using include_path. … … 191 191 public function setString($string) 192 192 { 193 193 $app =& App::getInstance(); 194 194 195 195 if ('' == trim($string)) { … … 215 215 public function replace($replacements) 216 216 { 217 217 $app =& App::getInstance(); 218 218 219 219 // Ensure template exists. … … 252 252 public function send($to=null, $from=null, $subject=null, $headers=null) 253 253 { 254 254 $app =& App::getInstance(); 255 255 256 256 // Use arguments if provided. … … 335 335 if (ini_get('safe_mode')) { 336 336 $ret = mb_send_mail($final_to, $this->_params['subject'], $final_body, $final_headers); 337 337 } else { 338 338 $ret = mb_send_mail($final_to, $this->_params['subject'], $final_body, $final_headers, $envelope_sender_header); 339 339 } … … 366 366 public function validEmail($email) 367 367 { 368 368 $app =& App::getInstance(); 369 369 370 370 // If an array, check values recursively. -
trunk/lib/FormValidator.inc.php
r478 r479 79 79 public function setParam($params) 80 80 { 81 81 $app =& App::getInstance(); 82 82 83 83 if (isset($params) && is_array($params)) { … … 98 98 public function getParam($param) 99 99 { 100 100 $app =& App::getInstance(); 101 101 102 102 if (array_key_exists($param, $this->_params)) { … … 465 465 public function validateEmail($form_name, $strict=false) 466 466 { 467 467 $app =& App::getInstance(); 468 468 469 469 $email = getFormData($form_name); -
trunk/lib/Hierarchy.inc.php
r468 r479 115 115 public function toStringID($child_type=null, $child_id=null) 116 116 { 117 117 $app =& App::getInstance(); 118 118 119 119 if (!isset($child_type) || !isset($child_id)) { … … 149 149 public function toArrayID(&$node) 150 150 { 151 151 $app =& App::getInstance(); 152 152 153 153 if (preg_match('/^([[:alnum:]]+)__-?([[:digit:]]+)$/', $node, $node_parts)) { … … 169 169 public function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='') 170 170 { 171 172 171 $app =& App::getInstance(); 172 $db =& DB::getInstance(); 173 173 174 174 if (!isset($child_type) || !isset($child_id)) { … … 248 248 public function deleteNode($child_type=null, $child_id=null) 249 249 { 250 251 250 $app =& App::getInstance(); 251 $db =& DB::getInstance(); 252 252 253 253 if (!isset($child_type) || !isset($child_id)) { … … 298 298 public function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='') 299 299 { 300 301 302 303 300 $app =& App::getInstance(); 301 $db =& DB::getInstance(); 302 303 if (!isset($child_type) || !isset($child_id)) { 304 304 if ($this->node_init) { 305 305 $child_type =& $this->child_type; … … 375 375 public function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='') 376 376 { 377 378 377 $app =& App::getInstance(); 378 $db =& DB::getInstance(); 379 379 380 380 if (!isset($child_type) || !isset($child_id)) { … … 426 426 public function getNode($child_type=null, $child_id=null) 427 427 { 428 429 428 $app =& App::getInstance(); 429 $db =& DB::getInstance(); 430 430 431 431 if (!isset($child_type) || !isset($child_id)) { … … 470 470 public function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='') 471 471 { 472 473 472 $app =& App::getInstance(); 473 $db =& DB::getInstance(); 474 474 475 475 if (!isset($child_type) || !isset($child_id)) { … … 522 522 public function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null) 523 523 { 524 525 524 $app =& App::getInstance(); 525 $db =& DB::getInstance(); 526 526 527 527 if (!isset($child_type) || !isset($child_id)) { … … 563 563 public function isLeaf($child_type=null, $child_id=null) 564 564 { 565 565 $app =& App::getInstance(); 566 566 567 567 if (!isset($child_type) || !isset($child_id)) { … … 624 624 public function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true) 625 625 { 626 626 $db =& DB::getInstance(); 627 627 628 628 static $output = array(); … … 678 678 public function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null) 679 679 { 680 681 680 $app =& App::getInstance(); 681 $db =& DB::getInstance(); 682 682 683 683 if (!isset($child_type) || !isset($child_id)) { … … 730 730 public function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true) 731 731 { 732 732 $app =& App::getInstance(); 733 733 734 734 static $output = array(); … … 803 803 public function rebuildSubnodeQty($type_constraint=null) 804 804 { 805 805 $db =& DB::getInstance(); 806 806 807 807 // Reset all the category counters to zero. … … 827 827 public function setSubnodeQtyToParents($child_type, $child_id, $num_children) 828 828 { 829 829 $db =& DB::getInstance(); 830 830 831 831 $db->query(" -
trunk/lib/Image.inc.php
r468 r479 44 44 { 45 45 if (!is_array($params)) { 46 46 trigger_error(sprintf('Parameters not specified properly.', null), E_USER_ERROR); 47 47 } 48 48 $defaults = array( -
trunk/lib/ImageThumb.inc.php
r478 r479 118 118 public function setParam($params) 119 119 { 120 120 $app =& App::getInstance(); 121 121 122 122 if (isset($params) && is_array($params)) { … … 162 162 public function getParam($param) 163 163 { 164 164 $app =& App::getInstance(); 165 165 166 166 if (array_key_exists($param, $this->_params)) { … … 182 182 public function setSpec($spec, $index=null) 183 183 { 184 184 $app =& App::getInstance(); 185 185 186 186 // A little sanity checking. … … 273 273 public function processAll($runtime_specs=null) 274 274 { 275 275 $app =& App::getInstance(); 276 276 277 277 // Ensure we have a source. … … 315 315 public function processFile($file_name, $runtime_specs=null) 316 316 { 317 317 $app =& App::getInstance(); 318 318 319 319 // Source file determined by provided file_name. … … 454 454 private function _resizeWithNetpbm($source_file, $dest_file, $spec) 455 455 { 456 456 $app =& App::getInstance(); 457 457 458 458 // Define pnmscale arguments. … … 523 523 private function _resizeWithGD($source_file, $dest_file, $spec) 524 524 { 525 525 $app =& App::getInstance(); 526 526 527 527 // Get original file dimensions and type. … … 664 664 public function deleteThumbs($file_name, $use_glob=false) 665 665 { 666 666 $app =& App::getInstance(); 667 667 668 668 // Ensure we have a source. … … 702 702 public function deleteOriginal($file_name) 703 703 { 704 704 $app =& App::getInstance(); 705 705 706 706 // Ensure we have a source. … … 735 735 public function exists($file_name) 736 736 { 737 737 $app =& App::getInstance(); 738 738 739 739 // Ensure we have a source. … … 768 768 private function _createDestDirs($filename=null) 769 769 { 770 770 $app =& App::getInstance(); 771 771 772 772 // Keep track of directories we've already created. … … 826 826 private function _raiseMsg($message, $type, $file, $line) 827 827 { 828 828 $app =& App::getInstance(); 829 829 830 830 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 50 50 public function setParam($params) 51 51 { 52 52 $app =& App::getInstance(); 53 53 54 54 if (isset($params) && is_array($params)) { … … 69 69 public function getParam($param) 70 70 { 71 71 $app =& App::getInstance(); 72 72 73 73 if (array_key_exists($param, $this->_params)) { … … 89 89 public function setFile($file, $realms='') 90 90 { 91 91 $app =& App::getInstance(); 92 92 93 93 if (!is_array($realms)) { … … 117 117 public function headers($realm='') 118 118 { 119 119 $app =& App::getInstance(); 120 120 121 121 $realm = '' == $realm ? 'default' : $realm; -
trunk/lib/Lock.inc.php
r478 r479 75 75 public function __construct($auth_object) 76 76 { 77 77 $app =& App::getInstance(); 78 78 79 79 if (!method_exists($auth_object, 'get') || !method_exists($auth_object, 'getUsername')) { … … 98 98 public function initDB($recreate_db=false) 99 99 { 100 101 100 $app =& App::getInstance(); 101 $db =& DB::getInstance(); 102 102 103 103 static $_db_tested = false; … … 160 160 public function getParam($param) 161 161 { 162 162 $app =& App::getInstance(); 163 163 164 164 if (array_key_exists($param, $this->_params)) { … … 181 181 public function select($record_table_or_lock_id, $record_key=null, $record_val=null) 182 182 { 183 184 183 $app =& App::getInstance(); 184 $db =& DB::getInstance(); 185 185 186 186 $this->initDB(); … … 233 233 public function isMine() 234 234 { 235 235 $db =& DB::getInstance(); 236 236 237 237 $this->initDB(); … … 261 261 public function set($record_table, $record_key, $record_val, $title='') 262 262 { 263 263 $db =& DB::getInstance(); 264 264 265 265 $this->initDB(); … … 307 307 public function remove() 308 308 { 309 310 309 $app =& App::getInstance(); 310 $db =& DB::getInstance(); 311 311 312 312 $this->initDB(); … … 329 329 public function removeAll($user_id=null) 330 330 { 331 332 331 $app =& App::getInstance(); 332 $db =& DB::getInstance(); 333 333 334 334 $this->initDB(); … … 353 353 public function _auto_timeout() 354 354 { 355 355 $db =& DB::getInstance(); 356 356 357 357 static $_timeout_run = false; … … 374 374 public function dieErrorPage() 375 375 { 376 376 $app =& App::getInstance(); 377 377 378 378 $app->dieURL(sprintf('%s?lock_id=%s&boomerang=%s', $this->getParam('error_url'), $this->data['lock_id'], urlencode(absoluteMe()))); … … 384 384 public function printErrorHTML() 385 385 { 386 386 $app =& App::getInstance(); 387 387 388 388 ?> -
trunk/lib/MCVE.inc.php
r468 r479 45 45 public function __construct($username, $password) 46 46 { 47 47 $app =& App::getInstance(); 48 48 49 49 // Ensure PHP was compiled with the MCVE functions. … … 60 60 private function _connect() 61 61 { 62 62 $app =& App::getInstance(); 63 63 64 64 if ($this->connected) { … … 146 146 public function sendTrans($tid, $type='', $hide_msg=false) 147 147 { 148 148 $app =& App::getInstance(); 149 149 150 150 // Finalize structuring of to MCVE and ready it to be sent -
trunk/lib/Navigation.inc.php
r478 r479 55 55 public function __construct($params=null) 56 56 { 57 57 $app =& App::getInstance(); 58 58 59 59 if (isset($params) && is_array($params)) { … … 93 93 public function setParam($params) 94 94 { 95 95 $app =& App::getInstance(); 96 96 97 97 if (isset($params) && is_array($params)) { … … 112 112 public function getParam($param) 113 113 { 114 114 $app =& App::getInstance(); 115 115 116 116 if (array_key_exists($param, $this->_params)) { … … 229 229 public function getBreadcrumbs() 230 230 { 231 231 $app =& App::getInstance(); 232 232 233 233 if ($this->getParam('breadcrumbs')) { -
trunk/lib/PEdit.inc.php
r478 r479 123 123 public function setParam($params) 124 124 { 125 125 $app =& App::getInstance(); 126 126 127 127 if (isset($params) && is_array($params)) { … … 142 142 public function getParam($param) 143 143 { 144 144 $app =& App::getInstance(); 145 145 146 146 if (array_key_exists($param, $this->_params)) { … … 161 161 public function start($initialize_data_file=false) 162 162 { 163 163 $app =& App::getInstance(); 164 164 165 165 if (!is_dir($this->getParam('data_dir'))) { … … 219 219 public function set($name, $options=array()) 220 220 { 221 221 $app =& App::getInstance(); 222 222 223 223 $name = preg_replace('/\s/', '_', $name); … … 253 253 public function formBegin() 254 254 { 255 255 $app =& App::getInstance(); 256 256 257 257 if (!$this->_authorized || empty($this->_data)) { … … 401 401 public function printVersions() 402 402 { 403 403 $app =& App::getInstance(); 404 404 405 405 if ($this->_authorized && $this->op == 'Versions') { … … 444 444 private function _fileHash() 445 445 { 446 446 $app =& App::getInstance(); 447 447 448 448 return md5($app->getParam('signing_key') . $_SERVER['PHP_SELF']); … … 459 459 private function _loadDataFile() 460 460 { 461 461 $app =& App::getInstance(); 462 462 463 463 if (!file_exists($this->_data_file)) { … … 498 498 private function _initializeDataFile() 499 499 { 500 500 $app =& App::getInstance(); 501 501 502 502 $app->logMsg(sprintf('Initializing data file: %s', $this->_data_file), LOG_INFO, __FILE__, __LINE__); … … 514 514 private function _writeData() 515 515 { 516 516 $app =& App::getInstance(); 517 517 518 518 if (!$this->_authorized) { … … 562 562 private function _filePutContents($filename, $content) 563 563 { 564 564 $app =& App::getInstance(); 565 565 566 566 // Ensure requested filename is within the pedit data dir. … … 612 612 private function _createVersion() 613 613 { 614 614 $app =& App::getInstance(); 615 615 616 616 if (!$this->_authorized) { … … 650 650 private function _deleteOldVersions() 651 651 { 652 652 $app =& App::getInstance(); 653 653 654 654 $version_files = $this->_getVersions(); … … 709 709 private function _restoreVersion($version) 710 710 { 711 711 $app =& App::getInstance(); 712 712 713 713 if (!$this->_authorized) { -
trunk/lib/PageNumbers.inc.php
r468 r479 95 95 public function setPerPage($per_page, $default=25, $save_value=true) 96 96 { 97 97 // (1) By provided argument, if valid. 98 98 // (2) By saved preference, if available. 99 99 // (3) Set to default value if provided and valid. … … 160 160 public function calculate() 161 161 { 162 162 $app =& App::getInstance(); 163 163 164 164 if (!$this->set_per_page_initialized) { … … 214 214 public function getLimitSQL() 215 215 { 216 217 216 $app =& App::getInstance(); 217 $db =& DB::getInstance(); 218 218 219 219 if (is_numeric($this->first_item) && is_numeric($this->_per_page)) { … … 232 232 public function printPerPageLinks($query_key='per_page') 233 233 { 234 234 $app =& App::getInstance(); 235 235 236 236 $sp = ''; … … 262 262 public function getPageNumURL($page_number, $carry_args=null) 263 263 { 264 264 $app =& App::getInstance(); 265 265 266 266 return $app->oHREF($this->url_base . $page_number, $carry_args); -
trunk/lib/PageSequence.inc.php
r473 r479 153 153 public function setCurrent($step_id) 154 154 { 155 155 $app =& App::getInstance(); 156 156 157 157 if (false !== ($pos = $this->getPosition($step_id))) { … … 279 279 public function printEditLink($step_id=null) 280 280 { 281 281 $app =& App::getInstance(); 282 282 283 283 $pos = isset($step_id) ? $this->getPosition($step_id) : $this->getPosition(); … … 344 344 private function _auto_timeout() 345 345 { 346 346 $app =& App::getInstance(); 347 347 348 348 if (isset($_SESSION[$this->seq]['last_access_time']) -
trunk/lib/PayPal.inc.php
r478 r479 97 97 public function setButtonDefaults($type, $options) 98 98 { 99 99 $app =& App::getInstance(); 100 100 101 101 if (!is_array($options) || empty($options)) { … … 129 129 public function newButton($type, $name, $options=null) 130 130 { 131 131 $app =& App::getInstance(); 132 132 133 133 if (!isset($this->_default_button_options[$type])) { … … 164 164 public function getLink($name) 165 165 { 166 166 $app =& App::getInstance(); 167 167 168 168 if (!isset($this->_buttons[$name])) { … … 236 236 public function setParam($params) 237 237 { 238 238 $app =& App::getInstance(); 239 239 240 240 if (isset($params) && is_array($params)) { … … 255 255 public function getParam($param) 256 256 { 257 257 $app =& App::getInstance(); 258 258 259 259 if (array_key_exists($param, $this->_params)) { … … 292 292 public function processIPN() 293 293 { 294 294 $app =& App::getInstance(); 295 295 296 296 if (getPost('test_ipn') == '1' || $this->getParam('test_mode')) { … … 353 353 public function verifiedIPN() 354 354 { 355 355 $app =& App::getInstance(); 356 356 357 357 if (!isset($this->_ipn_response)) { -
trunk/lib/Prefs.inc.php
r478 r479 259 259 } 260 260 if (!is_scalar($val) && !is_array($val) && !is_object($val)) { 261 $app->logMsg(sprintf('Value is not a string-compatibletype (%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__); 262 262 return false; 263 263 } -
trunk/lib/ScriptTimer.inc.php
r468 r479 31 31 private $_timing_cumulative_times = array(); 32 32 33 34 33 public function start($name='default') 34 { 35 35 $this->_timing_start_times[$name] = explode(' ', microtime()); 36 37 38 39 40 41 42 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 } 44 44 $this->_timing_stop_times[$name] = explode(' ', microtime()); 45 45 $this->_timing_cumulative_times[$name] += $this->getTime($name); 46 47 48 49 46 } 47 48 public function getTime($name='default') 49 { 50 50 if (!isset($this->_timing_start_times[$name])) { 51 51 return 0; 52 52 } 53 53 if (!isset($this->_timing_stop_times[$name])) { … … 60 60 $current += $stop_time[0] - $this->_timing_start_times[$name][0]; 61 61 return $current; 62 63 64 65 66 67 68 69 70 71 72 73 74 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); 75 75 76 76 echo '<pre>'; 77 78 79 77 foreach ($this->_timing_cumulative_times as $name => $time) { 78 printf("\n%-{$name_len}s $this->time_format", $name, $time); 79 } 80 80 echo '</pre>'; 81 81 } 82 82 } -
trunk/lib/SortOrder.inc.php
r468 r479 176 176 public function getSortOrderSQL() 177 177 { 178 179 178 $app =& App::getInstance(); 179 $db =& DB::getInstance(); 180 180 181 181 if (!isset($this->_columns[mb_strtolower($this->sort_by)])) { … … 207 207 public function printSortHeader($col, $col_name, $default_order='ASC') 208 208 { 209 209 $app =& App::getInstance(); 210 210 211 211 if (isset($this->_columns[$col])) { -
trunk/lib/SpellCheck.inc.php
r478 r479 82 82 public function __construct($params) 83 83 { 84 84 $app =& App::getInstance(); 85 85 86 86 if (!extension_loaded('pspell')) { … … 120 120 public function setParam($params) 121 121 { 122 122 $app =& App::getInstance(); 123 123 124 124 if (isset($params) && is_array($params)) { … … 139 139 public function getParam($param) 140 140 { 141 141 $app =& App::getInstance(); 142 142 143 143 if (array_key_exists($param, $this->_params)) { … … 214 214 public function add($word) 215 215 { 216 216 $app =& App::getInstance(); 217 217 218 218 if ($this->_use_personal_wordlist) { … … 239 239 public function save() 240 240 { 241 241 $app =& App::getInstance(); 242 242 243 243 if ($this->_use_personal_wordlist) { -
trunk/lib/TemplateGlue.inc.php
r468 r479 74 74 function getSetEnumFieldValues($db_table, $db_col, $sort=false) 75 75 { 76 77 76 $app =& App::getInstance(); 77 $db =& DB::getInstance(); 78 78 79 79 $qid = $db->query("SHOW COLUMNS FROM " . $db->escapeString($db_table) . " LIKE '" . $db->escapeString($db_col) . "'",false); … … 315 315 function printSelectForm($db_table, $key_column, $val_column, $preselected, $first=false, $extra_clause='', $sql_format='SELECT %1$s, %2$s FROM %3$s %4$s') 316 316 { 317 317 $db =& DB::getInstance(); 318 318 319 319 // Sometimes preselected comes as a comma list. … … 359 359 function printDBCheckboxes($db_table, $key_column, $val_column, $preselected, $columns=1, $extra_clause='', $vert_columns=false) 360 360 { 361 361 $db =& DB::getInstance(); 362 362 363 363 // Sometimes preselected comes as a comma list. -
trunk/lib/Upload.inc.php
r478 r479 76 76 public function setParam($params) 77 77 { 78 78 $app =& App::getInstance(); 79 79 80 80 if (isset($params) && is_array($params)) { … … 120 120 public function getParam($param) 121 121 { 122 122 $app =& App::getInstance(); 123 123 124 124 if (array_key_exists($param, $this->_params)) { … … 146 146 public function process($form_name, $custom_file_name=null) 147 147 { 148 148 $app =& App::getInstance(); 149 149 150 150 // Ensure we have a upload directory. … … 353 353 public function deleteFile($file_name, $use_glob=false) 354 354 { 355 355 $app =& App::getInstance(); 356 356 357 357 // Ensure we have a upload directory. … … 386 386 public function moveFile($old_name, $new_name) 387 387 { 388 388 $app =& App::getInstance(); 389 389 390 390 // Ensure we have an upload directory. … … 421 421 public function exists($file_name) 422 422 { 423 423 $app =& App::getInstance(); 424 424 425 425 // Ensure we have a upload directory. … … 518 518 public function _raiseMsg($message, $type, $file, $line) 519 519 { 520 520 $app =& App::getInstance(); 521 521 522 522 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 29 29 * Print variable dump. 30 30 * 31 * @param mixed $varThe variable to dump.32 * @param bool $displayPrint the dump in <pre> tags or hide it in html comments (non-CLI only).33 * @param bool $var_dumpUse var_dump instead of print_r.34 * @param string $fileValue of __FILE__.35 * @param string $lineValue 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__ 36 36 */ 37 37 function dump($var, $display=false, $var_dump=false, $file='', $line='') … … 45 45 var_dump($var); 46 46 } else { 47 48 49 50 51 52 53 54 55 56 57 58 59 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 } 61 61 } 62 62 if (defined('_CLI')) { … … 144 144 function oTxt($text, $preserve_html=false) 145 145 { 146 146 $app =& App::getInstance(); 147 147 148 148 $search = array(); … … 546 546 function filePutContents($filename, $content) 547 547 { 548 548 $app =& App::getInstance(); 549 549 550 550 // Open file for writing and truncate to zero length. … … 754 754 function escapedList($in, $separator="', '") 755 755 { 756 756 $db =& DB::getInstance(); 757 757 758 758 if (is_array($in) && !empty($in)) { … … 982 982 function mailmanAddMember($email, $list, $send_welcome_message=false) 983 983 { 984 985 986 984 $app =& App::getInstance(); 985 986 $add_members = '/usr/lib/mailman/bin/add_members'; 987 987 // FIXME: checking of executable is disabled. 988 988 if (true || is_executable($add_members) && is_readable($add_members)) { … … 1014 1014 function mailmanRemoveMember($email, $list, $send_user_ack=false) 1015 1015 { 1016 1016 $app =& App::getInstance(); 1017 1017 1018 1018 $remove_members = '/usr/lib/mailman/bin/remove_members'; -
trunk/lib/Validator.inc.php
r470 r479 251 251 static public function validateStrDate($val) 252 252 { 253 254 255 256 253 if (is_string($val) && '' === trim($val)) { 254 // Don't be too bothered about empty strings. 255 return true; 256 } 257 257 258 258 $timestamp = strtotime($val); -
trunk/lib/Version.inc.php
r478 r479 82 82 public function __construct($auth_object) 83 83 { 84 84 $app =& App::getInstance(); 85 85 86 86 if (!method_exists($auth_object, 'get') || !method_exists($auth_object, 'getUsername')) { … … 105 105 public function initDB($recreate_db=false) 106 106 { 107 108 107 $app =& App::getInstance(); 108 $db =& DB::getInstance(); 109 109 110 110 static $_db_tested = false; … … 173 173 public function getParam($param) 174 174 { 175 175 $app =& App::getInstance(); 176 176 177 177 if (array_key_exists($param, $this->_params)) { … … 195 195 public function create($record_table, $record_key, $record_val, $title='', $notes='') 196 196 { 197 198 197 $app =& App::getInstance(); 198 $db =& DB::getInstance(); 199 199 200 200 $this->initDB(); … … 256 256 public function restore($version_id) 257 257 { 258 259 258 $app =& App::getInstance(); 259 $db =& DB::getInstance(); 260 260 261 261 $this->initDB(); … … 317 317 public function deleteOld($record_table, $record_key, $record_val) 318 318 { 319 319 $db =& DB::getInstance(); 320 320 321 321 $this->initDB(); … … 384 384 public function getList($record_table, $record_key, $record_val) 385 385 { 386 386 $db =& DB::getInstance(); 387 387 388 388 $this->initDB(); … … 421 421 public function getVerson($version_id) 422 422 { 423 423 $db =& DB::getInstance(); 424 424 425 425 $this->initDB(); … … 442 442 public function getData($version_id) 443 443 { 444 444 $db =& DB::getInstance(); 445 445 446 446 $this->initDB(); … … 468 468 public function getCurrent($record_table, $record_key, $record_val) 469 469 { 470 470 $db =& DB::getInstance(); 471 471 472 472 $this->initDB(); -
trunk/services/admins.php
r468 r479 280 280 global $auth; 281 281 global $lock; 282 283 282 $app =& App::getInstance(); 283 $db =& DB::getInstance(); 284 284 285 285 $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id); … … 339 339 global $lock; 340 340 global $cache; 341 342 341 $app =& App::getInstance(); 342 $db =& DB::getInstance(); 343 343 344 344 $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id); … … 385 385 global $auth; 386 386 global $cache; 387 388 387 $app =& App::getInstance(); 388 $db =& DB::getInstance(); 389 389 390 390 // Remove any stale cached list data. … … 428 428 global $lock; 429 429 global $cache; 430 431 430 $app =& App::getInstance(); 431 $db =& DB::getInstance(); 432 432 433 433 $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $frm['admin_id']); … … 474 474 global $cache; 475 475 global $auth; 476 476 $db =& DB::getInstance(); 477 477 478 478 $where_clause = ''; -
trunk/services/logs.php
r468 r479 159 159 function deleteLog($log_file) 160 160 { 161 161 $app =& App::getInstance(); 162 162 163 163 if (!file_exists($app->getParam('log_directory') . '/' . $log_file)) { … … 186 186 function clearLog($log_file) 187 187 { 188 188 $app =& App::getInstance(); 189 189 190 190 if (!$fp = fopen($app->getParam('log_directory') . '/' . $log_file, 'r+')) { … … 211 211 function archiveLog($log_file) 212 212 { 213 213 $app =& App::getInstance(); 214 214 215 215 $old_file_name = $log_file; … … 233 233 function printLog($log_file) 234 234 { 235 235 $app =& App::getInstance(); 236 236 237 237 if (!is_file($app->getParam('log_directory') . '/' . $log_file)) { … … 246 246 function &getLog($log_file, $search_query='') 247 247 { 248 248 $app =& App::getInstance(); 249 249 250 250 $log = array(); … … 271 271 { 272 272 global $valid_file_extensions; 273 273 $app =& App::getInstance(); 274 274 275 275 // Get a list of all files in the log directory. -
trunk/tests/AppTest.php
r468 r479 94 94 function test_dbquery() 95 95 { 96 96 $db =& DB::getInstance(); 97 97 98 98 $qid = $db->query("SELECT 2 + 2"); -
trunk/tests/AuthSQLTest.php
r468 r479 38 38 function setUp() 39 39 { 40 40 require dirname(__FILE__) . '/_config.inc.php'; 41 41 require_once '../lib/Auth_SQL.inc.php'; 42 42 $this->Auth_SQL = new Auth_SQL('testauth'); … … 75 75 function tearDown() 76 76 { 77 78 79 77 $db =& DB::getInstance(); 78 79 unset($this->Auth_SQL); 80 80 $db->query("DROP TABLE IF EXISTS test_user_tbl"); 81 81 $db->query("DROP TABLE IF EXISTS test_login_tbl"); … … 163 163 function test_blockaccount() 164 164 { 165 165 $db =& DB::getInstance(); 166 166 167 167 $this->Auth_SQL->login('testuser', 'testpass'); … … 177 177 function test_unblockaccount() 178 178 { 179 179 $db =& DB::getInstance(); 180 180 181 181 $db->query(" … … 239 239 function test_setpassword() 240 240 { 241 241 $db =& DB::getInstance(); 242 242 243 243 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1_HARDENED)); -
trunk/tests/Auth_SQLTest.php
r468 r479 42 42 function setUp() 43 43 { 44 44 require dirname(__FILE__) . '/_config.inc.php'; 45 45 require_once '../lib/Auth_SQL.inc.php'; 46 46 $this->Auth_SQL =& new Auth_SQL('testauth'); … … 79 79 function tearDown() 80 80 { 81 82 83 81 $db =& DB::getInstance(); 82 83 unset($this->Auth_SQL); 84 84 $db->query("DROP TABLE IF EXISTS test_user_tbl"); 85 85 $db->query("DROP TABLE IF EXISTS test_login_tbl"); … … 163 163 function test_blockaccount() 164 164 { 165 165 $db =& DB::getInstance(); 166 166 167 167 $this->Auth_SQL->login('testuser', 'testpass'); … … 177 177 function test_unblockaccount() 178 178 { 179 179 $db =& DB::getInstance(); 180 180 181 181 $db->query(" … … 239 239 function test_setpassword() 240 240 { 241 241 $db =& DB::getInstance(); 242 242 243 243 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1_HARDENED)); -
trunk/tests/LockTest.php
r468 r479 37 37 38 38 function setUp() 39 { 39 { 40 40 require dirname(__FILE__) . '/_config.inc.php'; 41 41 require_once '../lib/Lock.inc.php'; … … 86 86 function tearDown() 87 87 { 88 89 88 $db =& DB::getInstance(); 89 90 90 unset($this->Lock); 91 91 unset($this->Auth_SQL); -
trunk/tests/VersionTest.php
r468 r479 37 37 38 38 function setUp() 39 { 39 { 40 40 require dirname(__FILE__) . '/_config.inc.php'; 41 41 require_once '../lib/Version.inc.php'; … … 83 83 function tearDown() 84 84 { 85 86 85 $db =& DB::getInstance(); 86 87 87 unset($this->Version); 88 88 unset($this->Auth_SQL);
Note: See TracChangeset
for help on using the changeset viewer.