Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->createDir();
- $this->errorMessage = null;
- set_error_handler(array($this, 'customErrorHandler'));
- $this->stream = fopen($this->url, 'a');
- if ($this->filePermission !== null) {
- @chmod($this->url, $this->filePermission);
- }
- restore_error_handler();
- if (!is_resource($this->stream)) {
- $this->stream = null;
- throw new UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url));
- }
- }
- if ($this->useLocking) {
- // ignoring errors here, there's not much we can do about them
- flock($this->stream, LOCK_EX);
- }
- $this->streamWrite($this->stream, $record);
- if ($this->useLocking) {
- flock($this->stream, LOCK_UN);
- }
- }
Add Comment
Please, Sign In to add comment