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


PHP StorageConfig::setBackendOption方法代碼示例

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


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

示例1: manipulateStorageConfig

 public function manipulateStorageConfig(StorageConfig &$storage)
 {
     $encrypted = $this->session->get('password::sessioncredentials/credentials');
     if (!isset($encrypted)) {
         throw new InsufficientDataForMeaningfulAnswerException('No session credentials saved');
     }
     $credentials = json_decode($this->crypto->decrypt($encrypted), true);
     $storage->setBackendOption('user', $this->session->get('loginname'));
     $storage->setBackendOption('password', $credentials['password']);
 }
開發者ID:kenwi,項目名稱:core,代碼行數:10,代碼來源:sessioncredentials.php

示例2: manipulateStorageConfig

 public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null)
 {
     if (!isset($user)) {
         throw new InsufficientDataForMeaningfulAnswerException('No login credentials saved');
     }
     $uid = $user->getUID();
     $credentials = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
     if (!isset($credentials)) {
         throw new InsufficientDataForMeaningfulAnswerException('No login credentials saved');
     }
     $storage->setBackendOption('user', $credentials['user']);
     $storage->setBackendOption('password', $credentials['password']);
 }
開發者ID:farukuzun,項目名稱:core-1,代碼行數:13,代碼來源:logincredentials.php

示例3: prepareStorageConfig

 /**
  * Process storage ready for mounting
  *
  * @param StorageConfig $storage
  * @param IUser $user
  */
 private function prepareStorageConfig(StorageConfig &$storage, IUser $user)
 {
     foreach ($storage->getBackendOptions() as $option => $value) {
         $storage->setBackendOption($option, \OC_Mount_Config::setUserVars($user->getUID(), $value));
     }
     $objectStore = $storage->getBackendOption('objectstore');
     if ($objectStore) {
         $objectClass = $objectStore['class'];
         $storage->setBackendOption('objectstore', new $objectClass($objectStore));
     }
     $storage->getAuthMechanism()->manipulateStorageConfig($storage);
     $storage->getBackend()->manipulateStorageConfig($storage);
 }
開發者ID:GrumpyCrouton,項目名稱:core,代碼行數:19,代碼來源:configadapter.php

示例4: manipulateStorageConfig

 public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null)
 {
     if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) {
         $uid = '';
     } else {
         $uid = $user->getUID();
     }
     $credentials = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
     if (is_array($credentials)) {
         $storage->setBackendOption('user', $credentials['user']);
         $storage->setBackendOption('password', $credentials['password']);
     }
 }
開發者ID:farukuzun,項目名稱:core-1,代碼行數:13,代碼來源:globalauth.php

示例5: manipulateStorageConfig

 public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null)
 {
     if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) {
         $uid = '';
     } elseif (is_null($user)) {
         throw new InsufficientDataForMeaningfulAnswerException('No credentials saved');
     } else {
         $uid = $user->getUID();
     }
     $credentials = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
     if (is_array($credentials)) {
         $storage->setBackendOption('user', $credentials['user']);
         $storage->setBackendOption('password', $credentials['password']);
     }
 }
開發者ID:ZverAleksey,項目名稱:core,代碼行數:15,代碼來源:globalauth.php

示例6: manipulateStorageConfig

 /**
  * @param StorageConfig $storage
  * @param IUser $user
  */
 public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null)
 {
     $user = $storage->getBackendOption('user');
     if ($domain = $storage->getBackendOption('domain')) {
         $storage->setBackendOption('user', $domain . '\\' . $user);
     }
 }
開發者ID:farukuzun,項目名稱:core-1,代碼行數:11,代碼來源:smb.php

