juice13

Untitled

Sep 1st, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.26 KB | None | 0 0
  1. Index: LoggerAppenderRollingFile.php
  2. ===================================================================
  3. --- LoggerAppenderRollingFile.php       (revision 1374786)
  4. +++ LoggerAppenderRollingFile.php       (working copy)
  5. @@ -79,6 +79,15 @@
  6.          */
  7.         protected $compress = false;
  8.  
  9. +       private $clearConditional = false;
  10. +
  11. +       public function __construct($name = '') {
  12. +               parent::__construct($name);
  13. +               if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
  14. +                       $this->clearConditional = true;
  15. +               }
  16. +       }
  17. +
  18.         /**
  19.          * Get the maximum size that the output file is allowed to reach
  20.          * before being rolled over to backup files.
  21. @@ -195,7 +204,11 @@
  22.                         }
  23.  
  24.                         // Stats cache must be cleared, otherwise filesize() returns cached results
  25. -                       clearstatcache();
  26. +                       if ($this->clearConditional) {
  27. +                               clearstatcache(true, $this->file);
  28. +                       } else {
  29. +                               clearstatcache();
  30. +                       }
  31.  
  32.                         // Rollover if needed
  33.                         if (filesize($this->file) > $this->maxFileSize) {
Advertisement
Add Comment
Please, Sign In to add comment