protected function createCustomRenderer()
{
if ($this->reportFormat !== '') {
if (class_exists($this->reportFormat)) {
return new $this->reportFormat();
}
// Try to load a custom renderer
$fileName = strtr($this->reportFormat, '_', '/') . '.php';
$fileHandle = @fopen($fileName, 'r', true);
if (is_resource($fileHandle) === false) {
$message = 'Can\'t find the custom report class: ' . $this->reportFormat;
throw new \InvalidArgumentException($message, self::INPUT_ERROR);
}
@fclose($fileHandle);
include_once $fileName;
return new $this->reportFormat();
}
$message = 'Can\'t create report with format of ' . $this->reportFormat;
throw new \InvalidArgumentException($message, self::INPUT_ERROR);
}