@@ -26,23 +26,23 @@ |
||
26 | 26 | |
27 | 27 | abstract class Base extends \OC\Core\Command\Base { |
28 | 28 | |
29 | - /** * @var IConfig */ |
|
30 | - protected $config; |
|
29 | + /** * @var IConfig */ |
|
30 | + protected $config; |
|
31 | 31 | |
32 | - /** |
|
33 | - * @param string $argumentName |
|
34 | - * @param CompletionContext $context |
|
35 | - * @return string[] |
|
36 | - */ |
|
37 | - public function completeArgumentValues($argumentName, CompletionContext $context) { |
|
38 | - if ($argumentName === 'app') { |
|
39 | - return \OC_App::getAllApps(); |
|
40 | - } |
|
32 | + /** |
|
33 | + * @param string $argumentName |
|
34 | + * @param CompletionContext $context |
|
35 | + * @return string[] |
|
36 | + */ |
|
37 | + public function completeArgumentValues($argumentName, CompletionContext $context) { |
|
38 | + if ($argumentName === 'app') { |
|
39 | + return \OC_App::getAllApps(); |
|
40 | + } |
|
41 | 41 | |
42 | - if ($argumentName === 'name') { |
|
43 | - $appName = $context->getWordAtIndex($context->getWordIndex() - 1); |
|
44 | - return $this->config->getAppKeys($appName); |
|
45 | - } |
|
46 | - return []; |
|
47 | - } |
|
42 | + if ($argumentName === 'name') { |
|
43 | + $appName = $context->getWordAtIndex($context->getWordIndex() - 1); |
|
44 | + return $this->config->getAppKeys($appName); |
|
45 | + } |
|
46 | + return []; |
|
47 | + } |
|
48 | 48 | } |
@@ -76,14 +76,14 @@ |
||
76 | 76 | $configName = $input->getArgument('name'); |
77 | 77 | |
78 | 78 | if (!in_array($configName, $this->config->getAppKeys($appName)) && $input->hasParameterOption('--update-only')) { |
79 | - $output->writeln('<comment>Config value ' . $configName . ' for app ' . $appName . ' not updated, as it has not been set before.</comment>'); |
|
79 | + $output->writeln('<comment>Config value '.$configName.' for app '.$appName.' not updated, as it has not been set before.</comment>'); |
|
80 | 80 | return 1; |
81 | 81 | } |
82 | 82 | |
83 | 83 | $configValue = $input->getOption('value'); |
84 | 84 | $this->config->setAppValue($appName, $configName, $configValue); |
85 | 85 | |
86 | - $output->writeln('<info>Config value ' . $configName . ' for app ' . $appName . ' set to ' . $configValue . '</info>'); |
|
86 | + $output->writeln('<info>Config value '.$configName.' for app '.$appName.' set to '.$configValue.'</info>'); |
|
87 | 87 | return 0; |
88 | 88 | } |
89 | 89 | } |
@@ -29,61 +29,61 @@ |
||
29 | 29 | use Symfony\Component\Console\Output\OutputInterface; |
30 | 30 | |
31 | 31 | class SetConfig extends Base { |
32 | - /** * @var IConfig */ |
|
33 | - protected $config; |
|
32 | + /** * @var IConfig */ |
|
33 | + protected $config; |
|
34 | 34 | |
35 | - /** |
|
36 | - * @param IConfig $config |
|
37 | - */ |
|
38 | - public function __construct(IConfig $config) { |
|
39 | - parent::__construct(); |
|
40 | - $this->config = $config; |
|
41 | - } |
|
35 | + /** |
|
36 | + * @param IConfig $config |
|
37 | + */ |
|
38 | + public function __construct(IConfig $config) { |
|
39 | + parent::__construct(); |
|
40 | + $this->config = $config; |
|
41 | + } |
|
42 | 42 | |
43 | - protected function configure() { |
|
44 | - parent::configure(); |
|
43 | + protected function configure() { |
|
44 | + parent::configure(); |
|
45 | 45 | |
46 | - $this |
|
47 | - ->setName('config:app:set') |
|
48 | - ->setDescription('Set an app config value') |
|
49 | - ->addArgument( |
|
50 | - 'app', |
|
51 | - InputArgument::REQUIRED, |
|
52 | - 'Name of the app' |
|
53 | - ) |
|
54 | - ->addArgument( |
|
55 | - 'name', |
|
56 | - InputArgument::REQUIRED, |
|
57 | - 'Name of the config to set' |
|
58 | - ) |
|
59 | - ->addOption( |
|
60 | - 'value', |
|
61 | - null, |
|
62 | - InputOption::VALUE_REQUIRED, |
|
63 | - 'The new value of the config' |
|
64 | - ) |
|
65 | - ->addOption( |
|
66 | - 'update-only', |
|
67 | - null, |
|
68 | - InputOption::VALUE_NONE, |
|
69 | - 'Only updates the value, if it is not set before, it is not being added' |
|
70 | - ) |
|
71 | - ; |
|
72 | - } |
|
46 | + $this |
|
47 | + ->setName('config:app:set') |
|
48 | + ->setDescription('Set an app config value') |
|
49 | + ->addArgument( |
|
50 | + 'app', |
|
51 | + InputArgument::REQUIRED, |
|
52 | + 'Name of the app' |
|
53 | + ) |
|
54 | + ->addArgument( |
|
55 | + 'name', |
|
56 | + InputArgument::REQUIRED, |
|
57 | + 'Name of the config to set' |
|
58 | + ) |
|
59 | + ->addOption( |
|
60 | + 'value', |
|
61 | + null, |
|
62 | + InputOption::VALUE_REQUIRED, |
|
63 | + 'The new value of the config' |
|
64 | + ) |
|
65 | + ->addOption( |
|
66 | + 'update-only', |
|
67 | + null, |
|
68 | + InputOption::VALUE_NONE, |
|
69 | + 'Only updates the value, if it is not set before, it is not being added' |
|
70 | + ) |
|
71 | + ; |
|
72 | + } |
|
73 | 73 | |
74 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
75 | - $appName = $input->getArgument('app'); |
|
76 | - $configName = $input->getArgument('name'); |
|
74 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
75 | + $appName = $input->getArgument('app'); |
|
76 | + $configName = $input->getArgument('name'); |
|
77 | 77 | |
78 | - if (!in_array($configName, $this->config->getAppKeys($appName)) && $input->hasParameterOption('--update-only')) { |
|
79 | - $output->writeln('<comment>Config value ' . $configName . ' for app ' . $appName . ' not updated, as it has not been set before.</comment>'); |
|
80 | - return 1; |
|
81 | - } |
|
78 | + if (!in_array($configName, $this->config->getAppKeys($appName)) && $input->hasParameterOption('--update-only')) { |
|
79 | + $output->writeln('<comment>Config value ' . $configName . ' for app ' . $appName . ' not updated, as it has not been set before.</comment>'); |
|
80 | + return 1; |
|
81 | + } |
|
82 | 82 | |
83 | - $configValue = $input->getOption('value'); |
|
84 | - $this->config->setAppValue($appName, $configName, $configValue); |
|
83 | + $configValue = $input->getOption('value'); |
|
84 | + $this->config->setAppValue($appName, $configName, $configValue); |
|
85 | 85 | |
86 | - $output->writeln('<info>Config value ' . $configName . ' for app ' . $appName . ' set to ' . $configValue . '</info>'); |
|
87 | - return 0; |
|
88 | - } |
|
86 | + $output->writeln('<info>Config value ' . $configName . ' for app ' . $appName . ' set to ' . $configValue . '</info>'); |
|
87 | + return 0; |
|
88 | + } |
|
89 | 89 | } |
@@ -132,16 +132,16 @@ |
||
132 | 132 | $this->output->writeln(''); |
133 | 133 | break; |
134 | 134 | case '\OC\Repair::step': |
135 | - $this->output->writeln(' - ' . $event->getArgument(0)); |
|
135 | + $this->output->writeln(' - '.$event->getArgument(0)); |
|
136 | 136 | break; |
137 | 137 | case '\OC\Repair::info': |
138 | - $this->output->writeln(' - ' . $event->getArgument(0)); |
|
138 | + $this->output->writeln(' - '.$event->getArgument(0)); |
|
139 | 139 | break; |
140 | 140 | case '\OC\Repair::warning': |
141 | - $this->output->writeln(' - WARNING: ' . $event->getArgument(0)); |
|
141 | + $this->output->writeln(' - WARNING: '.$event->getArgument(0)); |
|
142 | 142 | break; |
143 | 143 | case '\OC\Repair::error': |
144 | - $this->output->writeln(' - ERROR: ' . $event->getArgument(0)); |
|
144 | + $this->output->writeln(' - ERROR: '.$event->getArgument(0)); |
|
145 | 145 | break; |
146 | 146 | } |
147 | 147 | } |
@@ -41,121 +41,121 @@ |
||
41 | 41 | use Symfony\Component\EventDispatcher\GenericEvent; |
42 | 42 | |
43 | 43 | class Repair extends Command { |
44 | - /** @var \OC\Repair $repair */ |
|
45 | - protected $repair; |
|
46 | - /** @var IConfig */ |
|
47 | - protected $config; |
|
48 | - /** @var EventDispatcherInterface */ |
|
49 | - private $dispatcher; |
|
50 | - /** @var ProgressBar */ |
|
51 | - private $progress; |
|
52 | - /** @var OutputInterface */ |
|
53 | - private $output; |
|
54 | - /** @var IAppManager */ |
|
55 | - private $appManager; |
|
44 | + /** @var \OC\Repair $repair */ |
|
45 | + protected $repair; |
|
46 | + /** @var IConfig */ |
|
47 | + protected $config; |
|
48 | + /** @var EventDispatcherInterface */ |
|
49 | + private $dispatcher; |
|
50 | + /** @var ProgressBar */ |
|
51 | + private $progress; |
|
52 | + /** @var OutputInterface */ |
|
53 | + private $output; |
|
54 | + /** @var IAppManager */ |
|
55 | + private $appManager; |
|
56 | 56 | |
57 | - /** |
|
58 | - * @param \OC\Repair $repair |
|
59 | - * @param IConfig $config |
|
60 | - * @param EventDispatcherInterface $dispatcher |
|
61 | - * @param IAppManager $appManager |
|
62 | - */ |
|
63 | - public function __construct(\OC\Repair $repair, IConfig $config, EventDispatcherInterface $dispatcher, IAppManager $appManager) { |
|
64 | - $this->repair = $repair; |
|
65 | - $this->config = $config; |
|
66 | - $this->dispatcher = $dispatcher; |
|
67 | - $this->appManager = $appManager; |
|
68 | - parent::__construct(); |
|
69 | - } |
|
57 | + /** |
|
58 | + * @param \OC\Repair $repair |
|
59 | + * @param IConfig $config |
|
60 | + * @param EventDispatcherInterface $dispatcher |
|
61 | + * @param IAppManager $appManager |
|
62 | + */ |
|
63 | + public function __construct(\OC\Repair $repair, IConfig $config, EventDispatcherInterface $dispatcher, IAppManager $appManager) { |
|
64 | + $this->repair = $repair; |
|
65 | + $this->config = $config; |
|
66 | + $this->dispatcher = $dispatcher; |
|
67 | + $this->appManager = $appManager; |
|
68 | + parent::__construct(); |
|
69 | + } |
|
70 | 70 | |
71 | - protected function configure() { |
|
72 | - $this |
|
73 | - ->setName('maintenance:repair') |
|
74 | - ->setDescription('repair this installation') |
|
75 | - ->addOption( |
|
76 | - 'include-expensive', |
|
77 | - null, |
|
78 | - InputOption::VALUE_NONE, |
|
79 | - 'Use this option when you want to include resource and load expensive tasks'); |
|
80 | - } |
|
71 | + protected function configure() { |
|
72 | + $this |
|
73 | + ->setName('maintenance:repair') |
|
74 | + ->setDescription('repair this installation') |
|
75 | + ->addOption( |
|
76 | + 'include-expensive', |
|
77 | + null, |
|
78 | + InputOption::VALUE_NONE, |
|
79 | + 'Use this option when you want to include resource and load expensive tasks'); |
|
80 | + } |
|
81 | 81 | |
82 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
83 | - $repairSteps = $this->repair::getRepairSteps(); |
|
82 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
83 | + $repairSteps = $this->repair::getRepairSteps(); |
|
84 | 84 | |
85 | - if ($input->getOption('include-expensive')) { |
|
86 | - $repairSteps = array_merge($repairSteps, $this->repair::getExpensiveRepairSteps()); |
|
87 | - } |
|
85 | + if ($input->getOption('include-expensive')) { |
|
86 | + $repairSteps = array_merge($repairSteps, $this->repair::getExpensiveRepairSteps()); |
|
87 | + } |
|
88 | 88 | |
89 | - foreach ($repairSteps as $step) { |
|
90 | - $this->repair->addStep($step); |
|
91 | - } |
|
89 | + foreach ($repairSteps as $step) { |
|
90 | + $this->repair->addStep($step); |
|
91 | + } |
|
92 | 92 | |
93 | - $apps = $this->appManager->getInstalledApps(); |
|
94 | - foreach ($apps as $app) { |
|
95 | - if (!$this->appManager->isEnabledForUser($app)) { |
|
96 | - continue; |
|
97 | - } |
|
98 | - $info = \OC_App::getAppInfo($app); |
|
99 | - if (!is_array($info)) { |
|
100 | - continue; |
|
101 | - } |
|
102 | - \OC_App::loadApp($app); |
|
103 | - $steps = $info['repair-steps']['post-migration']; |
|
104 | - foreach ($steps as $step) { |
|
105 | - try { |
|
106 | - $this->repair->addStep($step); |
|
107 | - } catch (Exception $ex) { |
|
108 | - $output->writeln("<error>Failed to load repair step for $app: {$ex->getMessage()}</error>"); |
|
109 | - } |
|
110 | - } |
|
111 | - } |
|
93 | + $apps = $this->appManager->getInstalledApps(); |
|
94 | + foreach ($apps as $app) { |
|
95 | + if (!$this->appManager->isEnabledForUser($app)) { |
|
96 | + continue; |
|
97 | + } |
|
98 | + $info = \OC_App::getAppInfo($app); |
|
99 | + if (!is_array($info)) { |
|
100 | + continue; |
|
101 | + } |
|
102 | + \OC_App::loadApp($app); |
|
103 | + $steps = $info['repair-steps']['post-migration']; |
|
104 | + foreach ($steps as $step) { |
|
105 | + try { |
|
106 | + $this->repair->addStep($step); |
|
107 | + } catch (Exception $ex) { |
|
108 | + $output->writeln("<error>Failed to load repair step for $app: {$ex->getMessage()}</error>"); |
|
109 | + } |
|
110 | + } |
|
111 | + } |
|
112 | 112 | |
113 | - $maintenanceMode = $this->config->getSystemValueBool('maintenance'); |
|
114 | - $this->config->setSystemValue('maintenance', true); |
|
113 | + $maintenanceMode = $this->config->getSystemValueBool('maintenance'); |
|
114 | + $this->config->setSystemValue('maintenance', true); |
|
115 | 115 | |
116 | - $this->progress = new ProgressBar($output); |
|
117 | - $this->output = $output; |
|
118 | - $this->dispatcher->addListener('\OC\Repair::startProgress', [$this, 'handleRepairFeedBack']); |
|
119 | - $this->dispatcher->addListener('\OC\Repair::advance', [$this, 'handleRepairFeedBack']); |
|
120 | - $this->dispatcher->addListener('\OC\Repair::finishProgress', [$this, 'handleRepairFeedBack']); |
|
121 | - $this->dispatcher->addListener('\OC\Repair::step', [$this, 'handleRepairFeedBack']); |
|
122 | - $this->dispatcher->addListener('\OC\Repair::info', [$this, 'handleRepairFeedBack']); |
|
123 | - $this->dispatcher->addListener('\OC\Repair::warning', [$this, 'handleRepairFeedBack']); |
|
124 | - $this->dispatcher->addListener('\OC\Repair::error', [$this, 'handleRepairFeedBack']); |
|
116 | + $this->progress = new ProgressBar($output); |
|
117 | + $this->output = $output; |
|
118 | + $this->dispatcher->addListener('\OC\Repair::startProgress', [$this, 'handleRepairFeedBack']); |
|
119 | + $this->dispatcher->addListener('\OC\Repair::advance', [$this, 'handleRepairFeedBack']); |
|
120 | + $this->dispatcher->addListener('\OC\Repair::finishProgress', [$this, 'handleRepairFeedBack']); |
|
121 | + $this->dispatcher->addListener('\OC\Repair::step', [$this, 'handleRepairFeedBack']); |
|
122 | + $this->dispatcher->addListener('\OC\Repair::info', [$this, 'handleRepairFeedBack']); |
|
123 | + $this->dispatcher->addListener('\OC\Repair::warning', [$this, 'handleRepairFeedBack']); |
|
124 | + $this->dispatcher->addListener('\OC\Repair::error', [$this, 'handleRepairFeedBack']); |
|
125 | 125 | |
126 | - $this->repair->run(); |
|
126 | + $this->repair->run(); |
|
127 | 127 | |
128 | - $this->config->setSystemValue('maintenance', $maintenanceMode); |
|
129 | - return 0; |
|
130 | - } |
|
128 | + $this->config->setSystemValue('maintenance', $maintenanceMode); |
|
129 | + return 0; |
|
130 | + } |
|
131 | 131 | |
132 | - public function handleRepairFeedBack($event) { |
|
133 | - if (!$event instanceof GenericEvent) { |
|
134 | - return; |
|
135 | - } |
|
136 | - switch ($event->getSubject()) { |
|
137 | - case '\OC\Repair::startProgress': |
|
138 | - $this->progress->start($event->getArgument(0)); |
|
139 | - break; |
|
140 | - case '\OC\Repair::advance': |
|
141 | - $this->progress->advance($event->getArgument(0)); |
|
142 | - break; |
|
143 | - case '\OC\Repair::finishProgress': |
|
144 | - $this->progress->finish(); |
|
145 | - $this->output->writeln(''); |
|
146 | - break; |
|
147 | - case '\OC\Repair::step': |
|
148 | - $this->output->writeln(' - ' . $event->getArgument(0)); |
|
149 | - break; |
|
150 | - case '\OC\Repair::info': |
|
151 | - $this->output->writeln(' - ' . $event->getArgument(0)); |
|
152 | - break; |
|
153 | - case '\OC\Repair::warning': |
|
154 | - $this->output->writeln(' - WARNING: ' . $event->getArgument(0)); |
|
155 | - break; |
|
156 | - case '\OC\Repair::error': |
|
157 | - $this->output->writeln(' - ERROR: ' . $event->getArgument(0)); |
|
158 | - break; |
|
159 | - } |
|
160 | - } |
|
132 | + public function handleRepairFeedBack($event) { |
|
133 | + if (!$event instanceof GenericEvent) { |
|
134 | + return; |
|
135 | + } |
|
136 | + switch ($event->getSubject()) { |
|
137 | + case '\OC\Repair::startProgress': |
|
138 | + $this->progress->start($event->getArgument(0)); |
|
139 | + break; |
|
140 | + case '\OC\Repair::advance': |
|
141 | + $this->progress->advance($event->getArgument(0)); |
|
142 | + break; |
|
143 | + case '\OC\Repair::finishProgress': |
|
144 | + $this->progress->finish(); |
|
145 | + $this->output->writeln(''); |
|
146 | + break; |
|
147 | + case '\OC\Repair::step': |
|
148 | + $this->output->writeln(' - ' . $event->getArgument(0)); |
|
149 | + break; |
|
150 | + case '\OC\Repair::info': |
|
151 | + $this->output->writeln(' - ' . $event->getArgument(0)); |
|
152 | + break; |
|
153 | + case '\OC\Repair::warning': |
|
154 | + $this->output->writeln(' - WARNING: ' . $event->getArgument(0)); |
|
155 | + break; |
|
156 | + case '\OC\Repair::error': |
|
157 | + $this->output->writeln(' - ERROR: ' . $event->getArgument(0)); |
|
158 | + break; |
|
159 | + } |
|
160 | + } |
|
161 | 161 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | try { |
69 | 69 | $mount = $this->globalService->getStorage($mountId); |
70 | 70 | } catch (NotFoundException $e) { |
71 | - $output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"</error>'); |
|
71 | + $output->writeln('<error>Mount with id "'.$mountId.' not found, check "occ files_external:list" to get available mounts"</error>'); |
|
72 | 72 | return 404; |
73 | 73 | } |
74 | 74 |
@@ -39,77 +39,77 @@ |
||
39 | 39 | use Symfony\Component\Console\Question\ConfirmationQuestion; |
40 | 40 | |
41 | 41 | class Delete extends Base { |
42 | - /** |
|
43 | - * @var GlobalStoragesService |
|
44 | - */ |
|
45 | - protected $globalService; |
|
42 | + /** |
|
43 | + * @var GlobalStoragesService |
|
44 | + */ |
|
45 | + protected $globalService; |
|
46 | 46 | |
47 | - /** |
|
48 | - * @var UserStoragesService |
|
49 | - */ |
|
50 | - protected $userService; |
|
47 | + /** |
|
48 | + * @var UserStoragesService |
|
49 | + */ |
|
50 | + protected $userService; |
|
51 | 51 | |
52 | - /** |
|
53 | - * @var IUserSession |
|
54 | - */ |
|
55 | - protected $userSession; |
|
52 | + /** |
|
53 | + * @var IUserSession |
|
54 | + */ |
|
55 | + protected $userSession; |
|
56 | 56 | |
57 | - /** |
|
58 | - * @var IUserManager |
|
59 | - */ |
|
60 | - protected $userManager; |
|
57 | + /** |
|
58 | + * @var IUserManager |
|
59 | + */ |
|
60 | + protected $userManager; |
|
61 | 61 | |
62 | - public function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserSession $userSession, IUserManager $userManager) { |
|
63 | - parent::__construct(); |
|
64 | - $this->globalService = $globalService; |
|
65 | - $this->userService = $userService; |
|
66 | - $this->userSession = $userSession; |
|
67 | - $this->userManager = $userManager; |
|
68 | - } |
|
62 | + public function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserSession $userSession, IUserManager $userManager) { |
|
63 | + parent::__construct(); |
|
64 | + $this->globalService = $globalService; |
|
65 | + $this->userService = $userService; |
|
66 | + $this->userSession = $userSession; |
|
67 | + $this->userManager = $userManager; |
|
68 | + } |
|
69 | 69 | |
70 | - protected function configure() { |
|
71 | - $this |
|
72 | - ->setName('files_external:delete') |
|
73 | - ->setDescription('Delete an external mount') |
|
74 | - ->addArgument( |
|
75 | - 'mount_id', |
|
76 | - InputArgument::REQUIRED, |
|
77 | - 'The id of the mount to edit' |
|
78 | - )->addOption( |
|
79 | - 'yes', |
|
80 | - 'y', |
|
81 | - InputOption::VALUE_NONE, |
|
82 | - 'Skip confirmation' |
|
83 | - ); |
|
84 | - parent::configure(); |
|
85 | - } |
|
70 | + protected function configure() { |
|
71 | + $this |
|
72 | + ->setName('files_external:delete') |
|
73 | + ->setDescription('Delete an external mount') |
|
74 | + ->addArgument( |
|
75 | + 'mount_id', |
|
76 | + InputArgument::REQUIRED, |
|
77 | + 'The id of the mount to edit' |
|
78 | + )->addOption( |
|
79 | + 'yes', |
|
80 | + 'y', |
|
81 | + InputOption::VALUE_NONE, |
|
82 | + 'Skip confirmation' |
|
83 | + ); |
|
84 | + parent::configure(); |
|
85 | + } |
|
86 | 86 | |
87 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
88 | - $mountId = $input->getArgument('mount_id'); |
|
89 | - try { |
|
90 | - $mount = $this->globalService->getStorage($mountId); |
|
91 | - } catch (NotFoundException $e) { |
|
92 | - $output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"</error>'); |
|
93 | - return 404; |
|
94 | - } |
|
87 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
88 | + $mountId = $input->getArgument('mount_id'); |
|
89 | + try { |
|
90 | + $mount = $this->globalService->getStorage($mountId); |
|
91 | + } catch (NotFoundException $e) { |
|
92 | + $output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"</error>'); |
|
93 | + return 404; |
|
94 | + } |
|
95 | 95 | |
96 | - $noConfirm = $input->getOption('yes'); |
|
96 | + $noConfirm = $input->getOption('yes'); |
|
97 | 97 | |
98 | - if (!$noConfirm) { |
|
99 | - $listCommand = new ListCommand($this->globalService, $this->userService, $this->userSession, $this->userManager); |
|
100 | - $listInput = new ArrayInput([], $listCommand->getDefinition()); |
|
101 | - $listInput->setOption('output', $input->getOption('output')); |
|
102 | - $listCommand->listMounts(null, [$mount], $listInput, $output); |
|
98 | + if (!$noConfirm) { |
|
99 | + $listCommand = new ListCommand($this->globalService, $this->userService, $this->userSession, $this->userManager); |
|
100 | + $listInput = new ArrayInput([], $listCommand->getDefinition()); |
|
101 | + $listInput->setOption('output', $input->getOption('output')); |
|
102 | + $listCommand->listMounts(null, [$mount], $listInput, $output); |
|
103 | 103 | |
104 | - $questionHelper = $this->getHelper('question'); |
|
105 | - $question = new ConfirmationQuestion('Delete this mount? [y/N] ', false); |
|
104 | + $questionHelper = $this->getHelper('question'); |
|
105 | + $question = new ConfirmationQuestion('Delete this mount? [y/N] ', false); |
|
106 | 106 | |
107 | - if (!$questionHelper->ask($input, $output, $question)) { |
|
108 | - return 1; |
|
109 | - } |
|
110 | - } |
|
107 | + if (!$questionHelper->ask($input, $output, $question)) { |
|
108 | + return 1; |
|
109 | + } |
|
110 | + } |
|
111 | 111 | |
112 | - $this->globalService->removeStorage($mountId); |
|
113 | - return 0; |
|
114 | - } |
|
112 | + $this->globalService->removeStorage($mountId); |
|
113 | + return 0; |
|
114 | + } |
|
115 | 115 | } |
@@ -33,33 +33,33 @@ |
||
33 | 33 | */ |
34 | 34 | interface IAction extends JsonSerializable { |
35 | 35 | |
36 | - /** |
|
37 | - * @param string $icon absolute URI to an icon |
|
38 | - * @since 12.0 |
|
39 | - */ |
|
40 | - public function setIcon($icon); |
|
36 | + /** |
|
37 | + * @param string $icon absolute URI to an icon |
|
38 | + * @since 12.0 |
|
39 | + */ |
|
40 | + public function setIcon($icon); |
|
41 | 41 | |
42 | - /** |
|
43 | - * @return string localized action name, e.g. 'Call' |
|
44 | - * @since 12.0 |
|
45 | - */ |
|
46 | - public function getName(); |
|
42 | + /** |
|
43 | + * @return string localized action name, e.g. 'Call' |
|
44 | + * @since 12.0 |
|
45 | + */ |
|
46 | + public function getName(); |
|
47 | 47 | |
48 | - /** |
|
49 | - * @param string $name localized action name, e.g. 'Call' |
|
50 | - * @since 12.0 |
|
51 | - */ |
|
52 | - public function setName($name); |
|
48 | + /** |
|
49 | + * @param string $name localized action name, e.g. 'Call' |
|
50 | + * @since 12.0 |
|
51 | + */ |
|
52 | + public function setName($name); |
|
53 | 53 | |
54 | - /** |
|
55 | - * @param int $priority priorize actions, high order ones are shown on top |
|
56 | - * @since 12.0 |
|
57 | - */ |
|
58 | - public function setPriority($priority); |
|
54 | + /** |
|
55 | + * @param int $priority priorize actions, high order ones are shown on top |
|
56 | + * @since 12.0 |
|
57 | + */ |
|
58 | + public function setPriority($priority); |
|
59 | 59 | |
60 | - /** |
|
61 | - * @return int priority to priorize actions, high order ones are shown on top |
|
62 | - * @since 12.0 |
|
63 | - */ |
|
64 | - public function getPriority(); |
|
60 | + /** |
|
61 | + * @return int priority to priorize actions, high order ones are shown on top |
|
62 | + * @since 12.0 |
|
63 | + */ |
|
64 | + public function getPriority(); |
|
65 | 65 | } |
@@ -28,27 +28,27 @@ |
||
28 | 28 | */ |
29 | 29 | interface IActionFactory { |
30 | 30 | |
31 | - /** |
|
32 | - * Construct and return a new link action for the contacts menu |
|
33 | - * |
|
34 | - * @since 12.0 |
|
35 | - * |
|
36 | - * @param string $icon full path to the action's icon |
|
37 | - * @param string $name localized name of the action |
|
38 | - * @param string $href target URL |
|
39 | - * @return ILinkAction |
|
40 | - */ |
|
41 | - public function newLinkAction($icon, $name, $href); |
|
31 | + /** |
|
32 | + * Construct and return a new link action for the contacts menu |
|
33 | + * |
|
34 | + * @since 12.0 |
|
35 | + * |
|
36 | + * @param string $icon full path to the action's icon |
|
37 | + * @param string $name localized name of the action |
|
38 | + * @param string $href target URL |
|
39 | + * @return ILinkAction |
|
40 | + */ |
|
41 | + public function newLinkAction($icon, $name, $href); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Construct and return a new email action for the contacts menu |
|
45 | - * |
|
46 | - * @since 12.0 |
|
47 | - * |
|
48 | - * @param string $icon full path to the action's icon |
|
49 | - * @param string $name localized name of the action |
|
50 | - * @param string $email target e-mail address |
|
51 | - * @return ILinkAction |
|
52 | - */ |
|
53 | - public function newEMailAction($icon, $name, $email); |
|
43 | + /** |
|
44 | + * Construct and return a new email action for the contacts menu |
|
45 | + * |
|
46 | + * @since 12.0 |
|
47 | + * |
|
48 | + * @param string $icon full path to the action's icon |
|
49 | + * @param string $name localized name of the action |
|
50 | + * @param string $email target e-mail address |
|
51 | + * @return ILinkAction |
|
52 | + */ |
|
53 | + public function newEMailAction($icon, $name, $email); |
|
54 | 54 | } |
@@ -29,15 +29,15 @@ |
||
29 | 29 | */ |
30 | 30 | interface ILinkAction extends IAction { |
31 | 31 | |
32 | - /** |
|
33 | - * @since 12.0 |
|
34 | - * @param string $href the target URL of the action |
|
35 | - */ |
|
36 | - public function setHref($href); |
|
32 | + /** |
|
33 | + * @since 12.0 |
|
34 | + * @param string $href the target URL of the action |
|
35 | + */ |
|
36 | + public function setHref($href); |
|
37 | 37 | |
38 | - /** |
|
39 | - * @since 12.0 |
|
40 | - * @return string |
|
41 | - */ |
|
42 | - public function getHref(); |
|
38 | + /** |
|
39 | + * @since 12.0 |
|
40 | + * @return string |
|
41 | + */ |
|
42 | + public function getHref(); |
|
43 | 43 | } |
@@ -24,44 +24,44 @@ |
||
24 | 24 | use OCP\Files\Search\ISearchComparison; |
25 | 25 | |
26 | 26 | class SearchComparison implements ISearchComparison { |
27 | - /** @var string */ |
|
28 | - private $type; |
|
29 | - /** @var string */ |
|
30 | - private $field; |
|
31 | - /** @var string|integer|\DateTime */ |
|
32 | - private $value; |
|
27 | + /** @var string */ |
|
28 | + private $type; |
|
29 | + /** @var string */ |
|
30 | + private $field; |
|
31 | + /** @var string|integer|\DateTime */ |
|
32 | + private $value; |
|
33 | 33 | |
34 | - /** |
|
35 | - * SearchComparison constructor. |
|
36 | - * |
|
37 | - * @param string $type |
|
38 | - * @param string $field |
|
39 | - * @param \DateTime|int|string $value |
|
40 | - */ |
|
41 | - public function __construct($type, $field, $value) { |
|
42 | - $this->type = $type; |
|
43 | - $this->field = $field; |
|
44 | - $this->value = $value; |
|
45 | - } |
|
34 | + /** |
|
35 | + * SearchComparison constructor. |
|
36 | + * |
|
37 | + * @param string $type |
|
38 | + * @param string $field |
|
39 | + * @param \DateTime|int|string $value |
|
40 | + */ |
|
41 | + public function __construct($type, $field, $value) { |
|
42 | + $this->type = $type; |
|
43 | + $this->field = $field; |
|
44 | + $this->value = $value; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @return string |
|
49 | - */ |
|
50 | - public function getType() { |
|
51 | - return $this->type; |
|
52 | - } |
|
47 | + /** |
|
48 | + * @return string |
|
49 | + */ |
|
50 | + public function getType() { |
|
51 | + return $this->type; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @return string |
|
56 | - */ |
|
57 | - public function getField() { |
|
58 | - return $this->field; |
|
59 | - } |
|
54 | + /** |
|
55 | + * @return string |
|
56 | + */ |
|
57 | + public function getField() { |
|
58 | + return $this->field; |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * @return \DateTime|int|string |
|
63 | - */ |
|
64 | - public function getValue() { |
|
65 | - return $this->value; |
|
66 | - } |
|
61 | + /** |
|
62 | + * @return \DateTime|int|string |
|
63 | + */ |
|
64 | + public function getValue() { |
|
65 | + return $this->value; |
|
66 | + } |
|
67 | 67 | } |
@@ -25,33 +25,33 @@ |
||
25 | 25 | use OCP\Files\Search\ISearchOrder; |
26 | 26 | |
27 | 27 | class SearchOrder implements ISearchOrder { |
28 | - /** @var string */ |
|
29 | - private $direction; |
|
30 | - /** @var string */ |
|
31 | - private $field; |
|
28 | + /** @var string */ |
|
29 | + private $direction; |
|
30 | + /** @var string */ |
|
31 | + private $field; |
|
32 | 32 | |
33 | - /** |
|
34 | - * SearchOrder constructor. |
|
35 | - * |
|
36 | - * @param string $direction |
|
37 | - * @param string $field |
|
38 | - */ |
|
39 | - public function __construct($direction, $field) { |
|
40 | - $this->direction = $direction; |
|
41 | - $this->field = $field; |
|
42 | - } |
|
33 | + /** |
|
34 | + * SearchOrder constructor. |
|
35 | + * |
|
36 | + * @param string $direction |
|
37 | + * @param string $field |
|
38 | + */ |
|
39 | + public function __construct($direction, $field) { |
|
40 | + $this->direction = $direction; |
|
41 | + $this->field = $field; |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @return string |
|
46 | - */ |
|
47 | - public function getDirection() { |
|
48 | - return $this->direction; |
|
49 | - } |
|
44 | + /** |
|
45 | + * @return string |
|
46 | + */ |
|
47 | + public function getDirection() { |
|
48 | + return $this->direction; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * @return string |
|
53 | - */ |
|
54 | - public function getField() { |
|
55 | - return $this->field; |
|
56 | - } |
|
51 | + /** |
|
52 | + * @return string |
|
53 | + */ |
|
54 | + public function getField() { |
|
55 | + return $this->field; |
|
56 | + } |
|
57 | 57 | } |