);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appId = $input->getArgument('app-id');
$checkList = new EmptyCheck();
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appIds = $input->getArgument('app-id');
foreach ($appIds as $appId) {
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appIds = $input->getArgument('app-id');
$groups = $this->resolveGroupIds($input->getOption('groups'));
$forceEnable = (bool) $input->getOption('force');
* @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) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$path = \OC_App::getAppPath($appName);
if ($path !== false) {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appId = $input->getArgument('app-id');
if (\OC_App::getAppPath($appId)) {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if ($input->getOption('shipped') === 'true' || $input->getOption('shipped') === 'false') {
$shippedFilter = $input->getOption('shipped') === 'true';
} else {
}
$this->writeAppList($input, $output, $apps);
+ return 0;
}
/**
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appId = $input->getArgument('app-id');
// Check if the app is installed
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$singleAppId = $input->getArgument('app-id');
if ($singleAppId) {
* @param \OCP\IConfig $config
*/
public function __construct(IConfig $config) {
- $this->config = $config;
parent::__construct();
+ $this->config = $config;
}
protected function configure() {
* @param InputInterface $input
* @param OutputInterface $output
*/
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$mode = $this->getMode();
$this->config->setAppValue('core', 'backgroundjobs_mode', $mode);
$output->writeln("Set mode for background jobs to '$mode'");
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$name = $input->getArgument('name');
$uid = $input->getArgument('uid');
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$errors = \OC_Util::checkServer($this->config);
if (!empty($errors)) {
$errors = array_map(function ($item) {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$configName = $input->getArgument('name');
* @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) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$configName = $input->getArgument('name');
$defaultValue = $input->getOption('default-value');
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$configName = $input->getArgument('name');
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$importFile = $input->getArgument('file');
if ($importFile !== null) {
$content = $this->getArrayFromFile($importFile);
$configs = $this->validateFileContent($content);
} catch (\UnexpectedValueException $e) {
$output->writeln('<error>' . $e->getMessage(). '</error>');
- return;
+ return 1;
}
if (!empty($configs['system'])) {
}
$output->writeln('<info>Config successfully imported from: ' . $importFile . '</info>');
+ return 0;
}
/**
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$app = $input->getArgument('app');
$noSensitiveValues = !$input->getOption('private');
}
$this->writeArrayInOutputFormat($input, $output, $configs);
+ return 0;
}
/**
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$configNames = $input->getArgument('name');
$configName = $configNames[0];
* @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) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$configNames = $input->getArgument('name');
$configName = array_shift($configNames);
$defaultValue = $input->getOption('default-value');
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$configNames = $input->getArgument('name');
$configName = $configNames[0];
$configValue = $this->castValue($input->getOption('value'), $input->getOption('type'));
->setDescription('Add missing optional columns to the database tables');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$this->addCoreColumns($output);
// Dispatch event so apps can also update columns if needed
$event = new GenericEvent($output);
$this->dispatcher->dispatch(IDBConnection::ADD_MISSING_COLUMNS_EVENT, $event);
+ return 0;
}
/**
->setDescription('Add missing indices to the database tables');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$this->addCoreIndexes($output);
// Dispatch event so apps can also update indexes if needed
$event = new GenericEvent($output);
$this->dispatcher->dispatch(IDBConnection::ADD_MISSING_INDEXES_EVENT, $event);
+ return 0;
}
/**
];
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$schema = new SchemaWrapper($this->connection);
$isSqlite = $this->connection->getDatabasePlatform() instanceof SqlitePlatform;
$updates = [];
->setDescription('Convert charset of MySQL/MariaDB to use utf8mb4');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if (!$this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
$output->writeln("This command is only valid for MySQL/MariaDB databases.");
return 1;
}
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$this->validateInput($input, $output);
$this->readPassword($input, $output);
$helper = $this->getHelper('question');
if (!$helper->ask($input, $output, $question)) {
- return;
+ return 1;
}
}
$intersectingTables = array_intersect($toTables, $fromTables);
$this->convertDB($fromDB, $toDB, $intersectingTables, $input, $output);
+ return 0;
}
protected function createSchema(Connection $fromDB, Connection $toDB, InputInterface $input, OutputInterface $output) {
* @param OutputInterface $output
* @return int
*/
- public function execute(InputInterface $input, OutputInterface $output) {
+ public function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output));
$version = $input->getArgument('version');
parent::configure();
}
- public function execute(InputInterface $input, OutputInterface $output) {
+ public function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$version = $input->getArgument('version');
$this->setName('migrations:generate-from-schema');
}
- public function execute(InputInterface $input, OutputInterface $output) {
+ public function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$version = $input->getArgument('version');
parent::configure();
}
- public function execute(InputInterface $input, OutputInterface $output) {
+ public function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output));
$version = $input->getArgument('version');
$ms->migrate($version);
+ return 0;
}
/**
->addArgument('app', InputArgument::REQUIRED, 'Name of the app this migration command shall work on');
}
- public function execute(InputInterface $input, OutputInterface $output) {
+ public function execute(InputInterface $input, OutputInterface $output): int {
$appName = $input->getArgument('app');
$ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output));
$output->writeln(" <comment>>></comment> $key: " . str_repeat(' ', 50 - strlen($key)) . $value);
}
}
+ return 0;
}
/**
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$oldRoot = $this->util->getKeyStorageRoot();
$newRoot = $input->getArgument('newRoot');
if ($newRoot === null) {
$question = new ConfirmationQuestion('No storage root given, do you want to reset the key storage root to the default location? (y/n) ', false);
if (!$this->questionHelper->ask($input, $output, $question)) {
- return;
+ return 1;
}
$newRoot = '';
}
$this->util->setKeyStorageRoot($newRoot);
$output->writeln('');
$output->writeln("Key storage root successfully changed to <info>$newRootDescription</info>");
+ return 0;
}
+ return 1;
}
/**
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if (!$input->isInteractive()) {
$output->writeln('Invalid TTY.');
$output->writeln('If you are trying to execute the command in a Docker ');
$output->writeln("container, do not forget to execute 'docker exec' with");
$output->writeln("the '-i' and '-t' options.");
$output->writeln('');
- return;
+ return 1;
}
$isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false);
$output->writeln("in order to load the relevant encryption modules correctly.");
$output->writeln("Your instance will automatically be put to maintenance mode");
$output->writeln("during the actual decryption of the files.");
- return;
+ return 1;
}
try {
$output->writeln('done.');
} else {
$output->writeln('Server side encryption not enabled. Nothing to do.');
- return;
+ return 0;
}
$uid = $input->getArgument('user');
$this->config->setAppValue('core', 'encryption_enabled', 'yes');
}
$this->resetMaintenanceAndTrashbin();
+ return 0;
} else {
$output->write('Enable server side encryption... ');
$this->config->setAppValue('core', 'encryption_enabled', 'yes');
$output->writeln('done.');
$output->writeln('aborted');
+ return 1;
}
} catch (\Exception $e) {
// enable server side encryption again if something went wrong
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if ($this->config->getAppValue('core', 'encryption_enabled', 'no') !== 'yes') {
$output->writeln('Encryption is already disabled');
} else {
$this->config->setAppValue('core', 'encryption_enabled', 'no');
$output->writeln('<info>Encryption disabled</info>');
}
+ return 0;
}
}
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if ($this->config->getAppValue('core', 'encryption_enabled', 'no') === 'yes') {
$output->writeln('Encryption is already enabled');
} else {
$modules = $this->encryptionManager->getEncryptionModules();
if (empty($modules)) {
$output->writeln('<error>No encryption module is loaded</error>');
+ return 1;
} else {
$defaultModule = $this->config->getAppValue('core', 'default_encryption_module', null);
if ($defaultModule === null) {
$output->writeln('<error>No default module is set</error>');
+ return 1;
} elseif (!isset($modules[$defaultModule])) {
$output->writeln('<error>The current default module does not exist: ' . $defaultModule . '</error>');
+ return 1;
} else {
$output->writeln('Default module: ' . $defaultModule);
}
}
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if (!$input->isInteractive()) {
$output->writeln('Invalid TTY.');
$output->writeln('If you are trying to execute the command in a Docker ');
$output->writeln("container, do not forget to execute 'docker exec' with");
$output->writeln("the '-i' and '-t' options.");
$output->writeln('');
- return;
+ return 1;
}
if ($this->encryptionManager->isEnabled() === false) {
$this->resetMaintenanceAndTrashbin();
} else {
$output->writeln('aborted');
+ return 1;
}
+ return 0;
}
}
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false);
if ($isMaintenanceModeEnabled) {
$output->writeln("Maintenance mode must be disabled when listing modules");
$output->writeln("in order to list the relevant encryption modules correctly.");
- return;
+ return 1;
}
$encryptionModules = $this->encryptionManager->getEncryptionModules();
$encModules[$module['id']]['default'] = $module['id'] === $defaultEncryptionModuleId;
}
$this->writeModuleList($input, $output, $encModules);
+ return 0;
}
/**
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false);
if ($isMaintenanceModeEnabled) {
$output->writeln("Maintenance mode must be disabled when setting default module,");
$output->writeln("in order to load the relevant encryption modules correctly.");
- return;
+ return 1;
}
$moduleId = $input->getArgument('module');
$output->writeln('<info>Set default module to "' . $moduleId . '"</info>');
} else {
$output->writeln('<error>The specified module "' . $moduleId . '" does not exist</error>');
+ return 1;
}
+ return 0;
}
}
->setDescription('Show current key storage root');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$currentRoot = $this->util->getKeyStorageRoot();
$rootDescription = $currentRoot !== '' ? $currentRoot : 'default storage location (data/)';
$output->writeln("Current key storage root: <info>$rootDescription</info>");
+ return 0;
}
}
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$this->writeArrayInOutputFormat($input, $output, [
'enabled' => $this->encryptionManager->isEnabled(),
'defaultModule' => $this->encryptionManager->getDefaultEncryptionModuleId(),
]);
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$gid = $input->getArgument('groupid');
$group = $this->groupManager->get($gid);
if ($group) {
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$group = $this->groupManager->get($input->getArgument('group'));
if (is_null($group)) {
$output->writeln('<error>group not found</error>');
return 1;
}
$group->addUser($user);
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$gid = $input->getArgument('groupid');
if ($gid === 'admin') {
$output->writeln('<error>Group "' . $gid . '" could not be deleted.</error>');
$output->writeln('<error>Group "' . $gid . '" could not be deleted. Please check the logs.</error>');
return 1;
}
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$groups = $this->groupManager->search('', (int)$input->getOption('limit'), (int)$input->getOption('offset'));
$this->writeArrayInOutputFormat($input, $output, $this->formatGroups($groups));
+ return 0;
}
/**
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$group = $this->groupManager->get($input->getArgument('group'));
if (is_null($group)) {
$output->writeln('<error>group not found</error>');
return 1;
}
$group->removeUser($user);
+ return 0;
}
}
/**
* {@inheritdoc }
*/
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appid = $input->getArgument('appid');
$path = (string)$input->getOption('path');
$result = $this->checker->verifyAppSignature($appid, $path);
if (count($result)>0) {
return 1;
}
+ return 0;
}
}
/**
* {@inheritdoc }
*/
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$result = $this->checker->verifyCoreSignature();
$this->writeArrayInOutputFormat($input, $output, $result);
if (count($result)>0) {
return 1;
}
+ return 0;
}
}
/**
* {@inheritdoc }
*/
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$path = $input->getOption('path');
$privateKeyPath = $input->getOption('privateKey');
$keyBundlePath = $input->getOption('certificate');
$output->writeln('This command requires the --path, --privateKey and --certificate.');
$output->writeln('Example: ./occ integrity:sign-app --path="/Users/lukasreschke/Programming/myapp/" --privateKey="/Users/lukasreschke/private/myapp.key" --certificate="/Users/lukasreschke/public/mycert.crt"');
$output->writeln('For more information please consult the documentation: '. $documentationUrl);
- return null;
+ return 1;
}
$privateKey = $this->fileAccessHelper->file_get_contents($privateKeyPath);
if ($privateKey === false) {
$output->writeln(sprintf('Private key "%s" does not exists.', $privateKeyPath));
- return null;
+ return 1;
}
if ($keyBundle === false) {
$output->writeln(sprintf('Certificate "%s" does not exists.', $keyBundlePath));
- return null;
+ return 1;
}
$rsa = new RSA();
/**
* {@inheritdoc }
*/
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$privateKeyPath = $input->getOption('privateKey');
$keyBundlePath = $input->getOption('certificate');
$path = $input->getOption('path');
if (is_null($privateKeyPath) || is_null($keyBundlePath) || is_null($path)) {
$output->writeln('--privateKey, --certificate and --path are required.');
- return null;
+ return 1;
}
$privateKey = $this->fileAccessHelper->file_get_contents($privateKeyPath);
if ($privateKey === false) {
$output->writeln(sprintf('Private key "%s" does not exists.', $privateKeyPath));
- return null;
+ return 1;
}
if ($keyBundle === false) {
$output->writeln(sprintf('Certificate "%s" does not exists.', $keyBundlePath));
- return null;
+ return 1;
}
$rsa = new RSA();
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$app = $input->getArgument('app');
$lang = $input->getArgument('lang');
$path = \OC_App::getAppPath($app);
if ($path === false) {
$output->writeln("The app <$app> is unknown.");
- return;
+ return 1;
}
$languages = $lang;
if (empty($lang)) {
foreach ($languages as $lang) {
$this->writeFiles($app, $path, $lang, $output);
}
+ return 0;
}
private function getAllLanguages($path) {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$toBeSet = [];
if ($input->getOption('enable')) {
$rotateString = 'disabled';
}
$output->writeln('Rotate at: '.$rotateString);
+ return 0;
}
/**
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
// collate config setting to the end, to avoid partial configuration
$toBeSet = [];
$timezone = $this->config->getSystemValue('logtimezone', self::DEFAULT_TIMEZONE);
$output->writeln('Log timezone: '.$timezone);
+ return 0;
}
/**
->setDescription('update the systems data-fingerprint after a backup is restored');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$this->config->setSystemValue('data-fingerprint', md5($this->timeFactory->getTime()));
+ return 0;
}
}
->addOption('data-dir', null, InputOption::VALUE_REQUIRED, 'Path to data directory', \OC::$SERVERROOT."/data");
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
// validate the environment
$server = \OC::$server;
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$mappings = $this->mimetypeDetector->getAllMappings();
$totalFilecacheUpdates = 0;
$output->writeln('Added '.$totalNewMimetypes.' new mimetypes');
$output->writeln('Updated '.$totalFilecacheUpdates.' filecache rows');
+ return 0;
}
}
->setDescription('Update mimetypelist.js');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
// Fetch all the aliases
$aliases = $this->mimetypeDetector->getAllAliases();
file_put_contents(\OC::$SERVERROOT.'/core/js/mimetypelist.js', $generatedMimetypeFile->generateFile($aliases));
$output->writeln('<info>mimetypelist.js is updated');
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$maintenanceMode = $this->config->getSystemValueBool('maintenance');
if ($input->getOption('on')) {
if ($maintenanceMode === false) {
$output->writeln('Maintenance mode is currently disabled');
}
}
+ return 0;
}
}
'Use this option when you want to include resource and load expensive tasks');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$repairSteps = $this->repair::getRepairSteps();
if ($input->getOption('include-expensive')) {
$this->repair->run();
$this->config->setSystemValue('maintenance', $maintenanceMode);
+ return 0;
}
public function handleRepairFeedBack($event) {
->setDescription('Updates the .htaccess file');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if (\OC\Setup::updateHtaccess()) {
$output->writeln('.htaccess has been updated');
return 0;
->setDescription('Apply custom theme changes');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
// run mimetypelist.js update since themes might change mimetype icons
parent::execute($input, $output);
$c = $this->cacheFactory->createDistributed('imagePath');
$c->clear('');
$output->writeln('<info>Image cache cleared</info>');
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$path = $input->getArgument('path');
if (!file_exists($path)) {
$output->writeln('<error>certificate not found</error>');
- return;
+ return 1;
}
$certData = file_get_contents($path);
$name = basename($path);
$this->certificateManager->addCertificate($certData, $name);
+ return 0;
}
}
parent::configure();
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$outputType = $input->getOption('output');
if ($outputType === self::OUTPUT_FORMAT_JSON || $outputType === self::OUTPUT_FORMAT_JSON_PRETTY) {
$certificates = array_map(function (ICertificate $certificate) {
$table->setRows($rows);
$table->render();
}
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$name = $input->getArgument('name');
$this->certificateManager->removeCertificate($name);
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$ip = $input->getArgument('ipaddress');
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
}
$this->throttler->resetDelayForIP($ip);
+ return 0;
}
}
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$values = [
'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false),
'version' => implode('.', \OCP\Util::getVersion()),
];
$this->writeArrayInOutputFormat($input, $output, $values);
+ return 0;
}
}
$this->addArgument('provider-id', InputArgument::REQUIRED);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$providerId = $input->getArgument('provider-id');
$this->registry->cleanUp($providerId);
$output->writeln("<info>All user-provider associations for provider <options=bold>$providerId</> have been removed.</info>");
+ return 0;
}
}
$this->addArgument('provider_id', InputArgument::REQUIRED);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
$providerId = $input->getArgument('provider_id');
$user = $this->userManager->get($uid);
$this->addArgument('provider_id', InputArgument::REQUIRED);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
$providerId = $input->getArgument('provider_id');
$user = $this->userManager->get($uid);
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if ($input->getOption('on')) {
$enforcedGroups = $input->getOption('group');
$excludedGroups = $input->getOption('exclude');
} else {
$this->writeNotEnforced($output);
}
+ return 0;
}
/**
$this->addArgument('uid', InputArgument::REQUIRED);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
$user = $this->userManager->get($uid);
if (is_null($user)) {
* @param InputInterface $input input interface
* @param OutputInterface $output output interface
*/
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
if (Util::needUpgrade()) {
if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) {
// Prepend each line with a little timestamp
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
if ($this->userManager->userExists($uid)) {
$output->writeln('<error>The user "' . $uid . '" already exists.</error>');
$output->writeln('User "' . $user->getUID() . '" added to group "' . $group->getGID() . '"');
}
}
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$user = $this->userManager->get($input->getArgument('uid'));
if (is_null($user)) {
$output->writeln('<error>User does not exist</error>');
- return;
+ return 0;
}
if ($user->delete()) {
$output->writeln('<info>The specified user was deleted</info>');
- return;
+ return 0;
}
$output->writeln('<error>The specified user could not be deleted. Please check the logs.</error>');
+ return 1;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$user = $this->userManager->get($input->getArgument('uid'));
if (is_null($user)) {
$output->writeln('<error>User does not exist</error>');
- return;
+ return 1;
}
$user->setEnabled(false);
$output->writeln('<info>The specified user is disabled</info>');
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$user = $this->userManager->get($input->getArgument('uid'));
if (is_null($user)) {
$output->writeln('<error>User does not exist</error>');
- return;
+ return 1;
}
$user->setEnabled(true);
$output->writeln('<info>The specified user is enabled</info>');
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$user = $this->userManager->get($input->getArgument('user'));
if (is_null($user)) {
$output->writeln('<error>user not found</error>');
'backend' => $user->getBackendClassName()
];
$this->writeArrayInOutputFormat($input, $output, $data);
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$user = $this->userManager->get($input->getArgument('uid'));
if (is_null($user)) {
$output->writeln('<error>User does not exist</error>');
- return;
+ return 1;
}
$lastLogin = $user->getLastLogin();
$output->writeln($user->getUID() .
'`s last login: ' . $date->format('d.m.Y H:i'));
}
+ return 0;
}
}
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$users = $this->userManager->search('', (int) $input->getOption('limit'), (int) $input->getOption('offset'));
$this->writeArrayInOutputFormat($input, $output, $this->formatUsers($users, (bool)$input->getOption('info')));
+ return 0;
}
/**
$keys = array_map(function (IUser $user) {
return $user->getUID();
}, $users);
-
+
$values = array_map(function (IUser $user) use ($detailed) {
if ($detailed) {
$groups = $this->groupManager->getUserGroupIds($user);
->setDescription('shows how many users have access');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$table = new Table($output);
$table->setHeaders(['User Report', '']);
$userCountArray = $this->countUsers();
$table->setRows($rows);
$table->render();
+ return 0;
}
private function countUsers() {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$username = $input->getArgument('user');
/** @var $user \OCP\IUser */
$output->writeln("<error>Error while resetting password!</error>");
return 1;
}
+ return 0;
}
}
}
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
try {
$this->checkInput($input);
} catch (\InvalidArgumentException $e) {