- Timestamp:
- Jun 11, 2009 4:37:41 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Cart.inc.php
r353 r354 247 247 * Return the sum of the numeric values stored under the specified key for cart items. 248 248 * 0 will be returned if key is invalid or not filled with numeric values. 249 * Most commonly, $cart->sum() will be called when checking out to retrieve the total 250 * cost of the items in the cart. 249 251 * 250 252 * @access public … … 257 259 function sum($key='extended_price') 258 260 { 261 $sum = 0; 259 262 switch ($key) { 260 263 case 'items' : 261 return sizeof($_SESSION['_cart'][$this->_ns]['items']); 262 263 case 'extended_price' : 264 $sum = 0; 264 $sum = sizeof($_SESSION['_cart'][$this->_ns]['items']); 265 266 case 'extended_price' : 265 267 foreach ($_SESSION['_cart'][$this->_ns]['items'] as $item_id => $specs) { 266 268 $sum += isset($specs[$key]) && is_numeric($specs[$key]) ? $specs[$key] : 0; 267 269 } 268 return $sum; 270 269 271 default : 270 $sum = 0;272 // Retreive arbitrary values stored in the cart (shipping, air miles, etc). 271 273 foreach ($_SESSION['_cart'][$this->_ns]['items'] as $item_id => $specs) { 272 274 $sum += isset($specs[$key]) && is_numeric($specs[$key]) ? $specs[$key] * $specs['quantity'] : 0; 273 275 } 274 return $sum; 275 } 276 if (!isset($specs[$key])) { 277 $app->logMsg(sprintf('Could not sum up nonexistent value: %s', $key), LOG_ERR, __FILE__, __LINE__); 278 } 279 } 280 return $sum; 276 281 } 277 282 -
trunk/services/logs.php
r334 r354 25 25 $valid_file_extensions = array('', 'txt', 'log'); 26 26 27 // Files that cannot be deleted (preg search expressions).27 // Files that shouldn't be deleted (preg search expressions). 28 28 $no_delete_files = '/^php_error_log$|^access_log$|^error_log$|^ssl_request_log$/'; 29 29 30 // Files that cannot be cleared (preg search expressions).30 // Files that shouldn't be cleared (preg search expressions). 31 31 $no_clear_files = '/__|^access_log$|^error_log$|^ssl_request_log$/'; 32 32 33 // Files that cannot be archived (preg search expressions).33 // Files that shouldn't be archived (preg search expressions). 34 34 $no_archive_files = '/__|^access_log$|^error_log$|^ssl_request_log$/'; 35 35 36 // Files that cannot be archived (preg search expressions).36 // Files that shouldn't be downloaded (preg search expressions). 37 37 $no_download_files = '/^$/'; 38 38
Note: See TracChangeset
for help on using the changeset viewer.