diff options
Diffstat (limited to 'apps/dav')
18 files changed, 75 insertions, 67 deletions
diff --git a/apps/dav/lib/Command/CreateAddressBook.php b/apps/dav/lib/Command/CreateAddressBook.php index 317b356772e..6bd175f91d3 100644 --- a/apps/dav/lib/Command/CreateAddressBook.php +++ b/apps/dav/lib/Command/CreateAddressBook.php @@ -64,7 +64,7 @@ class CreateAddressBook extends Command { 'Name of the addressbook'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $user = $input->getArgument('user'); if (!$this->userManager->userExists($user)) { throw new \InvalidArgumentException("User <$user> in unknown."); @@ -72,5 +72,6 @@ class CreateAddressBook extends Command { $name = $input->getArgument('name'); $this->cardDavBackend->createAddressBook("principals/users/$user", $name, []); + return 0; } } diff --git a/apps/dav/lib/Command/CreateCalendar.php b/apps/dav/lib/Command/CreateCalendar.php index 81a8773957a..d03b573e4ab 100644 --- a/apps/dav/lib/Command/CreateCalendar.php +++ b/apps/dav/lib/Command/CreateCalendar.php @@ -73,7 +73,7 @@ class CreateCalendar extends Command { 'Name of the calendar'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $user = $input->getArgument('user'); if (!$this->userManager->userExists($user)) { throw new \InvalidArgumentException("User <$user> in unknown."); @@ -94,5 +94,6 @@ class CreateCalendar extends Command { $name = $input->getArgument('name'); $caldav = new CalDavBackend($this->dbConnection, $principalBackend, $this->userManager, $this->groupManager, $random, $logger, $dispatcher); $caldav->createCalendar("principals/users/$user", $name, []); + return 0; } } diff --git a/apps/dav/lib/Command/ListCalendars.php b/apps/dav/lib/Command/ListCalendars.php index 85aa25be946..422202d9227 100644 --- a/apps/dav/lib/Command/ListCalendars.php +++ b/apps/dav/lib/Command/ListCalendars.php @@ -62,7 +62,7 @@ class ListCalendars extends Command { 'User for whom all calendars will be listed'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $user = $input->getArgument('uid'); if (!$this->userManager->userExists($user)) { throw new \InvalidArgumentException("User <$user> is unknown."); @@ -101,5 +101,6 @@ class ListCalendars extends Command { } else { $output->writeln("<info>User <$user> has no calendars</info>"); } + return 0; } } diff --git a/apps/dav/lib/Command/MoveCalendar.php b/apps/dav/lib/Command/MoveCalendar.php index d40f4600745..b89c64d7ba7 100644 --- a/apps/dav/lib/Command/MoveCalendar.php +++ b/apps/dav/lib/Command/MoveCalendar.php @@ -106,7 +106,7 @@ class MoveCalendar extends Command { ->addOption('force', 'f', InputOption::VALUE_NONE, "Force the migration by removing existing shares"); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $userOrigin = $input->getArgument('sourceuid'); $userDestination = $input->getArgument('destinationuid'); @@ -137,6 +137,7 @@ class MoveCalendar extends Command { $this->calDav->moveCalendar($name, self::URI_USERS . $userOrigin, self::URI_USERS . $userDestination); $this->io->success("Calendar <$name> was moved from user <$userOrigin> to <$userDestination>"); + return 0; } /** diff --git a/apps/dav/lib/Command/RemoveInvalidShares.php b/apps/dav/lib/Command/RemoveInvalidShares.php index 71644456f67..0129191c18b 100644 --- a/apps/dav/lib/Command/RemoveInvalidShares.php +++ b/apps/dav/lib/Command/RemoveInvalidShares.php @@ -57,7 +57,7 @@ class RemoveInvalidShares extends Command { ->setDescription('Remove invalid dav shares'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $query = $this->connection->getQueryBuilder(); $result = $query->selectDistinct('principaluri') ->from('dav_shares') @@ -72,6 +72,7 @@ class RemoveInvalidShares extends Command { } $result->closeCursor(); + return 0; } /** diff --git a/apps/dav/lib/Command/SendEventReminders.php b/apps/dav/lib/Command/SendEventReminders.php index 8313f265bfc..3eb7f1a56ee 100644 --- a/apps/dav/lib/Command/SendEventReminders.php +++ b/apps/dav/lib/Command/SendEventReminders.php @@ -67,19 +67,20 @@ class SendEventReminders extends Command { * @param InputInterface $input * @param OutputInterface $output */ - protected function execute(InputInterface $input, OutputInterface $output):void { + protected function execute(InputInterface $input, OutputInterface $output): int { if ($this->config->getAppValue('dav', 'sendEventReminders', 'yes') !== 'yes') { $output->writeln('<error>Sending event reminders disabled!</error>'); $output->writeln('<info>Please run "php occ config:app:set dav sendEventReminders --value yes"'); - return; + return 1; } if ($this->config->getAppValue('dav', 'sendEventRemindersMode', 'backgroundjob') !== 'occ') { $output->writeln('<error>Sending event reminders mode set to background-job!</error>'); $output->writeln('<info>Please run "php occ config:app:set dav sendEventRemindersMode --value occ"'); - return; + return 1; } $this->reminderService->processReminders(); + return 0; } } diff --git a/apps/dav/lib/Command/SyncBirthdayCalendar.php b/apps/dav/lib/Command/SyncBirthdayCalendar.php index 0addbc08a73..6536f8439a4 100644 --- a/apps/dav/lib/Command/SyncBirthdayCalendar.php +++ b/apps/dav/lib/Command/SyncBirthdayCalendar.php @@ -73,7 +73,7 @@ class SyncBirthdayCalendar extends Command { * @param InputInterface $input * @param OutputInterface $output */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $this->verifyEnabled(); $user = $input->getArgument('user'); @@ -91,7 +91,7 @@ class SyncBirthdayCalendar extends Command { $output->writeln("Start birthday calendar sync for $user"); $this->birthdayService->syncUser($user); - return; + return 0; } $output->writeln("Start birthday calendar sync for all users ..."); $p = new ProgressBar($output); @@ -111,6 +111,7 @@ class SyncBirthdayCalendar extends Command { $p->finish(); $output->writeln(''); + return 0; } protected function verifyEnabled() { diff --git a/apps/dav/lib/Command/SyncSystemAddressBook.php b/apps/dav/lib/Command/SyncSystemAddressBook.php index 26cb0aa6439..9fabc6de883 100644 --- a/apps/dav/lib/Command/SyncSystemAddressBook.php +++ b/apps/dav/lib/Command/SyncSystemAddressBook.php @@ -53,7 +53,7 @@ class SyncSystemAddressBook extends Command { * @param InputInterface $input * @param OutputInterface $output */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln('Syncing users ...'); $progress = new ProgressBar($output); $progress->start(); @@ -63,5 +63,6 @@ class SyncSystemAddressBook extends Command { $progress->finish(); $output->writeln(''); + return 0; } } diff --git a/apps/dav/lib/Migration/Version1005Date20180413093149.php b/apps/dav/lib/Migration/Version1005Date20180413093149.php index 3b02726ab72..dca148fbdfa 100644 --- a/apps/dav/lib/Migration/Version1005Date20180413093149.php +++ b/apps/dav/lib/Migration/Version1005Date20180413093149.php @@ -26,7 +26,7 @@ declare(strict_types=1); namespace OCA\DAV\Migration; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -47,26 +47,26 @@ class Version1005Date20180413093149 extends SimpleMigrationStep { if (!$schema->hasTable('directlink')) { $table = $schema->createTable('directlink'); - $table->addColumn('id',Type::BIGINT, [ + $table->addColumn('id',Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('user_id', Type::STRING, [ + $table->addColumn('user_id', Types::STRING, [ 'notnull' => false, 'length' => 64, ]); - $table->addColumn('file_id', Type::BIGINT, [ + $table->addColumn('file_id', Types::BIGINT, [ 'notnull' => true, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('token', Type::STRING, [ + $table->addColumn('token', Types::STRING, [ 'notnull' => false, 'length' => 60, ]); - $table->addColumn('expiration', Type::BIGINT, [ + $table->addColumn('expiration', Types::BIGINT, [ 'notnull' => true, 'length' => 11, 'unsigned' => true, diff --git a/apps/dav/lib/Migration/Version1005Date20180530124431.php b/apps/dav/lib/Migration/Version1005Date20180530124431.php index 71f6064c5c1..a270f903f10 100644 --- a/apps/dav/lib/Migration/Version1005Date20180530124431.php +++ b/apps/dav/lib/Migration/Version1005Date20180530124431.php @@ -26,7 +26,7 @@ namespace OCA\DAV\Migration; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -49,29 +49,29 @@ class Version1005Date20180530124431 extends SimpleMigrationStep { if (!$schema->hasTable('calendar_' . $type)) { $table = $schema->createTable('calendar_' . $type); - $table->addColumn('id', Type::BIGINT, [ + $table->addColumn('id', Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('backend_id', Type::STRING, [ + $table->addColumn('backend_id', Types::STRING, [ 'notnull' => false, 'length' => 64, ]); - $table->addColumn('resource_id', Type::STRING, [ + $table->addColumn('resource_id', Types::STRING, [ 'notnull' => false, 'length' => 64, ]); - $table->addColumn('email', Type::STRING, [ + $table->addColumn('email', Types::STRING, [ 'notnull' => false, 'length' => 255, ]); - $table->addColumn('displayname', Type::STRING, [ + $table->addColumn('displayname', Types::STRING, [ 'notnull' => false, 'length' => 255, ]); - $table->addColumn('group_restrictions', Type::STRING, [ + $table->addColumn('group_restrictions', Types::STRING, [ 'notnull' => false, 'length' => 4000, ]); diff --git a/apps/dav/lib/Migration/Version1006Date20180619154313.php b/apps/dav/lib/Migration/Version1006Date20180619154313.php index d3590a3ff48..883307c1132 100644 --- a/apps/dav/lib/Migration/Version1006Date20180619154313.php +++ b/apps/dav/lib/Migration/Version1006Date20180619154313.php @@ -25,7 +25,7 @@ */ namespace OCA\DAV\Migration; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -49,38 +49,38 @@ class Version1006Date20180619154313 extends SimpleMigrationStep { if (!$schema->hasTable('calendar_invitations')) { $table = $schema->createTable('calendar_invitations'); - $table->addColumn('id', Type::BIGINT, [ + $table->addColumn('id', Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('uid', Type::STRING, [ + $table->addColumn('uid', Types::STRING, [ 'notnull' => true, 'length' => 255, ]); - $table->addColumn('recurrenceid', Type::STRING, [ + $table->addColumn('recurrenceid', Types::STRING, [ 'notnull' => false, 'length' => 255, ]); - $table->addColumn('attendee', Type::STRING, [ + $table->addColumn('attendee', Types::STRING, [ 'notnull' => true, 'length' => 255, ]); - $table->addColumn('organizer', Type::STRING, [ + $table->addColumn('organizer', Types::STRING, [ 'notnull' => true, 'length' => 255, ]); - $table->addColumn('sequence', Type::BIGINT, [ + $table->addColumn('sequence', Types::BIGINT, [ 'notnull' => false, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('token', Type::STRING, [ + $table->addColumn('token', Types::STRING, [ 'notnull' => true, 'length' => 60, ]); - $table->addColumn('expiration', Type::BIGINT, [ + $table->addColumn('expiration', Types::BIGINT, [ 'notnull' => true, 'length' => 11, 'unsigned' => true, diff --git a/apps/dav/lib/Migration/Version1006Date20180628111625.php b/apps/dav/lib/Migration/Version1006Date20180628111625.php index 08a5951d8df..d83b23b27f6 100644 --- a/apps/dav/lib/Migration/Version1006Date20180628111625.php +++ b/apps/dav/lib/Migration/Version1006Date20180628111625.php @@ -28,7 +28,7 @@ declare(strict_types=1); namespace OCA\DAV\Migration; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -47,7 +47,7 @@ class Version1006Date20180628111625 extends SimpleMigrationStep { if ($schema->hasTable('calendarchanges')) { $calendarChangesTable = $schema->getTable('calendarchanges'); - $calendarChangesTable->addColumn('calendartype', Type::INTEGER, [ + $calendarChangesTable->addColumn('calendartype', Types::INTEGER, [ 'notnull' => true, 'default' => 0, ]); @@ -60,7 +60,7 @@ class Version1006Date20180628111625 extends SimpleMigrationStep { if ($schema->hasTable('calendarobjects')) { $calendarObjectsTable = $schema->getTable('calendarobjects'); - $calendarObjectsTable->addColumn('calendartype', Type::INTEGER, [ + $calendarObjectsTable->addColumn('calendartype', Types::INTEGER, [ 'notnull' => true, 'default' => 0, ]); @@ -73,7 +73,7 @@ class Version1006Date20180628111625 extends SimpleMigrationStep { if ($schema->hasTable('calendarobjects_props')) { $calendarObjectsPropsTable = $schema->getTable('calendarobjects_props'); - $calendarObjectsPropsTable->addColumn('calendartype', Type::INTEGER, [ + $calendarObjectsPropsTable->addColumn('calendartype', Types::INTEGER, [ 'notnull' => true, 'default' => 0, ]); diff --git a/apps/dav/lib/Migration/Version1008Date20181030113700.php b/apps/dav/lib/Migration/Version1008Date20181030113700.php index 97f1a72062b..530399cae5c 100644 --- a/apps/dav/lib/Migration/Version1008Date20181030113700.php +++ b/apps/dav/lib/Migration/Version1008Date20181030113700.php @@ -27,7 +27,7 @@ namespace OCA\DAV\Migration; use Closure; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -45,7 +45,7 @@ class Version1008Date20181030113700 extends SimpleMigrationStep { $schema = $schemaClosure(); $table = $schema->getTable('cards'); - $table->addColumn('uid', Type::STRING, [ + $table->addColumn('uid', Types::STRING, [ 'notnull' => false, 'length' => 255 ]); diff --git a/apps/dav/lib/Migration/Version1008Date20181105104826.php b/apps/dav/lib/Migration/Version1008Date20181105104826.php index cc80c6552c4..93a5163e6f0 100644 --- a/apps/dav/lib/Migration/Version1008Date20181105104826.php +++ b/apps/dav/lib/Migration/Version1008Date20181105104826.php @@ -27,7 +27,7 @@ declare(strict_types=1); namespace OCA\DAV\Migration; use Closure; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\IDBConnection; use OCP\Migration\IOutput; @@ -58,7 +58,7 @@ class Version1008Date20181105104826 extends SimpleMigrationStep { $schema = $schemaClosure(); $table = $schema->getTable('calendarsubscriptions'); - $table->addColumn('source_copy', Type::TEXT, [ + $table->addColumn('source_copy', Types::TEXT, [ 'notnull' => false, 'length' => null, ]); diff --git a/apps/dav/lib/Migration/Version1008Date20181105110300.php b/apps/dav/lib/Migration/Version1008Date20181105110300.php index e36ec34dd8d..55b14f3ccbf 100644 --- a/apps/dav/lib/Migration/Version1008Date20181105110300.php +++ b/apps/dav/lib/Migration/Version1008Date20181105110300.php @@ -27,7 +27,7 @@ declare(strict_types=1); namespace OCA\DAV\Migration; use Closure; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\IDBConnection; use OCP\Migration\IOutput; @@ -57,7 +57,7 @@ class Version1008Date20181105110300 extends SimpleMigrationStep { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); $table = $schema->getTable('calendarsubscriptions'); - $table->addColumn('source', Type::TEXT, [ + $table->addColumn('source', Types::TEXT, [ 'notnull' => false, 'length' => null, ]); diff --git a/apps/dav/lib/Migration/Version1011Date20190725113607.php b/apps/dav/lib/Migration/Version1011Date20190725113607.php index 4163d0d0ec6..5a25bf126dc 100644 --- a/apps/dav/lib/Migration/Version1011Date20190725113607.php +++ b/apps/dav/lib/Migration/Version1011Date20190725113607.php @@ -27,7 +27,7 @@ declare(strict_types=1); */ namespace OCA\DAV\Migration; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -53,22 +53,22 @@ class Version1011Date20190725113607 extends SimpleMigrationStep { if (!$schema->hasTable($this->getMetadataTableName($type))) { $table = $schema->createTable($this->getMetadataTableName($type)); - $table->addColumn('id', Type::BIGINT, [ + $table->addColumn('id', Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn($type . '_id', Type::BIGINT, [ + $table->addColumn($type . '_id', Types::BIGINT, [ 'notnull' => true, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('key', Type::STRING, [ + $table->addColumn('key', Types::STRING, [ 'notnull' => true, 'length' => 255, ]); - $table->addColumn('value', Type::STRING, [ + $table->addColumn('value', Types::STRING, [ 'notnull' => false, 'length' => 4000, ]); diff --git a/apps/dav/lib/Migration/Version1011Date20190806104428.php b/apps/dav/lib/Migration/Version1011Date20190806104428.php index 7b7a1c58986..e257a36bb61 100644 --- a/apps/dav/lib/Migration/Version1011Date20190806104428.php +++ b/apps/dav/lib/Migration/Version1011Date20190806104428.php @@ -28,7 +28,7 @@ declare(strict_types=1); namespace OCA\DAV\Migration; use Closure; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -48,21 +48,21 @@ class Version1011Date20190806104428 extends SimpleMigrationStep { $schema = $schemaClosure(); $table = $schema->createTable('dav_cal_proxy'); - $table->addColumn('id', Type::BIGINT, [ + $table->addColumn('id', Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('owner_id', Type::STRING, [ + $table->addColumn('owner_id', Types::STRING, [ 'notnull' => true, 'length' => 64, ]); - $table->addColumn('proxy_id', Type::STRING, [ + $table->addColumn('proxy_id', Types::STRING, [ 'notnull' => true, 'length' => 64, ]); - $table->addColumn('permissions', Type::INTEGER, [ + $table->addColumn('permissions', Types::INTEGER, [ 'notnull' => false, 'length' => 4, 'unsigned' => true, diff --git a/apps/dav/lib/Migration/Version1012Date20190808122342.php b/apps/dav/lib/Migration/Version1012Date20190808122342.php index 10e891d71a1..7aa51a224ec 100644 --- a/apps/dav/lib/Migration/Version1012Date20190808122342.php +++ b/apps/dav/lib/Migration/Version1012Date20190808122342.php @@ -28,7 +28,7 @@ declare(strict_types=1); namespace OCA\DAV\Migration; -use Doctrine\DBAL\Types\Type; +use Doctrine\DBAL\Types\Types; use OCP\DB\ISchemaWrapper; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -54,59 +54,59 @@ class Version1012Date20190808122342 extends SimpleMigrationStep { if (!$schema->hasTable('calendar_reminders')) { $table = $schema->createTable('calendar_reminders'); - $table->addColumn('id', Type::BIGINT, [ + $table->addColumn('id', Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('calendar_id', Type::BIGINT, [ + $table->addColumn('calendar_id', Types::BIGINT, [ 'notnull' => true, 'length' => 11, ]); - $table->addColumn('object_id', Type::BIGINT, [ + $table->addColumn('object_id', Types::BIGINT, [ 'notnull' => true, 'length' => 11, ]); - $table->addColumn('is_recurring', Type::SMALLINT, [ + $table->addColumn('is_recurring', Types::SMALLINT, [ 'notnull' => true, 'length' => 1, ]); - $table->addColumn('uid', Type::STRING, [ + $table->addColumn('uid', Types::STRING, [ 'notnull' => true, 'length' => 255, ]); - $table->addColumn('recurrence_id', Type::BIGINT, [ + $table->addColumn('recurrence_id', Types::BIGINT, [ 'notnull' => false, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('is_recurrence_exception', Type::SMALLINT, [ + $table->addColumn('is_recurrence_exception', Types::SMALLINT, [ 'notnull' => true, 'length' => 1, ]); - $table->addColumn('event_hash', Type::STRING, [ + $table->addColumn('event_hash', Types::STRING, [ 'notnull' => true, 'length' => 255, ]); - $table->addColumn('alarm_hash', Type::STRING, [ + $table->addColumn('alarm_hash', Types::STRING, [ 'notnull' => true, 'length' => 255, ]); - $table->addColumn('type', Type::STRING, [ + $table->addColumn('type', Types::STRING, [ 'notnull' => true, 'length' => 255, ]); - $table->addColumn('is_relative', Type::SMALLINT, [ + $table->addColumn('is_relative', Types::SMALLINT, [ 'notnull' => true, 'length' => 1, ]); - $table->addColumn('notification_date', Type::BIGINT, [ + $table->addColumn('notification_date', Types::BIGINT, [ 'notnull' => true, 'length' => 11, 'unsigned' => true, ]); - $table->addColumn('is_repeat_based', Type::SMALLINT, [ + $table->addColumn('is_repeat_based', Types::SMALLINT, [ 'notnull' => true, 'length' => 1, ]); |