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


PHP StorageConfig::getBackendOptions方法代码示例

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


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

示例1: constructStorage

 /**
  * Construct the storage implementation
  *
  * @param StorageConfig $storageConfig
  * @return Storage
  */
 private function constructStorage(StorageConfig $storageConfig)
 {
     $class = $storageConfig->getBackend()->getStorageClass();
     $storage = new $class($storageConfig->getBackendOptions());
     // auth mechanism should fire first
     $storage = $storageConfig->getBackend()->wrapStorage($storage);
     $storage = $storageConfig->getAuthMechanism()->wrapStorage($storage);
     return $storage;
 }
开发者ID:GrumpyCrouton,项目名称:core,代码行数:15,代码来源:configadapter.php

示例2: prepareMountPointEntry

 /**
  * Convert a StorageConfig to the legacy mountPoints array format
  * There's a lot of extra information in here, to satisfy all of the legacy functions
  *
  * @param StorageConfig $storage
  * @param bool $isPersonal
  * @return array
  */
 private static function prepareMountPointEntry(StorageConfig $storage, $isPersonal)
 {
     $mountEntry = [];
     $mountEntry['mountpoint'] = substr($storage->getMountPoint(), 1);
     // remove leading slash
     $mountEntry['class'] = $storage->getBackend()->getIdentifier();
     $mountEntry['backend'] = $storage->getBackend()->getText();
     $mountEntry['authMechanism'] = $storage->getAuthMechanism()->getIdentifier();
     $mountEntry['personal'] = $isPersonal;
     $mountEntry['options'] = self::decryptPasswords($storage->getBackendOptions());
     $mountEntry['mountOptions'] = $storage->getMountOptions();
     $mountEntry['priority'] = $storage->getPriority();
     $mountEntry['applicable'] = ['groups' => $storage->getApplicableGroups(), 'users' => $storage->getApplicableUsers()];
     // if mountpoint is applicable to all users the old API expects ['all']
     if (empty($mountEntry['applicable']['groups']) && empty($mountEntry['applicable']['users'])) {
         $mountEntry['applicable']['users'] = ['all'];
     }
     $mountEntry['id'] = $storage->getId();
     return $mountEntry;
 }
开发者ID:DaubaKao,项目名称:owncloud-core,代码行数:28,代码来源:config.php

示例3: getRustyStorageIdFromConfig

 /**
  * Returns the rusty storage id from oc_storages from the given storage config.
  *
  * @param StorageConfig $storageConfig
  * @return string rusty storage id
  */
 private function getRustyStorageIdFromConfig(StorageConfig $storageConfig)
 {
     // if any of the storage options contains $user, it is not possible
     // to compute the possible storage id as we don't know which users
     // mounted it already (and we certainly don't want to iterate over ALL users)
     foreach ($storageConfig->getBackendOptions() as $value) {
         if (strpos($value, '$user') !== false) {
             throw new \Exception('Cannot compute storage id for deletion due to $user vars in the configuration');
         }
     }
     // note: similar to ConfigAdapter->prepateStorageConfig()
     $storageConfig->getAuthMechanism()->manipulateStorageConfig($storageConfig);
     $storageConfig->getBackend()->manipulateStorageConfig($storageConfig);
     $class = $storageConfig->getBackend()->getStorageClass();
     $storageImpl = new $class($storageConfig->getBackendOptions());
     return $storageImpl->getId();
 }
开发者ID:loulancn,项目名称:core,代码行数:23,代码来源:storagesservice.php

示例4: getStorageId

 /**
  * Construct the storage implementation
  *
  * @param StorageConfig $storageConfig
  * @return int
  */
 private function getStorageId(StorageConfig $storageConfig)
 {
     try {
         $class = $storageConfig->getBackend()->getStorageClass();
         /** @var \OC\Files\Storage\Storage $storage */
         $storage = new $class($storageConfig->getBackendOptions());
         // auth mechanism should fire first
         $storage = $storageConfig->getBackend()->wrapStorage($storage);
         $storage = $storageConfig->getAuthMechanism()->wrapStorage($storage);
         return $storage->getStorageCache()->getNumericId();
     } catch (\Exception $e) {
         return -1;
     }
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:20,代码来源:storagesservice.php

示例5: updateStorageStatus

 /**
  * Check whether the given storage is available / valid.
  *
  * Note that this operation can be time consuming depending
  * on whether the remote storage is available or not.
  *
  * @param StorageConfig $storage storage configuration
  */
 protected function updateStorageStatus(StorageConfig &$storage)
 {
     // update status (can be time-consuming)
     $storage->setStatus(\OC_Mount_Config::getBackendStatus($storage->getBackendClass(), $storage->getBackendOptions(), false));
 }
开发者ID:samj1912,项目名称:repo,代码行数:13,代码来源:storagescontroller.php

示例6: prepareMountPointEntry

 /**
  * Convert a StorageConfig to the legacy mountPoints array format
  * There's a lot of extra information in here, to satisfy all of the legacy functions
  *
  * @param StorageConfig $storage
  * @param bool $isPersonal
  * @return array
  */
 private static function prepareMountPointEntry(StorageConfig $storage, $isPersonal)
 {
     $mountEntry = [];
     $mountEntry['mountpoint'] = substr($storage->getMountPoint(), 1);
     // remove leading slash
     $mountEntry['class'] = $storage->getBackend()->getIdentifier();
     $mountEntry['backend'] = $storage->getBackend()->getText();
     $mountEntry['authMechanism'] = $storage->getAuthMechanism()->getIdentifier();
     $mountEntry['personal'] = $isPersonal;
     $mountEntry['options'] = self::decryptPasswords($storage->getBackendOptions());
     $mountEntry['mountOptions'] = $storage->getMountOptions();
     $mountEntry['priority'] = $storage->getPriority();
     $mountEntry['applicable'] = ['groups' => $storage->getApplicableGroups(), 'users' => $storage->getApplicableUsers()];
     $mountEntry['id'] = $storage->getId();
     // $mountEntry['storage_id'] = null; // we don't store this!
     return $mountEntry;
 }
开发者ID:GrumpyCrouton,项目名称:core,代码行数:25,代码来源:config.php

示例7: validateStorageDefinition

 /**
  * Check if parameters are satisfied in a StorageConfig
  *
  * @param StorageConfig $storage
  * @return bool
  */
 public function validateStorageDefinition(StorageConfig $storage)
 {
     $options = $storage->getBackendOptions();
     foreach ($this->getParameters() as $name => $parameter) {
         $value = isset($options[$name]) ? $options[$name] : null;
         if (!$parameter->validateValue($value)) {
             return false;
         }
     }
     return true;
 }
开发者ID:GrumpyCrouton,项目名称:core,代码行数:17,代码来源:frontenddefinitiontrait.php


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