TYPO3 CMS  TYPO3_6-2
FalStatus.php
Go to the documentation of this file.
1 <?php
3 
18 
25 
31  public function getStatus() {
32  $statuses = array(
33  'MissingFiles' => $this->getMissingFilesStatus(),
34  'ContentAdapter' => $this->getContentAdapterStatus(),
35  );
36  return $statuses;
37  }
38 
44  protected function getMissingFilesStatus() {
45  $value = $GLOBALS['LANG']->getLL('status_none');
46  $count = 0;
47  $maxFilesToShow = 100;
48  $message = '';
50 
52  $storageRepository = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\StorageRepository');
53  $storageObjects = $storageRepository->findAll();
54  $storages = array();
55 
57  foreach ($storageObjects as $storageObject) {
58 
59  // We only check missing files for storages that are online
60  if ($storageObject->isOnline()) {
61  $storages[$storageObject->getUid()] = $storageObject;
62  }
63  }
64 
65  if (count($storages)) {
66  $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
67  '*',
68  'sys_file',
69  'missing=1 AND storage IN (' . implode(',', array_keys($storages)) . ')'
70  );
71  }
72 
73  if ($count) {
74  $value = sprintf($GLOBALS['LANG']->getLL('status_missingFilesCount'), $count);
76 
77  $files = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
78  'identifier,storage',
79  'sys_file',
80  'missing=1 AND storage IN (' . implode(',', array_keys($storages)) . ')',
81  '',
82  '',
83  $maxFilesToShow
84  );
85 
86  $message = '<p>' . $GLOBALS['LANG']->getLL('status_missingFilesMessage') . '</p>';
87  foreach ($files as $file) {
88  $message .= $storages[$file['storage']]->getName() . ' ' . $file['identifier'] . '<br />';
89  }
90 
91  if ($count > $maxFilesToShow) {
92  $message .= '...<br />';
93  }
94  }
95 
96  return GeneralUtility::makeInstance('TYPO3\\CMS\\Reports\\Status', $GLOBALS['LANG']->getLL('status_missingFiles'), $value, $message, $severity);
97  }
98 
104  protected function getContentAdapterStatus() {
105  $value = $GLOBALS['LANG']->getLL('status_disabled');
106  $message = '';
107  $severity = \TYPO3\CMS\Reports\Status::OK;
108  if ($GLOBALS['TYPO3_CONF_VARS']['FE']['activateContentAdapter']) {
109  $value = $GLOBALS['LANG']->getLL('status_enabled');
110  $message = '<p>' . $GLOBALS['LANG']->getLL('status_contentAdapterActiveMessage') . '</p>';
112  }
114  'TYPO3\\CMS\\Reports\\Status',
115  $GLOBALS['LANG']->getLL('status_contentAdapterActive'),
116  $value,
117  $message,
118  $severity
119  );
120 
121  }
122 }
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]