‪TYPO3CMS  10.4
FileLinktype.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
22 
27 {
36  public function ‪fetchType($value, $type, $key)
37  {
38  if (strpos(strtolower($value['tokenValue']), 'file:') === 0) {
39  $type = 'file';
40  }
41  return $type;
42  }
43 
52  public function ‪checkLink($url, $softRefEntry, $reference)
53  {
54  $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
55  try {
56  $file = $resourceFactory->retrieveFileOrFolderObject($url);
58  return false;
59  }
60 
61  return ($file !== null) ? !$file->isMissing() : false;
62  }
63 
71  {
72  return $this->‪getLanguageService()->‪getLL('list.report.filenotexisting');
73  }
74 
81  public function ‪getBrokenUrl($row)
82  {
83  return GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $row['url'];
84  }
85 }
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\$errorParams
‪array $errorParams
Definition: AbstractLinktype.php:29
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\getLanguageService
‪LanguageService getLanguageService()
Definition: AbstractLinktype.php:92
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype\getErrorMessage
‪string getErrorMessage($errorParams)
Definition: FileLinktype.php:70
‪TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException
Definition: FileDoesNotExistException.php:22
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype
Definition: AbstractLinktype.php:24
‪TYPO3\CMS\Linkvalidator\Linktype
Definition: AbstractLinktype.php:16
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype
Definition: FileLinktype.php:27
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:41
‪TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException
Definition: FolderDoesNotExistException.php:22
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype\fetchType
‪string fetchType($value, $type, $key)
Definition: FileLinktype.php:36
‪TYPO3\CMS\Core\Localization\LanguageService\getLL
‪string getLL($index)
Definition: LanguageService.php:154
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype\getBrokenUrl
‪string getBrokenUrl($row)
Definition: FileLinktype.php:81
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype\checkLink
‪bool checkLink($url, $softRefEntry, $reference)
Definition: FileLinktype.php:52