]> source.dussan.org Git - nextcloud-server.git/commitdiff
Review fixes
authorBart Visscher <bartv@thisnet.nl>
Fri, 5 Jul 2013 20:42:17 +0000 (22:42 +0200)
committerBart Visscher <bartv@thisnet.nl>
Wed, 28 Aug 2013 15:11:43 +0000 (17:11 +0200)
lib/log/rotate.php

index d5b970c1a9e00959e24687ed2186e543cd0c5bfc..d79fd40342cc415f833ad5bfc0ae4abc7e977762 100644 (file)
@@ -11,16 +11,16 @@ namespace OC\Log;
 class Rotate extends \OC\BackgroundJob\Job {
        const LOG_SIZE_LIMIT = 104857600; // 100 MB
        public function run($logFile) {
-               $filesize = filesize($logFile);
+               $filesize = @filesize($logFile);
                if ($filesize >= self::LOG_SIZE_LIMIT) {
                        $this->rotate($logFile);
                }
        }
 
        protected function rotate($logfile) {
-               $rotated_logfile = $logfile.'.1';
-               rename($logfile, $rotated_logfile);
-               $msg = 'Log file "'.$logfile.'" was over 100MB, moved to "'.$rotated_logfile.'"';
+               $rotatedLogfile = $logfile.'.1';
+               rename($logfile, $rotatedLogfile);
+               $msg = 'Log file "'.$logfile.'" was over 100MB, moved to "'.$rotatedLogfile.'"';
                \OC_Log::write('OC\Log\Rotate', $msg, \OC_Log::WARN);
        }
 }