Example #1
0
 /**
  * @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);
     }
 }
Example #2
0
 /**
  * @param QueryBuilder $qb
  *
  * @throws WebServerLogException
  *
  * @return string
  */
 private function getEntityAlias(QueryBuilder $qb)
 {
     $aliases = $qb->getRootAliases();
     if (count($aliases) !== 1) {
         throw WebServerLogException::invalidQbAlias();
     }
     return array_shift($aliases);
 }