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


PHP ResourceStorage::isPublic方法代码示例

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


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

示例1: capabilitiesOfStorageObjectAreCorrectlySet

 /**
  * @test
  * @dataProvider capabilitiesDataProvider
  * @TODO: Rewrite or move to functional suite
  */
 public function capabilitiesOfStorageObjectAreCorrectlySet(array $capabilities)
 {
     $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
     $storageRecord = array('is_public' => $capabilities['public'], 'is_writable' => $capabilities['writable'], 'is_browsable' => $capabilities['browsable'], 'is_online' => true);
     $mockedDriver = $this->createDriverMock(array('pathType' => 'relative', 'basePath' => 'fileadmin/'), $this->subject, null);
     $this->prepareSubject(array(), false, $mockedDriver, $storageRecord);
     $this->assertEquals($capabilities['public'], $this->subject->isPublic(), 'Capability "public" is not correctly set.');
     $this->assertEquals($capabilities['writable'], $this->subject->isWritable(), 'Capability "writable" is not correctly set.');
     $this->assertEquals($capabilities['browsable'], $this->subject->isBrowsable(), 'Capability "browsable" is not correctly set.');
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:15,代码来源:ResourceStorageTest.php

示例2: capabilitiesOfStorageObjectAreCorrectlySet

 /**
  * @test
  * @dataProvider capabilitiesDataProvider
  */
 public function capabilitiesOfStorageObjectAreCorrectlySet(array $capabilites)
 {
     $storageRecord = array('is_public' => $capabilites['public'], 'is_writable' => $capabilites['writable'], 'is_browsable' => $capabilites['browsable'], 'is_online' => TRUE);
     $mockedDriver = $this->createDriverMock(array(), $this->fixture, array('hasCapability'));
     $mockedDriver->expects($this->any())->method('hasCapability')->will($this->returnValue(TRUE));
     $this->prepareFixture(array(), FALSE, $mockedDriver, $storageRecord);
     $this->assertEquals($capabilites['public'], $this->fixture->isPublic(), 'Capability "public" is not correctly set.');
     $this->assertEquals($capabilites['writable'], $this->fixture->isWritable(), 'Capability "writable" is not correctly set.');
     $this->assertEquals($capabilites['browsable'], $this->fixture->isBrowsable(), 'Capability "browsable" is not correctly set.');
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:14,代码来源:ResourceStorageTest.php

示例3: 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


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