/**
  * @inheritdoc
  */
 public function run(IOutput $output)
 {
     $output->startProgress();
     $output->advance(1, "Migrate states");
     $this->convStateMapper->migrate();
     $output->finishProgress();
 }
 /**
  * @param IOutput $output
  */
 public function run(IOutput $output)
 {
     $output->startProgress(2);
     $this->fixUserRootPermissions();
     $output->advance();
     $this->fixAvatarPermissions();
     $output->finishProgress();
 }
示例#3
0
 /**
  * @inheritdoc
  */
 public function run(IOutput $output)
 {
     $output->startProgress();
     $this->userManager->callForAllUsers(function ($user) use($output) {
         /** @var IUser $user */
         $output->advance(1, $user->getDisplayName());
         $this->birthdayService->syncUser($user->getUID());
     });
     $output->finishProgress();
 }
示例#4
0
 /**
  * @param IOutput $output
  */
 private function removeContactShares(IOutput $output)
 {
     $qb = $this->connection->getQueryBuilder();
     $qb->delete('share')->where($qb->expr()->eq('item_type', $qb->createNamedParameter('contact')));
     $qb->execute();
     $output->advance();
     $qb = $this->connection->getQueryBuilder();
     $qb->delete('share')->where($qb->expr()->eq('item_type', $qb->createNamedParameter('addressbook')));
     $qb->execute();
     $output->advance();
 }
示例#5
0
 /**
  * Run repair step.
  * Must throw exception on error.
  *
  * @throws \Exception in case of failure
  */
 public function run(IOutput $output)
 {
     $tables = $this->oldDatabaseTables();
     $output->startProgress(count($tables));
     foreach ($this->oldDatabaseTables() as $tableName) {
         if ($this->connection->tableExists($tableName)) {
             $this->connection->dropTable($tableName);
         }
         $output->advance(1, "Drop old database table: {$tableName}");
     }
     $output->finishProgress();
 }
示例#6
0
 /**
  * @param IOutput $output
  */
 private function removeRootShares(IOutput $output)
 {
     $function = function (IUser $user) use($output) {
         $userFolder = $this->rootFolder->getUserFolder($user->getUID());
         $fileId = $userFolder->getId();
         $qb = $this->connection->getQueryBuilder();
         $qb->delete('share')->where($qb->expr()->eq('file_source', $qb->createNamedParameter($fileId)))->andWhere($qb->expr()->orX($qb->expr()->eq('item_type', $qb->expr()->literal('file')), $qb->expr()->eq('item_type', $qb->expr()->literal('folder'))));
         $qb->execute();
         $output->advance();
     };
     $userCount = $this->countUsers();
     $output->startProgress($userCount);
     $this->userManager->callForAllUsers($function);
     $output->finishProgress();
 }