TYPO3 CMS  TYPO3_6-2
SyslogCommand.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Lowlevel;
3 
23 
29  public function __construct() {
30  parent::__construct();
31  $this->cli_help['name'] = 'syslog -- Show entries from syslog';
32  $this->cli_help['description'] = trim('
33 Showing last 25 hour entries from the syslog. More features pending. This is the most basic and can be useful for nightly check test reports.
34 ');
35  $this->cli_help['examples'] = '';
36  }
37 
44  public function main() {
45  global $TYPO3_DB;
46  // Initialize result array:
47  $resultArray = array(
48  'message' => $this->cli_help['name'] . LF . LF . $this->cli_help['description'],
49  'headers' => array(
50  'listing' => array('', '', 1),
51  'allDetails' => array('', '', 0)
52  ),
53  'listing' => array(),
54  'allDetails' => array()
55  );
56  $rows = $TYPO3_DB->exec_SELECTgetRows('*', 'sys_log', 'tstamp>' . ($GLOBALS['EXEC_TIME'] - 25 * 3600));
57  foreach ($rows as $r) {
58  $l = unserialize($r['log_data']);
59  $explained = '#' . $r['uid'] . ' ' . \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($r['tstamp']) . ' USER[' . $r['userid'] . ']: ' . sprintf($r['details'], $l[0], $l[1], $l[2], $l[3], $l[4], $l[5]);
60  $resultArray['listing'][$r['uid']] = $explained;
61  $resultArray['allDetails'][$r['uid']] = array($explained, \TYPO3\CMS\Core\Utility\GeneralUtility::arrayToLogString($r, 'uid,userid,action,recuid,tablename,recpid,error,tstamp,type,details_nr,IP,event_pid,NEWid,workspace'));
62  }
63  return $resultArray;
64  }
65 
74  public function main_autoFix($resultArray) {
75 
76  }
77 
78 }
static arrayToLogString(array $arr, $valueList=array(), $valueLength=20)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]