示例7: prepareStorageConfig

 /**
  * Process storage ready for mounting
  *
  * @param StorageConfig $storage
  * @param IUser $user
  */
 private function prepareStorageConfig(StorageConfig &$storage, IUser $user)
 {
     foreach ($storage->getBackendOptions() as $option => $value) {
         $storage->setBackendOption($option, \OC_Mount_Config::setUserVars($user->getUID(), $value));
     }
     $objectStore = $storage->getBackendOption('objectstore');
     if ($objectStore) {
         $objectClass = $objectStore['class'];
         if (!is_subclass_of($objectClass, '\\OCP\\Files\\ObjectStore\\IObjectStore')) {
             throw new \InvalidArgumentException('Invalid object store');
         }
         $storage->setBackendOption('objectstore', new $objectClass($objectStore));
     }
     $storage->getAuthMechanism()->manipulateStorageConfig($storage);
     $storage->getBackend()->manipulateStorageConfig($storage);
 }
開發者ID:hyb148,項目名稱:core,代碼行數:22,代碼來源:configadapter.php

示例8: manipulateStorageConfig

 public function manipulateStorageConfig(StorageConfig &$storage)
 {
     $username_as_share = $storage->getBackendOption('username_as_share') === true;
     if ($username_as_share) {
         $share = '/' . $storage->getBackendOption('user');
         $storage->setBackendOption('share', $share);
     }
 }
開發者ID:hyb148,項目名稱:core,代碼行數:8,代碼來源:smb_oc.php

示例9: manipulateStorageConfig

 public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null)
 {
     $auth = new RSACrypt();
     $auth->setPassword($this->config->getSystemValue('secret', ''));
     if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
         throw new \RuntimeException('unable to load private key');
     }
     $storage->setBackendOption('public_key_auth', $auth);
 }
開發者ID:farukuzun,項目名稱:core-1,代碼行數:9,代碼來源:rsa.php

示例10: updateStorage

 /**
  * Update storage to the configuration
  *
  * @param StorageConfig $updatedStorage storage attributes
  *
  * @return StorageConfig storage config
  * @throws NotFoundException if the given storage does not exist in the config
  */
 public function updateStorage(StorageConfig $updatedStorage)
 {
     $allStorages = $this->readConfig();
     $id = $updatedStorage->getId();
     if (!isset($allStorages[$id])) {
         throw new NotFoundException('Storage with id "' . $id . '" not found');
     }
     $oldStorage = $allStorages[$id];
     // ensure objectstore is persistent
     if ($objectstore = $oldStorage->getBackendOption('objectstore')) {
         $updatedStorage->setBackendOption('objectstore', $objectstore);
     }
     $allStorages[$id] = $updatedStorage;
     $this->writeConfig($allStorages);
     $this->triggerChangeHooks($oldStorage, $updatedStorage);
     return $this->getStorage($id);
 }
開發者ID:evanjt,項目名稱:core,代碼行數:25,代碼來源:storagesservice.php

示例11: validateStorageDefinition

 /**
  * Check if parameters are satisfied in a StorageConfig
  *
  * @param StorageConfig $storage
  * @return bool
  */
 public function validateStorageDefinition(StorageConfig $storage)
 {
     foreach ($this->getParameters() as $name => $parameter) {
         $value = $storage->getBackendOption($name);
         if (!is_null($value) || !$parameter->isOptional()) {
             if (!$parameter->validateValue($value)) {
                 return false;
             }
             $storage->setBackendOption($name, $value);
         }
     }
     return true;
 }
開發者ID:rchicoli,項目名稱:owncloud-core,代碼行數:19,代碼來源:FrontendDefinitionTrait.php

示例12: setOption

 /**
  * @param StorageConfig $mount
  * @param string $key
  * @param string $value
  * @param OutputInterface $output
  */
 protected function setOption(StorageConfig $mount, $key, $value, OutputInterface $output)
 {
     $decoded = json_decode($value, true);
     if (!is_null($decoded)) {
         $value = $decoded;
     }
     if ($key === 'mountpoint' || $key === 'mount_point') {
         $mount->setMountPoint($value);
     } else {
         $mount->setBackendOption($key, $value);
     }
     $this->globalService->updateStorage($mount);
 }
開發者ID:rchicoli,項目名稱:owncloud-core,代碼行數:19,代碼來源:Config.php


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