コード例 #1
0
ファイル: Reader.php プロジェクト: warlock39/webserverlog
 /**
  * @param \SplFileInfo|string $file
  * @return bool
  * @throws WebServerLogException
  * TODO one of cases that produces PHP segfault (php bug)
  */
 private function assertValidFile($file)
 {
     if (!$file instanceof \SplFileInfo) {
         $file = new \SplFileInfo($file);
     }
     if ($file->getExtension() !== 'log') {
         throw WebServerLogException::notLogFile($file);
     }
     if (!$file->isReadable()) {
         throw WebServerLogException::notReadable($file);
     }
 }