Example #1
0
 /**
  * Get own status
  * Returns warning if file not exists
  * Returns error if file exists but content is not as expected (can / shouldn't be fixed)
  *
  * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
  */
 public function getStatus()
 {
     $result = array();
     if (!$this->exists()) {
         $status = new Status\WarningStatus();
         $status->setTitle('File ' . $this->getRelativePathBelowSiteRoot() . ' does not exist');
         $status->setMessage('By using "Try to fix errors" we can try to create it');
         $result[] = $status;
     } else {
         $result = $this->getSelfStatus();
     }
     return $result;
 }
Example #2
0
 /**
  * Get own status and status of child objects
  *
  * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
  */
 public function getStatus()
 {
     $result = array();
     if (!$this->exists()) {
         $status = new Status\WarningStatus();
         $status->setTitle('Directory ' . $this->getRelativePathBelowSiteRoot() . ' does not exist');
         $status->setMessage('The Install Tool can try to create it');
         $result[] = $status;
     } else {
         $result = $this->getSelfStatus();
     }
     $result = array_merge($result, $this->getChildrenStatus());
     return $result;
 }
Example #3
0
 /**
  * Check if it is possible to download external data (e.g. TER)
  * Either allow_url_fopen must be enabled or curl must be used
  *
  * @return Status\OkStatus|Status\WarningStatus
  */
 protected function checkDownloadsPossible()
 {
     $allowUrlFopen = (bool) ini_get('allow_url_fopen');
     $curlEnabled = !empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlUse']);
     if ($allowUrlFopen || $curlEnabled) {
         $status = new Status\OkStatus();
         $status->setTitle('Fetching external URLs is allowed');
     } else {
         $status = new Status\WarningStatus();
         $status->setTitle('Fetching external URLs is not allowed');
         $status->setMessage('Either enable PHP runtime setting "allow_url_fopen"' . LF . 'or enable curl by setting [SYS][curlUse] accordingly.');
     }
     return $status;
 }
Example #4
0
 /**
  * Check if it is possible to download external data (e.g. TER)
  * Either allow_url_fopen must be enabled or curl must be used
  *
  * @return Status\OkStatus|Status\WarningStatus
  */
 protected function checkDownloadsPossible()
 {
     $allowUrlFopen = (bool) ini_get('allow_url_fopen');
     $curlEnabled = function_exists('curl_version');
     if ($allowUrlFopen || $curlEnabled) {
         $status = new Status\OkStatus();
         $status->setTitle('Fetching external URLs is allowed');
     } else {
         $status = new Status\WarningStatus();
         $status->setTitle('Fetching external URLs is not allowed');
         $status->setMessage('Either enable PHP runtime setting "allow_url_fopen"' . LF . 'or compile curl into your PHP with --with-curl.');
     }
     return $status;
 }
Example #5
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 #6
0
 /**
  * Check php magic quotes
  *
  * @return Status\StatusInterface
  */
 protected function checkPhpMagicQuotes()
 {
     $magicQuotesGpc = get_magic_quotes_gpc();
     if ($magicQuotesGpc) {
         $status = new Status\WarningStatus();
         $status->setTitle('PHP magic quotes on');
         $status->setMessage('magic_quotes_gpc=' . $magicQuotesGpc . LF . 'Setting magic_quotes_gpc is deprecated since PHP 5.3.' . ' You are advised to disable it until it is completely removed:' . LF . 'magic_quotes_gpc=Off');
     } else {
         $status = new Status\OkStatus();
         $status->setTitle('PHP magic quotes off');
     }
     return $status;
 }
Example #7
0
 /**
  * Checks thread stack size if on windows with apache
  *
  * @return Status\StatusInterface
  */
 protected function checkWindowsApacheThreadStackSize()
 {
     if ($this->isWindowsOs() && substr($_SERVER['SERVER_SOFTWARE'], 0, 6) === 'Apache') {
         $status = new Status\WarningStatus();
         $status->setTitle('Windows apache thread stack size');
         $status->setMessage('This current value cannot be checked by the system, so please ignore this warning if it' . ' is already taken care of: Fluid uses complex regular expressions which require a lot' . ' of stack space during the first processing.' . ' On Windows the default stack size for Apache is a lot smaller than on UNIX.' . ' You can increase the size to 8MB (default on UNIX) by adding the following configuration' . ' to httpd.conf and restarting Apache afterwards:' . LF . '<IfModule mpm_winnt_module>' . LF . 'ThreadStackSize 8388608' . LF . '</IfModule>');
     } else {
         $status = new Status\OkStatus();
         $status->setTitle('Apache ThreadStackSize is not an issue on UNIX systems');
     }
     return $status;
 }