本文整理汇总了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>');
}
示例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();
}
示例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);
}
}
}
示例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;
}
示例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']);
}
}
示例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();
}
示例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);
}
}
示例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']);
}
}
示例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);
}