コード例 #1
0
 /**
  * Constructor for a storage object.
  *
  * @param \TYPO3\CMS\Core\Resource\Driver\AbstractDriver $driver
  * @param array $storageRecord The storage record row from the database
  */
 public function __construct(\TYPO3\CMS\Core\Resource\Driver\AbstractDriver $driver, array $storageRecord)
 {
     $this->storageRecord = $storageRecord;
     $this->configuration = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->convertFlexFormDataToConfigurationArray($storageRecord['configuration']);
     $this->driver = $driver;
     $this->driver->setStorage($this);
     try {
         $this->driver->processConfiguration();
     } catch (\TYPO3\CMS\Core\Resource\Exception\InvalidConfigurationException $e) {
         // configuration error
         // mark this storage as permanently unusable
         $this->markAsPermanentlyOffline();
     }
     $this->driver->initialize();
     $this->capabilities = ($this->storageRecord['is_browsable'] && $this->driver->hasCapability(self::CAPABILITY_BROWSABLE) ? self::CAPABILITY_BROWSABLE : 0) + ($this->storageRecord['is_public'] && $this->driver->hasCapability(self::CAPABILITY_PUBLIC) ? self::CAPABILITY_PUBLIC : 0) + ($this->storageRecord['is_writable'] && $this->driver->hasCapability(self::CAPABILITY_WRITABLE) ? self::CAPABILITY_WRITABLE : 0);
     // TODO do not set the "public" capability if no public URIs can be generated
     $this->processConfiguration();
     $this->resetFileAndFolderNameFiltersToDefault();
 }