/** * Warmup report before render */ public function warmupReport() { $dirIterator = new \DirectoryIterator($this->srcPath); $this->report = null; foreach ($dirIterator as $dir) { if (!$dir->isDot() && $dir->isFile()) { $reportPath = $dir->getPathname(); if ($this->isValidReport($reportPath)) { include_once $reportPath; $class = $this->getReportClass($reportPath); $this->report = new $class($this->dispatcher); $this->report->setStorage($this->storage); $logger = $this->logger; $logger->setStorage($this->storage); $this->report->setLogger($logger); $this->setTemplateEngine($this->report); $this->linkFolders($class); break; } } } if (null === $this->report) { throw new ReportNotFoundException('No valid report found in src folder (' . $this->srcPath . ')'); } $this->setupConnectors(); $this->setupParameters(); }