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); } } }
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; }
protected function execute(InputInterface $input, OutputInterface $output) { $appName = $input->getArgument('app'); $configName = $input->getArgument('name'); if (!in_array($configName, $this->config->getAppKeys($appName)) && $input->hasParameterOption('--update-only')) { $output->writeln('<comment>Config value ' . $configName . ' for app ' . $appName . ' not updated, as it has not been set before.</comment>'); return 1; } $configValue = $input->getOption('value'); $this->config->setAppValue($appName, $configName, $configValue); $output->writeln('<info>Config value ' . $configName . ' for app ' . $appName . ' set to ' . $configValue . '</info>'); return 0; }
/** * Get all mountpoints we need to update the etag for * * @return string[] */ protected function getDirtyMountPoints() { $dirty = array(); $mountPoints = $this->config->getAppKeys('files_external'); foreach ($mountPoints as $mountPoint) { if (substr($mountPoint, 0, 1) === '/') { $updateTime = $this->config->getAppValue('files_external', $mountPoint); $userTime = $this->config->getUserValue($this->user->getUID(), 'files_external', $mountPoint); if ($updateTime > $userTime) { $dirty[] = $mountPoint; } } } return $dirty; }
/** * Executes the current command. * * @param InputInterface $input An InputInterface instance * @param OutputInterface $output An OutputInterface instance * @return null|int null or 0 if everything went fine, or an error code */ protected function execute(InputInterface $input, OutputInterface $output) { $appName = $input->getArgument('app'); $configName = $input->getArgument('name'); $defaultValue = $input->getOption('default-value'); if (!in_array($configName, $this->config->getAppKeys($appName)) && !$input->hasParameterOption('--default-value')) { return 1; } if (!in_array($configName, $this->config->getAppKeys($appName))) { $configValue = $defaultValue; } else { $configValue = $this->config->getAppValue($appName, $configName); } $this->writeMixedInOutputFormat($input, $output, $configValue); return 0; }
/** * @param array $parameters * @return \OC_OCS_Result */ public function releaseAll(array $parameters) { $type = $this->getType($parameters); $lockingProvider = $this->getLockingProvider(); foreach ($this->config->getAppKeys('testing') as $lock) { if (strpos($lock, 'locking_') === 0) { $path = substr($lock, strlen('locking_')); if ($type === ILockingProvider::LOCK_EXCLUSIVE && $this->config->getAppValue('testing', $lock) == ILockingProvider::LOCK_EXCLUSIVE) { $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); } else { if ($type === ILockingProvider::LOCK_SHARED && $this->config->getAppValue('testing', $lock) == ILockingProvider::LOCK_SHARED) { $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); } else { $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); } } } } return new \OC_OCS_Result(null, 100); }