当前位置: 首页>>代码示例>>PHP>>正文


PHP FileInterface::getUid方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Resource\FileInterface::getUid方法的典型用法代码示例。如果您正苦于以下问题:PHP FileInterface::getUid方法的具体用法?PHP FileInterface::getUid怎么用?PHP FileInterface::getUid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Resource\FileInterface的用法示例。


在下文中一共展示了FileInterface::getUid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 /**
  * Create a link to a file that forces a download
  *
  * @param \TYPO3\CMS\Core\Resource\FileInterface $file
  * @param bool $uriOnly
  * @return string
  */
 public function render(\TYPO3\CMS\Core\Resource\FileInterface $file, $uriOnly = FALSE)
 {
     $queryParameterArray = array('eID' => 'dumpFile', 't' => '');
     if ($file instanceof \TYPO3\CMS\Core\Resource\File) {
         $queryParameterArray['f'] = $file->getUid();
         $queryParameterArray['t'] = 'f';
     } elseif ($file instanceof \TYPO3\CMS\Core\Resource\ProcessedFile) {
         $queryParameterArray['p'] = $file->getUid();
         $queryParameterArray['t'] = 'p';
     }
     $queryParameterArray['token'] = \TYPO3\CMS\Core\Utility\GeneralUtility::hmac(implode('|', $queryParameterArray), 'resourceStorageDumpFile');
     $queryParameterArray['download'] = '';
     $uri = 'index.php?' . str_replace('+', '%20', http_build_query($queryParameterArray));
     // Add absRefPrefix
     if (!empty($GLOBALS['TSFE'])) {
         $uri = $GLOBALS['TSFE']->absRefPrefix . $uri;
     }
     if ($uriOnly) {
         return $uri;
     }
     $this->tag->addAttribute('href', $uri);
     $this->tag->setContent($this->renderChildren());
     $this->tag->forceClosingTag(TRUE);
     return $this->tag->render();
 }
开发者ID:camrun91,项目名称:fal_securedownload,代码行数:32,代码来源:DownloadLinkViewHelper.php

示例2: generatePublicUrl

 /**
  * Generate public url for file
  *
  * @param Resource\ResourceStorage $storage
  * @param Resource\Driver\DriverInterface $driver
  * @param Resource\FileInterface $file
  * @param $relativeToCurrentScript
  * @param array $urlData
  * @return void
  */
 public function generatePublicUrl(Resource\ResourceStorage $storage, Resource\Driver\DriverInterface $driver, Resource\FileInterface $file, $relativeToCurrentScript, array $urlData)
 {
     // We only render special links for non-public files
     if ($this->enabled && !$storage->isPublic()) {
         $queryParameterArray = array('eID' => 'dumpFile', 't' => '');
         if ($file instanceof Resource\File) {
             $queryParameterArray['f'] = $file->getUid();
             $queryParameterArray['t'] = 'f';
         } elseif ($file instanceof Resource\ProcessedFile) {
             $queryParameterArray['p'] = $file->getUid();
             $queryParameterArray['t'] = 'p';
         }
         $queryParameterArray['token'] = GeneralUtility::hmac(implode('|', $queryParameterArray), 'BeResourceStorageDumpFile');
         // $urlData['publicUrl'] is passed by reference, so we can change that here and the value will be taken into account
         $urlData['publicUrl'] = BackendUtility::getAjaxUrl('FalSecuredownload::publicUrl', $queryParameterArray);
     }
 }
开发者ID:camrun91,项目名称:fal_securedownload,代码行数:27,代码来源:PublicUrlAspect.php

示例3: populateMetadata

 public function populateMetadata(\TYPO3\CMS\Core\Resource\FileInterface $file, \TYPO3\CMS\Core\Resource\Folder $folder)
 {
     $qualities = GeneralUtility::makeInstance(CalculateService::class)->quality($file->getUid());
     $message = '';
     foreach ($qualities as $key => $value) {
         $message .= $key . ' => ' . $value . "\n";
     }
     $this->flash($message);
 }
开发者ID:ksjogo,项目名称:typo3-ext-semantic-images,代码行数:9,代码来源:FileUpload.php

示例4: findOneByOriginalFileAndTaskTypeAndConfiguration

 /**
  * @param \TYPO3\CMS\Core\Resource\File|\TYPO3\CMS\Core\Resource\FileInterface $file
  * @param string $taskType The task that should be executed on the file
  * @param array $configuration
  *
  * @return ProcessedFile
  */
 public function findOneByOriginalFileAndTaskTypeAndConfiguration(FileInterface $file, $taskType, array $configuration)
 {
     $databaseRow = $this->databaseConnection->exec_SELECTgetSingleRow('*', $this->table, 'original=' . (int) $file->getUid() . ' AND task_type=' . $this->databaseConnection->fullQuoteStr($taskType, $this->table) . ' AND configurationsha1=' . $this->databaseConnection->fullQuoteStr(sha1(serialize($configuration)), $this->table));
     if (is_array($databaseRow)) {
         $processedFile = $this->createDomainObject($databaseRow);
     } else {
         $processedFile = $this->createNewProcessedFileObject($file, $taskType, $configuration);
     }
     return $processedFile;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:17,代码来源:ProcessedFileRepository.php


注:本文中的TYPO3\CMS\Core\Resource\FileInterface::getUid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。