Example #1
0
 /**
  * Get own status
  * Returns information status if running on Windows
  * Returns OK status if is link and possible target is correct
  * Else returns error (not fixable)
  *
  * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
  */
 public function getStatus()
 {
     if ($this->isWindowsOs()) {
         $status = new Status\InfoStatus();
         $status->setTitle($this->getRelativePathBelowSiteRoot() . ' should be a link, but this support is incomplete for Windows.');
         $status->setMessage('This node is not handled for Windows OS and should be checked manually.');
         return [$status];
     }
     if (!$this->exists()) {
         $status = new Status\ErrorStatus();
         $status->setTitle($this->getRelativePathBelowSiteRoot() . ' should be a link, but it does not exist');
         $status->setMessage('Links cannot be fixed by this system');
         return [$status];
     }
     if (!$this->isLink()) {
         $status = new Status\WarningStatus();
         $status->setTitle('Path ' . $this->getRelativePathBelowSiteRoot() . ' is not a link');
         $type = @filetype($this->getAbsolutePath());
         if ($type) {
             $status->setMessage('The target ' . $this->getRelativePathBelowSiteRoot() . ' should be a link,' . ' but is of type ' . $type . '. This cannot be fixed automatically. Please investigate.');
         } else {
             $status->setMessage('The target ' . $this->getRelativePathBelowSiteRoot() . ' should be a file,' . ' but is of unknown type, probably because an upper level directory does not exist. Please investigate.');
         }
         return [$status];
     }
     if (!$this->isTargetCorrect()) {
         $status = new Status\ErrorStatus();
         $status->setTitle($this->getRelativePathBelowSiteRoot() . ' is a link, but link target is not as specified');
         $status->setMessage('Link target should be ' . $this->getTarget() . ' but is ' . $this->getCurrentTarget());
         return [$status];
     }
     $status = new Status\OkStatus();
     $message = 'Is a link';
     if ($this->getTarget() !== '') {
         $message .= ' and correctly points to target ' . $this->getTarget();
     }
     $status->setTitle($this->getRelativePathBelowSiteRoot());
     $status->setMessage($message);
     return [$status];
 }
Example #2
0
 /**
  * Check if systemLocale setting is correct (locale exists in the OS)
  *
  * @return Status\StatusInterface
  */
 protected function checkSystemLocale()
 {
     $currentLocale = setlocale(LC_CTYPE, 0);
     // On Windows an empty locale value uses the regional settings from the Control Panel
     if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale'] === '' && TYPO3_OS !== 'WIN') {
         $status = new Status\InfoStatus();
         $status->setTitle('Empty systemLocale setting');
         $status->setMessage('$GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale] is not set. This is fine as long as no UTF-8' . ' file system is used.');
     } elseif (setlocale(LC_CTYPE, $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale']) === FALSE) {
         $status = new Status\ErrorStatus();
         $status->setTitle('Incorrect systemLocale setting');
         $status->setMessage('Current value of the $GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale] is incorrect. A locale with' . ' this name doesn\'t exist in the operating system.');
         setlocale(LC_CTYPE, $currentLocale);
     } else {
         $status = new Status\OkStatus();
         $status->setTitle('System locale is correct');
     }
     return $status;
 }
Example #3
0
 /**
  * Check suhosin.executor.include.whitelist contains vfs
  *
  * @return Status\StatusInterface
  */
 protected function checkSuhosinExecutorIncludeWhiteListContainsVfs()
 {
     if ($this->isSuhosinLoadedAndActive()) {
         $whitelist = (string) ini_get('suhosin.executor.include.whitelist');
         if (strpos($whitelist, 'vfs') === false) {
             $status = new Status\WarningStatus();
             $status->setTitle('PHP suhosin.executor.include.whitelist does not contain vfs');
             $status->setMessage('suhosin.executor.include.whitelist= ' . $whitelist . LF . '"vfs" is currently not a hard requirement of TYPO3 CMS but tons of unit tests rely on it.' . ' Furthermore, vfs will likely be a base for an additional compatibility layer in the future.' . ' A useful setting is:' . LF . 'suhosin.executor.include.whitelist=phar,vfs');
         } else {
             $status = new Status\OkStatus();
             $status->setTitle('PHP suhosin.executor.include.whitelist contains vfs');
         }
     } else {
         $status = new Status\InfoStatus();
         $status->setTitle('Suhosin not loaded');
         $status->setMessage('If enabling suhosin, a useful setting is:' . LF . 'suhosin.executor.include.whitelist=phar,vfs');
     }
     return $status;
 }