Пример #1
0
 /**
  * @param \TYPO3\CMS\Core\Resource\ResourceStorage $resourceStorage
  * @param \TYPO3\CMS\Core\Resource\Driver\DriverInterface $driver
  * @param \TYPO3\CMS\Core\Resource\ResourceInterface $resourceObject
  * @param boolean $relativeToCurrentScript
  * @param string $urlData
  */
 public function getCdnPublicUrl($resourceStorage, $driver, $resourceObject, $relativeToCurrentScript, $urlData)
 {
     if (!$driver instanceof LocalDriver || $this->environmentService->isEnvironmentInBackendMode()) {
         return;
     }
     if (($resourceObject instanceof File || $resourceObject instanceof ProcessedFile) && ($resourceStorage->getCapabilities() & ResourceStorageInterface::CAPABILITY_PUBLIC) == ResourceStorageInterface::CAPABILITY_PUBLIC) {
         $publicUrl = $driver->getPublicUrl($resourceObject->getIdentifier());
         $urlData['publicUrl'] = $GLOBALS['TSFE']->config['config']['cdnBaseUrl'] . $publicUrl;
         if ($resourceObject instanceof File) {
             $urlData['publicUrl'] .= '?' . $resourceObject->getModificationTime();
         } else {
             if ($resourceObject instanceof ProcessedFile) {
                 $urlData['publicUrl'] .= '?' . $resourceObject->getProperty('tstamp');
             }
         }
     }
 }