Changeset 7637 for trunk/src/inc/FileHandler.class.php
- Timestamp:
- Mar 31, 2010, 1:32:46 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/inc/FileHandler.class.php
r7631 r7637 16 16 public function __construct($filename) { 17 17 try { 18 trigger_log(SYSLOG_DEBUG, 'Opening the file "' . $filename . '"', __FILE__, __LINE__); 18 19 $handle = fopen($filename, 'r'); 20 21 trigger_log(SYSLOG_DEBUG, 'Reading from file "' . $filename . '"', __FILE__, __LINE__); 19 22 $this->file = ''; 20 23 while (!feof($handle)) { 21 24 $this->file .= fread($handle, 8192); 22 25 } 26 27 trigger_log(SYSLOG_DEBUG, 'Closing file "' . $filename . '"', __FILE__, __LINE__); 23 28 fclose($handle); 29 30 trigger_log(SYSLOG_INFO, 'Reading from file "' . $filename . '" is done', __FILE__, __LINE__); 24 31 } catch (Exception $err) { 25 32 // TODO: Better error description 26 trigger_ error();33 trigger_log(SYSLOG_ERR, 'Reading from file "' . $filename . '" failed', __FILE__, __LINE__); 27 34 } 28 35 }
Note:
See TracChangeset
for help on using the changeset viewer.