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


PHP OC_Mount_Config::writeData方法代码示例

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


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

示例1: writeConfig

 /**
  * Write the storages to the configuration.
  *
  * @param array $storages map of storage id to storage config
  */
 public function writeConfig($storages)
 {
     // let the horror begin
     $mountPoints = [];
     foreach ($storages as $storageConfig) {
         $mountPoint = $storageConfig->getMountPoint();
         $oldBackendOptions = $storageConfig->getBackendOptions();
         $storageConfig->setBackendOptions(\OC_Mount_Config::encryptPasswords($oldBackendOptions));
         // system mount
         $rootMountPoint = '/$user/files/' . ltrim($mountPoint, '/');
         $applicableUsers = $storageConfig->getApplicableUsers();
         $applicableGroups = $storageConfig->getApplicableGroups();
         foreach ($applicableUsers as $applicable) {
             $this->addMountPoint($mountPoints, \OC_Mount_Config::MOUNT_TYPE_USER, $applicable, $rootMountPoint, $storageConfig);
         }
         foreach ($applicableGroups as $applicable) {
             $this->addMountPoint($mountPoints, \OC_Mount_Config::MOUNT_TYPE_GROUP, $applicable, $rootMountPoint, $storageConfig);
         }
         // if neither "applicableGroups" or "applicableUsers" were set, use "all" user
         if (empty($applicableUsers) && empty($applicableGroups)) {
             $this->addMountPoint($mountPoints, \OC_Mount_Config::MOUNT_TYPE_USER, 'all', $rootMountPoint, $storageConfig);
         }
         // restore old backend options where the password was not encrypted,
         // because we don't want to change the state of the original object
         $storageConfig->setBackendOptions($oldBackendOptions);
     }
     \OC_Mount_Config::writeData(null, $mountPoints);
 }
开发者ID:samj1912,项目名称:repo,代码行数:33,代码来源:globalstoragesservice.php

示例2: writeConfig

 /**
  * Write the storages to the user's configuration.
  *
  * @param array $storages map of storage id to storage config
  */
 public function writeConfig($storages)
 {
     $user = $this->userSession->getUser()->getUID();
     // let the horror begin
     $mountPoints = [];
     foreach ($storages as $storageConfig) {
         $mountPoint = $storageConfig->getMountPoint();
         $oldBackendOptions = $storageConfig->getBackendOptions();
         $storageConfig->setBackendOptions(\OC_Mount_Config::encryptPasswords($oldBackendOptions));
         $rootMountPoint = '/' . $user . '/files/' . ltrim($mountPoint, '/');
         $this->addMountPoint($mountPoints, \OC_Mount_Config::MOUNT_TYPE_USER, $user, $rootMountPoint, $storageConfig);
         // restore old backend options where the password was not encrypted,
         // because we don't want to change the state of the original object
         $storageConfig->setBackendOptions($oldBackendOptions);
     }
     \OC_Mount_Config::writeData($user, $mountPoints);
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:22,代码来源:userstoragesservice.php

示例3: writeLegacyConfig

 /**
  * Write legacy config data
  *
  * @param array $mountPoints
  */
 protected function writeLegacyConfig(array $mountPoints)
 {
     // write global config
     \OC_Mount_Config::writeData(null, $mountPoints);
 }
开发者ID:evanjt,项目名称:core,代码行数:10,代码来源:storagesservice.php

示例4: writeLegacyConfig

 /**
  * Write legacy config data
  *
  * @param array $mountPoints
  */
 protected function writeLegacyConfig(array $mountPoints)
 {
     // write user config
     $user = $this->getUser()->getUID();
     \OC_Mount_Config::writeData($user, $mountPoints);
 }
开发者ID:hyb148,项目名称:core,代码行数:11,代码来源:userstoragesservice.php


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