Changeset 331
- Timestamp:
- May 6, 2008 7:49:25 PM (16 years ago)
- Location:
- trunk/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r325 r331 662 662 // Copy the value of the specified query argument into the _carry_queries array. 663 663 $this->_carry_queries[$k] = getFormData($k, $default); 664 $this->logMsg(sprintf('Carrying query: %s => %s', $k, $this->_carry_queries[$k]), LOG_DEBUG, __FILE__, __LINE__);664 $this->logMsg(sprintf('Carrying query: %s => %s', $k, truncate(getDump($this->_carry_queries[$k], true), 128, 'end')), LOG_DEBUG, __FILE__, __LINE__); 665 665 } 666 666 } -
trunk/lib/ImageThumb.inc.php
r320 r331 482 482 } else { 483 483 // An error occurred. 484 $app->logMsg(sprintf('Image %s failed resizing with return value: %s%s', $spec['dest_dir'] . '/' . basename($dest_file), $return_val, empty($output) ? '' : ' (' . getDump($output) . ')'), LOG_ERR, __FILE__, __LINE__);484 $app->logMsg(sprintf('Image %s failed resizing with return value: %s%s', $spec['dest_dir'] . '/' . basename($dest_file), $return_val, empty($output) ? '' : ' (' . truncate(getDump($output, true), 128, 'end') . ')'), LOG_ERR, __FILE__, __LINE__); 485 485 } 486 486 -
trunk/lib/PayPal.inc.php
r247 r331 80 80 81 81 if (!is_array($options) || empty($options)) { 82 $app->logMsg(sprintf('Invalid options: %s', getDump($options)), LOG_WARNING, __FILE__, __LINE__);82 $app->logMsg(sprintf('Invalid options: %s', truncate(getDump($options, true), 128, 'end')), LOG_WARNING, __FILE__, __LINE__); 83 83 return false; 84 84 } … … 117 117 118 118 if (!is_array($options) || empty($options)) { 119 $app->logMsg(sprintf('Invalid options: %s', getDump($options)), LOG_WARNING, __FILE__, __LINE__);119 $app->logMsg(sprintf('Invalid options: %s', truncate(getDump($options, true), 128, 'end')), LOG_WARNING, __FILE__, __LINE__); 120 120 return false; 121 121 } 122 122 123 123 if (isset($this->_buttons[$name])) { 124 $app->logMsg(sprintf('Overwriting existing button name: %s', getDump($this->_buttons[$name])), LOG_DEBUG, __FILE__, __LINE__);124 $app->logMsg(sprintf('Overwriting existing button name: %s', truncate(getDump($this->_buttons[$name], true), 128, 'end')), LOG_DEBUG, __FILE__, __LINE__); 125 125 } 126 126 … … 275 275 276 276 if (getPost('test_ipn') == '1' || $this->getParam('test_mode')) { 277 $app->logMsg(sprintf('Processing PayPal IPN in test mode: %s', getDump(getFormData())), LOG_DEBUG, __FILE__, __LINE__);277 $app->logMsg(sprintf('Processing PayPal IPN in test mode: %s', truncate(getDump(getFormData(), true), 128, 'end')), LOG_DEBUG, __FILE__, __LINE__); 278 278 $url = parse_url('https://www.sandbox.paypal.com/cgi-bin/webscr'); 279 279 } else { 280 $app->logMsg(sprintf('Processing PayPal IPN: %s', getDump(getFormData())), LOG_DEBUG, __FILE__, __LINE__);280 $app->logMsg(sprintf('Processing PayPal IPN: %s', truncate(getDump(getFormData(), true), 128, 'end')), LOG_DEBUG, __FILE__, __LINE__); 281 281 $url = parse_url($this->getParam('paypal_url')); 282 282 } -
trunk/lib/Prefs.inc.php
r309 r331 186 186 if (!isset($_SESSION['_prefs'][$this->_ns]['defaults'][$key]) || $_SESSION['_prefs'][$this->_ns]['defaults'][$key] != $val || isset($_SESSION['_prefs'][$this->_ns]['persistent'][$key])) { 187 187 $_SESSION['_prefs'][$this->_ns]['persistent'][$key] = $val; 188 $app->logMsg(sprintf('Setting preference %s => %s', $key, getDump($val)), LOG_DEBUG, __FILE__, __LINE__);188 $app->logMsg(sprintf('Setting preference %s => %s', $key, truncate(getDump($val, true), 128, 'end')), LOG_DEBUG, __FILE__, __LINE__); 189 189 } else { 190 $app->logMsg(sprintf('Not setting preference %s => %s', $key, getDump($val)), LOG_DEBUG, __FILE__, __LINE__);190 $app->logMsg(sprintf('Not setting preference %s => %s', $key, truncate(getDump($val, true), 128, 'end')), LOG_DEBUG, __FILE__, __LINE__); 191 191 } 192 192 } -
trunk/lib/Utilities.inc.php
r330 r331 27 27 * Return dump as variable. 28 28 * 29 * @param mixed $var Variable to dump. 29 * @param mixed $var Variable to dump. 30 * @param bool $serialize Remove line-endings. Useful for logging variables. 30 31 * @return string Dump of var. 31 32 */ 32 function getDump($var )33 function getDump($var, $serialize=false) 33 34 { 34 35 ob_start(); … … 36 37 $d = ob_get_contents(); 37 38 ob_end_clean(); 38 return $ d;39 return $serialize ? preg_replace('/\s+/m', '', $d) : $d; 39 40 } 40 41
Note: See TracChangeset
for help on using the changeset viewer.