- Timestamp:
- Apr 16, 2010, 3:30:08 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/inc/FileHandler.class.php
r7725 r7780 50 50 } 51 51 52 53 54 55 56 57 52 58 /* 53 59 * Function: write … … 57 63 */ 58 64 public function write($data) { 59 // TODO David: Make write function 65 66 $filename = date( "m_d_y.kml" ); 67 68 69 try{ 70 trigger_log(SYSLOG_DEBUG, 'Opening the file "' . $filename . '"', __FILE__, __LINE__); 71 $file = new FileHandler($filename, 'w'); 72 } catch (Exception $err) { 73 trigger_log(SYSLOG_ERR, 'Opening the file "' . $filename . '"', __FILE__, __LINE__); 74 return false; 75 } 76 77 try{ 78 trigger_log(SYSLOG_DEBUG, 'Writing file "' . $filename . '"', __FILE__, __LINE__); 79 $file->write($file,$this->$data); 80 } catch (Exception $err) { 81 trigger_log(SYSLOG_ERR, 'Writing the file "' . $filename . '"', __FILE__, __LINE__); 82 return false; 83 } 84 85 86 try{ 87 trigger_log(SYSLOG_DEBUG, 'Closing file "' . $filename . '"', __FILE__, __LINE__); 88 fclose($file); 89 } catch (Exception $err) { 90 trigger_log(SYSLOG_ERR, 'Closing the file "' . $filename . '"', __FILE__, __LINE__); 91 return false; 92 } 93 94 return true; 95 60 96 61 return false;97 62 98 } 63 99
Note:
See TracChangeset
for help on using the changeset viewer.