Exemplo n.º 1
0
 /**
  * @test
  */
 public function writeInformation()
 {
     $msg = tx_additionalreports_util::writeInformation('foo', 'bar');
     $this->assertTrue(!empty($msg));
 }
 /**
  * Generate the log error report
  *
  * @return string HTML code
  */
 public static function displayLogErrors()
 {
     // query
     $query = array();
     $query['SELECT'] = 'COUNT(*) AS "nb",details,MAX(tstamp) as "tstamp"';
     $query['FROM'] = 'sys_log';
     $query['WHERE'] = 'error>0';
     $query['GROUPBY'] = 'details';
     $query['ORDERBY'] = 'nb DESC,tstamp DESC';
     $query['LIMIT'] = '';
     $orderby = TYPO3\CMS\Core\Utility\GeneralUtility::_GP('orderby');
     if ($orderby !== null) {
         $query['ORDERBY'] = $orderby;
     }
     $content = tx_additionalreports_util::writeInformation(self::getLl('flushalllog'), 'DELETE FROM sys_log WHERE error>0;');
     $logErrors = array();
     $view = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $view->setTemplatePathAndFilename(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('additional_reports') . 'Resources/Private/Templates/logerrors-fluid.html');
     $view->assign('extconf', unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['additional_reports']));
     $view->assign('baseUrl', tx_additionalreports_util::getBaseUrl());
     $view->assign('requestDir', TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR'));
     $view->assign('query', $query);
     return $content . $view->render();
 }