當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ResourceFactory::getDefaultStorage方法代碼示例

本文整理匯總了PHP中TYPO3\CMS\Core\Resource\ResourceFactory::getDefaultStorage方法的典型用法代碼示例。如果您正苦於以下問題:PHP ResourceFactory::getDefaultStorage方法的具體用法?PHP ResourceFactory::getDefaultStorage怎麽用?PHP ResourceFactory::getDefaultStorage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TYPO3\CMS\Core\Resource\ResourceFactory的用法示例。


在下文中一共展示了ResourceFactory::getDefaultStorage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: downloadRegistrationsCsv

 /**
  * Initiates the CSV downloads for registrations of the given event uid
  *
  * @param int $eventUid EventUid
  * @param array $settings Settings
  *
  * @throws \RuntimeException RuntimeException
  * @return void
  */
 public function downloadRegistrationsCsv($eventUid, $settings = array())
 {
     $storage = $this->resourceFactory->getDefaultStorage();
     if ($storage === NULL) {
         throw new RuntimeException('Could not get the default storage', 1475590001);
     }
     $registrations = $this->exportRegistrationsCsv($eventUid, $settings);
     $tempFolder = $storage->getFolder('_temp_');
     $tempFile = $storage->createFile('sf_events_export.csv', $tempFolder);
     $tempFile->setContents($registrations);
     $storage->dumpFileContents($tempFile, TRUE, 'registrations_' . date('dmY_His') . '.csv');
 }
開發者ID:AlexPixelant,項目名稱:sf_event_mgt,代碼行數:21,代碼來源:ExportService.php

示例2: downloadiCalendarFile

 /**
  * Initiates the ICS download for the given event
  *
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Event $event The event
  *
  * @throws \RuntimeException Exception
  *
  * @return void
  */
 public function downloadiCalendarFile(\DERHANSEN\SfEventMgt\Domain\Model\Event $event)
 {
     $storage = $this->resourceFactory->getDefaultStorage();
     if ($storage === NULL) {
         throw new \RuntimeException('Could not get the default storage', 1475590001);
     }
     $icalContent = $this->getICalendarContent($event);
     $tempFolder = $storage->getFolder('_temp_');
     $tempFile = $storage->createFile('event.ics', $tempFolder);
     $tempFile->setContents($icalContent);
     $storage->dumpFileContents($tempFile, TRUE, 'event_' . $event->getUid() . '.ics');
 }
開發者ID:phathoang,項目名稱:sf_event_mgt,代碼行數:21,代碼來源:ICalendarService.php

示例3: getCategoryImageFolder

 /**
  * Get Category Image folder
  *
  * @return \TYPO3\CMS\Core\Resource\Folder|void
  * @throws \Exception
  */
 protected function getCategoryImageFolder()
 {
     if ($this->categoryImageFolder === null) {
         $storage = $this->resourceFactory->getDefaultStorage();
         if (!$storage) {
             throw new \Exception('No default storage set!');
         }
         try {
             $this->categoryImageFolder = $storage->getFolder(self::FOLDER_CATEGORY_IMAGES);
         } catch (\TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException $exception) {
             $this->categoryImageFolder = $storage->createFolder(self::FOLDER_CATEGORY_IMAGES);
         }
     }
     return $this->categoryImageFolder;
 }
開發者ID:kalypso63,項目名稱:news,代碼行數:21,代碼來源:class.ext_update.php


注:本文中的TYPO3\CMS\Core\Resource\ResourceFactory::getDefaultStorage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。