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


PHP Folder::getHashedIdentifier方法代码示例

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


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

示例1: categoryAction

 /**
  * The selected Folder gets identified by its first file,
  * because folders don't have UIDs and the identifier contains slashes
  * which must not be GET params
  *
  * @param File $image
  * @param File $listFolder
  * @param File $categoryFolder
  * @param int $categoryPage
  * @param int $listPage
  * @return string
  */
 public function categoryAction(File $image = null, File $listFolder = null, File $categoryFolder = null, $categoryPage = 1, $listPage = 1)
 {
     if ($this->configurationInvalid) {
         return $this->getErrorMessageForActionName('Category');
     }
     $this->view->assign('currentCategoryFolder', $categoryFolder);
     $this->view->assign('currentListFolder', $listFolder);
     $this->view->assign('currentListPage', $listPage);
     $this->view->assign('currentImage', $image);
     $itemsToPaginate = null;
     if ($categoryFolder !== null) {
         /** @var Folder $parentFolder */
         $parentFolder = $categoryFolder->getParentFolder();
         if ($this->folderIsInsideSelectedStorage($parentFolder)) {
             /** @var Folder $folderUpwards */
             $folderUpwards = $parentFolder->getParentFolder();
             $itemsToPaginate = $this->getSubFoldersWithImage($parentFolder);
             if ($this->folderIsInsideSelectedStorage($folderUpwards)) {
                 if ($folderUpwards->getHashedIdentifier() === $this->selectedFolder->getHashedIdentifier()) {
                     $this->view->assign('upwardsIsSelectedFolder', true);
                 } else {
                     $this->view->assign('parentFolderImage', $this->getFolderImage($folderUpwards));
                 }
             }
         }
     }
     if ($itemsToPaginate === null) {
         $itemsToPaginate = $this->getSubFoldersWithImage($this->selectedFolder);
     }
     $this->assignPaginationParams($itemsToPaginate, $categoryPage);
 }
开发者ID:vertexvaar,项目名称:fal_gallery,代码行数:43,代码来源:GalleryController.php

示例2: getFolderRecord

    /**
     * Get folder configuration record
     *
     * @param Folder $folder
     * @return array
     */
    public function getFolderRecord(Folder $folder)
    {
        if (!isset(self::$folderRecordCache[$folder->getCombinedIdentifier()]) || !array_key_exists($folder->getCombinedIdentifier(), self::$folderRecordCache)) {
            $record = $this->getDatabase()->exec_SELECTgetSingleRow('*', 'tx_falsecuredownload_folder', 'storage = ' . (int) $folder->getStorage()->getUid() . '
				AND folder_hash = ' . $this->getDatabase()->fullQuoteStr($folder->getHashedIdentifier(), 'tx_falsecuredownload_folder'));
            // cache results
            self::$folderRecordCache[$folder->getCombinedIdentifier()] = $record;
        }
        return self::$folderRecordCache[$folder->getCombinedIdentifier()];
    }
开发者ID:s-nunez,项目名称:fal_securedownload,代码行数:16,代码来源:Utility.php

示例3: findExistingFileByOnlineMediaId

 /**
  * Search for files with same onlineMediaId by content hash in indexed storage
  *
  * @param string $onlineMediaId
  * @param Folder $targetFolder
  * @param string $fileExtension
  * @return File|NULL
  */
 protected function findExistingFileByOnlineMediaId($onlineMediaId, Folder $targetFolder, $fileExtension)
 {
     $file = null;
     $fileHash = sha1($onlineMediaId);
     $files = $this->getFileIndexRepository()->findByContentHash($fileHash);
     if (!empty($files)) {
         foreach ($files as $fileIndexEntry) {
             if ($fileIndexEntry['folder_hash'] === $targetFolder->getHashedIdentifier() && (int) $fileIndexEntry['storage'] === $targetFolder->getStorage()->getUid() && $fileIndexEntry['extension'] === $fileExtension) {
                 $file = $this->getResourceFactory()->getFileObject($fileIndexEntry['uid'], $fileIndexEntry);
                 break;
             }
         }
     }
     return $file;
 }
开发者ID:vip3out,项目名称:TYPO3.CMS,代码行数:23,代码来源:AbstractOnlineMediaHelper.php

示例4: findByFolder

 /**
  * Find all records for files in a Folder
  *
  * @param \TYPO3\CMS\Core\Resource\Folder $folder
  * @return array|NULL
  */
 public function findByFolder(\TYPO3\CMS\Core\Resource\Folder $folder)
 {
     $resultRows = $this->getDatabaseConnection()->exec_SELECTgetRows(implode(',', $this->fields), $this->table, 'folder_hash = ' . $this->getDatabaseConnection()->fullQuoteStr($folder->getHashedIdentifier(), $this->table) . ' AND storage  = ' . (int) $folder->getStorage()->getUid(), '', '', '', 'identifier');
     return $resultRows;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:11,代码来源:FileIndexRepository.php

示例5: checkFolderRootLineAccess

 /**
  * Check if given FeGroups have enough rights to access given folder
  *
  * @param Folder $folder
  * @param bool|array $userFeGroups FALSE = no login, array() is the groups of the user
  * @return bool
  */
 public function checkFolderRootLineAccess(Folder $folder, $userFeGroups)
 {
     $cacheIdentifier = sha1($folder->getHashedIdentifier() . serialize($userFeGroups));
     if (!isset($this->checkFolderRootLineAccessCache[$cacheIdentifier])) {
         $this->checkFolderRootLineAccessCache[$cacheIdentifier] = true;
         // loop trough the root line of an folder and check the permissions of every folder
         foreach ($this->getFolderRootLine($folder) as $folder) {
             // fetch folder permissions record
             $folderRecord = $this->utilityService->getFolderRecord($folder);
             // if record found check permissions
             if ($folderRecord) {
                 if (!$this->matchFeGroupsWithFeUser($folderRecord['fe_groups'], $userFeGroups)) {
                     $this->checkFolderRootLineAccessCache[$cacheIdentifier] = false;
                     break;
                 }
             }
         }
     }
     return $this->checkFolderRootLineAccessCache[$cacheIdentifier];
 }
开发者ID:s-nunez,项目名称:fal_securedownload,代码行数:27,代码来源:CheckPermissions.php

示例6: postFolderRename

 /**
  * Update folder permissions records when a folder is renamed
  *
  * @param Folder $folder
  * @param string $newName
  */
 public function postFolderRename(Folder $folder, $newName)
 {
     $newFolder = $folder->getParentFolder()->getSubfolder($newName);
     $oldStorageUid = $folder->getStorage()->getUid();
     $newStorageUid = $newFolder->getStorage()->getUid();
     $this->utilityService->updateFolderRecord($oldStorageUid, $folder->getHashedIdentifier(), $folder->getIdentifier(), array('storage' => $newStorageUid, 'folder_hash' => $newFolder->getHashedIdentifier(), 'folder' => $newFolder->getIdentifier()));
     if (!empty($this->folderMapping[$folder->getCombinedIdentifier()])) {
         $newMapping = $this->getSubFolderIdentifiers($newFolder);
         foreach ($this->folderMapping[$folder->getCombinedIdentifier()] as $key => $folderInfo) {
             $this->utilityService->updateFolderRecord($oldStorageUid, $folderInfo[0], $folderInfo[1], array('storage' => $newStorageUid, 'folder_hash' => $newMapping[$key][0], 'folder' => $newMapping[$key][1]));
         }
     }
 }
开发者ID:camrun91,项目名称:fal_securedownload,代码行数:19,代码来源:FolderChangedSlot.php


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