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


PHP StorageConfig::getPriority方法代码示例

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


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

示例1: addStorage

 /**
  * Add new storage to the configuration
  *
  * @param StorageConfig $newStorage storage attributes
  *
  * @return StorageConfig storage config, with added id
  */
 public function addStorage(StorageConfig $newStorage)
 {
     $allStorages = $this->readConfig();
     $configId = $this->dbConfig->addMount($newStorage->getMountPoint(), $newStorage->getBackend()->getIdentifier(), $newStorage->getAuthMechanism()->getIdentifier(), $newStorage->getPriority(), $this->getType());
     $newStorage->setId($configId);
     foreach ($newStorage->getApplicableUsers() as $user) {
         $this->dbConfig->addApplicable($configId, DBConfigService::APPLICABLE_TYPE_USER, $user);
     }
     foreach ($newStorage->getApplicableGroups() as $group) {
         $this->dbConfig->addApplicable($configId, DBConfigService::APPLICABLE_TYPE_GROUP, $group);
     }
     foreach ($newStorage->getBackendOptions() as $key => $value) {
         $this->dbConfig->setConfig($configId, $key, $value);
     }
     foreach ($newStorage->getMountOptions() as $key => $value) {
         $this->dbConfig->setOption($configId, $key, $value);
     }
     if (count($newStorage->getApplicableUsers()) === 0 && count($newStorage->getApplicableGroups()) === 0) {
         $this->dbConfig->addApplicable($configId, DBConfigService::APPLICABLE_TYPE_GLOBAL, null);
     }
     // add new storage
     $allStorages[$configId] = $newStorage;
     $this->triggerHooks($newStorage, Filesystem::signal_create_mount);
     $newStorage->setStatus(StorageNotAvailableException::STATUS_SUCCESS);
     return $newStorage;
 }
开发者ID:loulancn,项目名称:core,代码行数:33,代码来源:storagesservice.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: 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


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