/** * To view the logged errors in a given path, specify the folder path of the folder containing * the logged errors. It is assumed that the filenames of the logged errors are in the format * of "qcodo_error_YYYY-MM-DD_hhhhmmss_X.html", where "X" is the microseconds * * Because this will cache a log.xml file in this directory, make sure this folder is writable * by the user of the process running this class. * @param string $strErrorLogPath absolute path to the folder containing error log files * @return QErrorLogViewer */ public function __construct($strErrorLogPath) { $this->strErrorLogPath = $strErrorLogPath; $this->strFileArray = QErrorLogViewer::GetFileArray($strErrorLogPath); sort($this->strFileArray); $this->strHash = md5(serialize($this->strFileArray)); if (!file_exists($this->GetLogXmlPath())) { $this->GenerateLogXml(); $this->objLogXml = new SimpleXMLElement(file_get_contents($this->GetLogXmlPath())); } else { $this->objLogXml = new SimpleXMLElement(file_get_contents($this->GetLogXmlPath())); if ((string) $this->objLogXml->hash != $this->strHash) { $this->GenerateLogXml(); $this->objLogXml = new SimpleXMLElement(file_get_contents($this->GetLogXmlPath())); } } }
protected function dtgErrors_Bind() { $objViewer = new QErrorLogViewer(__ERROR_LOG__); $this->dtgErrors->DataSource = $objViewer->GetAsDataSource(); }