コード例 #1
0
 /**
  * Get file by identifier
  *
  * @param string $identifier
  * @return \TYPO3\CMS\Core\Resource\FileInterface
  */
 public function getFile($identifier)
 {
     return $this->driver->getFile($identifier);
 }
コード例 #2
0
 /**
  * Entry method for use as file list filter.
  *
  * We have to use -1 as the „don't include“ return value, as call_user_func() will return FALSE
  * if calling the method failed and thus we can't use that as a return value.
  *
  * @param string $itemName
  * @param string $itemIdentifier
  * @param string $parentIdentifier
  * @param array $additionalInformation Additional information about the inspected item
  * @param \TYPO3\CMS\Core\Resource\Driver\AbstractDriver $driver
  * @return boolean|integer -1 if the file should not be included in a listing
  */
 public function filterFileList($itemName, $itemIdentifier, $parentIdentifier, array $additionalInformation, \TYPO3\CMS\Core\Resource\Driver\AbstractDriver $driver)
 {
     $returnCode = TRUE;
     // Early return in case no file filters are set at all
     if ($this->allowedFileExtensions === NULL && $this->disallowedFileExtensions === NULL) {
         return $returnCode;
     }
     // Check that this is a file and not a folder
     if ($driver->fileExists($itemIdentifier)) {
         $file = $driver->getFile($itemIdentifier);
         if (!$this->isAllowed($file)) {
             $returnCode = -1;
         }
     }
     return $returnCode;
 }