summaryrefslogtreecommitdiffstats
path: root/command
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-11-26 19:51:29 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2015-11-26 19:51:49 +0100
commit6f48a74ead80c57e291ca2be78645449e99ae5f0 (patch)
tree783d228246b38fe135f772461958d00f56900ac0 /command
parent050ca4af5a2c72ecd31305ed7b91afc4f411efa1 (diff)
add autoupdate for indices
Diffstat (limited to 'command')
-rw-r--r--command/migrate.php48
-rw-r--r--command/verifyinstall.php80
2 files changed, 0 insertions, 128 deletions
diff --git a/command/migrate.php b/command/migrate.php
deleted file mode 100644
index 364ceda42..000000000
--- a/command/migrate.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
- * ownCloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Bernhard Posselt 2015
- */
-
-namespace OCA\News\Command;
-
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Helper\ProgressBar;
-
-use OCA\News\Service\ItemService;
-
-
-class Migrate extends Command {
-
- private $service;
-
- public function __construct(ItemService $service) {
- parent::__construct();
- $this->service = $service;
- }
-
- protected function configure() {
- $this->setName('news:migrate')
- ->setDescription('Migrates the database schema. Needed when ' .
- 'updating from versions prior to: 7.0.0');
- }
-
- protected function execute(InputInterface $input, OutputInterface $output) {
- $output->writeln(
- "\nMigrating data, this could take a while...\n"
- );
- $progressbar = function ($steps) use ($output) {
- return new ProgressBar($output, $steps);
- };
- $this->service->generateSearchIndices($progressbar);
- $output->writeln("\n");
- }
-
-}
diff --git a/command/verifyinstall.php b/command/verifyinstall.php
deleted file mode 100644
index 4277ff6e7..000000000
--- a/command/verifyinstall.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-/**
- * ownCloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Bernhard Posselt 2015
- */
-
-namespace OCA\News\Command;
-
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Helper\ProgressBar;
-use Riimu\Kit\PathJoin\Path;
-
-use OCA\News\Utility\FileChecksumValidator;
-
-
-class VerifyInstall extends Command {
-
- private $fileChecksums;
-
- public function __construct($checksums) {
- parent::__construct();
- $this->fileChecksums = $checksums;
- }
-
- protected function configure() {
- $this->setName('news:verify-install')
- ->setDescription('Run this command to check if your News ' .
- 'installation has outdated or missing files.');
- }
-
- protected function execute(InputInterface $input, OutputInterface $output) {
- $checksums = json_decode($this->fileChecksums, true);
- $root = __DIR__ . '/../';
- $progressbar = new ProgressBar($output, count($checksums));
- $errors = [];
- $missing = [];
-
- foreach($checksums as $file => $checksum) {
- $progressbar->advance();
- $absPath = Path::normalize($root . $file);
-
- if (!file_exists($absPath)) {
- $missing[] = $absPath;
- } elseif (md5(file_get_contents($absPath)) !== $checksum) {
- $errors[] = $absPath;
- }
- }
-
- $output->writeln("\n");
-
- if (count($errors) > 0 || count($missing) > 0) {
- foreach ($missing as $path) {
- $output->writeln('<error>Missing file:</error> ' . $path);
- }
- foreach ($errors as $path) {
- $output->writeln('<error>Invalid checksum:</error> ' . $path);
- }
- $output->writeln("\nYour News installation does not " .
- 'match the recorded files and versions. This ' .
- 'is either caused by missing or old files or an ' .
- 'invalid or out of date appinfo/checksum.json ' .
- 'file.');
- $output->writeln('Either way, please make sure that the contents ' .
- 'of the News app\'s directory match the ' .
- 'contents of the installed tarball.');
- return 1;
- } else {
- $output->writeln('<info>Installation verified, everything OK!' .
- '</info>');
- }
- }
-
-}