/**
  * Render the path
  *
  * @param string $path
  * @return string
  */
 public function render($path = '')
 {
     if ($path == '') {
         $path = $this->renderChildren();
     }
     if (file_exists(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($path))) {
         return $this->fileSystemDiv->getFileRelFileName($path);
     } else {
         return sprintf('The given Path %s was not found', htmlspecialchars($path));
     }
 }
Exemple #2
0
 /**
  * Returns the public URL to a file.
  *
  * @param \TYPO3\CMS\Core\Resource\ResourceInterface $resource
  * @param bool  $relativeToCurrentScript    Determines whether the URL returned should be relative to the current script, in case it is relative at all (only for the LocalDriver)
  * @return string
  */
 public function getPublicUrl(\TYPO3\CMS\Core\Resource\ResourceInterface $resource, $relativeToCurrentScript = false)
 {
     if (\TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($resource->getIdentifier(), '/_processed_/')) {
         $publicUrl = '../typo3temp/yag' . $resource->getIdentifier();
         // TODO: ....!!!!
     } else {
         $item = $resource->getProperty('yagItem');
         if (!$item instanceof \Tx_Yag_Domain_Model_Item) {
             $pathInfo = new PathInfo($resource->getIdentifier());
             $item = $this->getItem($pathInfo);
         }
         $publicUrl = $this->yagFileSystemDiv->getFileRelFileName($item->getSourceuri());
     }
     if ($relativeToCurrentScript) {
         $publicUrl = PathUtility::getRelativePathTo(PathUtility::dirname(PATH_site . $publicUrl)) . PathUtility::basename($publicUrl);
     }
     return $publicUrl;
 }
 /**
  * Expand the EXT to a relative path
  * 
  * @param string $filename
  * @return string
  * @deprecated Use Tx_Yag_Domain_FileSystem_Div::getFileRelFileName instead
  */
 public function getFileRelFileName($filename)
 {
     return $this->fileSystemDiv->getFileRelFileName($filename);
 }