10.30 php saved
oPless
Tags add more
ajax debug suppress  
Note
suppress debugging output for ajax and downloading. Shamlessly borrowed from somewhere else (I forget exactly where)
  1. Add this to app_controller, and call it at the start and end of your ajax call or whatever to stop debugging cruft upsetting your flash/javascript/downloads etc
  2.  
  3. NB. you have to call $this->suppressDebugBegin( $this->MyModel ) so it can grab a handle to the database.
  4.  
  5. function supressDebugBegin($basicModel)
  6. {
  7.     $db =& ConnectionManager::getDataSource($basicModel->useDbConfig);
  8.     $db->fullDebug = false;
  9.     while(@ob_end_clean());
  10. }
  11.  
  12. function supressDebugEnd()
  13. {
  14.     exit();
  15. }
  16.  
Parsed in 0.019 seconds, using GeSHi 1.0.7.14

Modify this Paste