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


PHP IConfig::deleteAppValue方法代码示例

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


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

示例1: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $importFile = $input->getArgument('file');
     if ($importFile !== null) {
         $content = $this->getArrayFromFile($importFile);
     } else {
         $content = $this->getArrayFromStdin();
     }
     try {
         $configs = $this->validateFileContent($content);
     } catch (\UnexpectedValueException $e) {
         $output->writeln('<error>' . $e->getMessage() . '</error>');
         return;
     }
     if (!empty($configs['system'])) {
         $this->config->setSystemValues($configs['system']);
     }
     if (!empty($configs['apps'])) {
         foreach ($configs['apps'] as $app => $appConfigs) {
             foreach ($appConfigs as $key => $value) {
                 if ($value === null) {
                     $this->config->deleteAppValue($app, $key);
                 } else {
                     $this->config->setAppValue($app, $key, $value);
                 }
             }
         }
     }
     $output->writeln('<info>Config successfully imported from: ' . $importFile . '</info>');
 }
开发者ID:evanjt,项目名称:core,代码行数:30,代码来源:import.php

示例2: deleteAppValue

 /**
  * @param array $parameters
  * @return \OC_OCS_Result
  */
 public function deleteAppValue($parameters)
 {
     $app = $parameters['appid'];
     $configKey = $parameters['configkey'];
     $this->config->deleteAppValue($app, $configKey);
     return new \OC_OCS_Result();
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:11,代码来源:Config.php

示例3: run

 public function run(IOutput $out)
 {
     $keys = $this->config->getAppKeys('files_sharing');
     foreach ($keys as $key) {
         if (is_numeric($key)) {
             $this->config->deleteAppValue('files_sharing', $key);
         }
     }
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:9,代码来源:SharePropagation.php

示例4: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $appName = $input->getArgument('app');
     $configName = $input->getArgument('name');
     if ($input->hasParameterOption('--error-if-not-exists') && !in_array($configName, $this->config->getAppKeys($appName))) {
         $output->writeln('<error>Config ' . $configName . ' of app ' . $appName . ' could not be deleted because it did not exist</error>');
         return 1;
     }
     $this->config->deleteAppValue($appName, $configName);
     $output->writeln('<info>Config value ' . $configName . ' of app ' . $appName . ' deleted</info>');
     return 0;
 }
开发者ID:kenwi,项目名称:core,代码行数:12,代码来源:deleteconfig.php

示例5: updateDB

 /**
  * update database
  */
 public function updateDB()
 {
     // make sure that we don't update the file cache multiple times
     // only update during the first run
     if ($this->installedVersion === '-1') {
         return;
     }
     // delete left-over from old encryption which is no longer needed
     $this->config->deleteAppValue('files_encryption', 'ocsid');
     $this->config->deleteAppValue('files_encryption', 'types');
     $this->config->deleteAppValue('files_encryption', 'enabled');
     $oldAppValues = $this->connection->createQueryBuilder();
     $oldAppValues->select('*')->from('`*PREFIX*appconfig`')->where($oldAppValues->expr()->eq('`appid`', ':appid'))->setParameter('appid', 'files_encryption');
     $appSettings = $oldAppValues->execute();
     while ($row = $appSettings->fetch()) {
         // 'installed_version' gets deleted at the end of the migration process
         if ($row['configkey'] !== 'installed_version') {
             $this->config->setAppValue('encryption', $row['configkey'], $row['configvalue']);
             $this->config->deleteAppValue('files_encryption', $row['configkey']);
         }
     }
     $oldPreferences = $this->connection->createQueryBuilder();
     $oldPreferences->select('*')->from('`*PREFIX*preferences`')->where($oldPreferences->expr()->eq('`appid`', ':appid'))->setParameter('appid', 'files_encryption');
     $preferenceSettings = $oldPreferences->execute();
     while ($row = $preferenceSettings->fetch()) {
         $this->config->setUserValue($row['userid'], 'encryption', $row['configkey'], $row['configvalue']);
         $this->config->deleteUserValue($row['userid'], 'files_encryption', $row['configkey']);
     }
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:32,代码来源:migration.php

示例6: updateDB

 /**
  * update database
  */
 public function updateDB()
 {
     // delete left-over from old encryption which is no longer needed
     $this->config->deleteAppValue('files_encryption', 'ocsid');
     $this->config->deleteAppValue('files_encryption', 'types');
     $this->config->deleteAppValue('files_encryption', 'enabled');
     $query = $this->connection->createQueryBuilder();
     $query->update('`*PREFIX*appconfig`')->set('`appid`', ':newappid')->where($query->expr()->eq('`appid`', ':oldappid'))->setParameter('oldappid', 'files_encryption')->setParameter('newappid', 'encryption');
     $query->execute();
     $query = $this->connection->createQueryBuilder();
     $query->update('`*PREFIX*preferences`')->set('`appid`', ':newappid')->where($query->expr()->eq('`appid`', ':oldappid'))->setParameter('oldappid', 'files_encryption')->setParameter('newappid', 'encryption');
     $query->execute();
 }
开发者ID:alfrescoo,项目名称:core,代码行数:16,代码来源:migration.php

示例7: releaseLock

 /**
  * @param array $parameters
  * @return \OC_OCS_Result
  */
 public function releaseLock(array $parameters)
 {
     try {
         $path = $this->getPath($parameters);
     } catch (NoUserException $e) {
         return new \OC_OCS_Result(null, Http::STATUS_NOT_FOUND, 'User not found');
     } catch (NotFoundException $e) {
         return new \OC_OCS_Result(null, Http::STATUS_NOT_FOUND, 'Path not found');
     }
     $type = $this->getType($parameters);
     $lockingProvider = $this->getLockingProvider();
     try {
         $lockingProvider->releaseLock($path, $type);
         $this->config->deleteAppValue('testing', 'locking_' . $path);
         return new \OC_OCS_Result(null, 100);
     } catch (LockedException $e) {
         return new \OC_OCS_Result(null, Http::STATUS_LOCKED);
     }
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:23,代码来源:provisioning.php

示例8: updateDB

 /**
  * update database
  */
 public function updateDB()
 {
     // delete left-over from old encryption which is no longer needed
     $this->config->deleteAppValue('files_encryption', 'ocsid');
     $this->config->deleteAppValue('files_encryption', 'types');
     $this->config->deleteAppValue('files_encryption', 'enabled');
     $oldAppValues = $this->connection->getQueryBuilder();
     $oldAppValues->select('*')->from('*PREFIX*appconfig')->where($oldAppValues->expr()->eq('appid', $oldAppValues->createParameter('appid')))->setParameter('appid', 'files_encryption');
     $appSettings = $oldAppValues->execute();
     while ($row = $appSettings->fetch()) {
         // 'installed_version' gets deleted at the end of the migration process
         if ($row['configkey'] !== 'installed_version') {
             $this->config->setAppValue('encryption', $row['configkey'], $row['configvalue']);
             $this->config->deleteAppValue('files_encryption', $row['configkey']);
         }
     }
     $oldPreferences = $this->connection->getQueryBuilder();
     $oldPreferences->select('*')->from('*PREFIX*preferences')->where($oldPreferences->expr()->eq('appid', $oldPreferences->createParameter('appid')))->setParameter('appid', 'files_encryption');
     $preferenceSettings = $oldPreferences->execute();
     while ($row = $preferenceSettings->fetch()) {
         $this->config->setUserValue($row['userid'], 'encryption', $row['configkey'], $row['configvalue']);
         $this->config->deleteUserValue($row['userid'], 'files_encryption', $row['configkey']);
     }
 }
开发者ID:jemygraw,项目名称:core,代码行数:27,代码来源:migration.php

示例9: cleanResults

 /**
  *
  * Clean previous results for a proper rescanning. Otherwise
  */
 private function cleanResults()
 {
     $this->config->deleteAppValue('core', self::CACHE_KEY);
     $this->cache->remove(self::CACHE_KEY);
 }
开发者ID:farukuzun,项目名称:core-1,代码行数:9,代码来源:checker.php


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