summaryrefslogtreecommitdiffstats
path: root/lib/private/Migration
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-01 16:56:34 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-07-05 13:01:19 +0200
commit15eec7b83c6198a124c2720e8ecc988605428f54 (patch)
tree62f47bb629b621b883efb17c02194972ba20a71f /lib/private/Migration
parentefa52ec1113eeccbd3935a8c96ea23c47ca190ab (diff)
downloadnextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.tar.gz
nextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.zip
Start migrations
Fixme: - Install and update of apps - No revert on live systems (debug only) - Service adjustment to our interface - Loading via autoloader Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Migration')
-rw-r--r--lib/private/Migration/SimpleOutput.php84
1 files changed, 84 insertions, 0 deletions
diff --git a/lib/private/Migration/SimpleOutput.php b/lib/private/Migration/SimpleOutput.php
new file mode 100644
index 00000000000..b28fcbd7628
--- /dev/null
+++ b/lib/private/Migration/SimpleOutput.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * @author Thomas Müller <thomas.mueller@tmit.eu>
+ *
+ * @copyright Copyright (c) 2017, ownCloud GmbH
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+
+namespace OC\Migration;
+
+
+use OCP\ILogger;
+use OCP\Migration\IOutput;
+
+/**
+ * Class SimpleOutput
+ *
+ * Just a simple IOutput implementation with writes messages to the log file.
+ * Alternative implementations will write to the console or to the web ui (web update case)
+ *
+ * @package OC\Migration
+ */
+class SimpleOutput implements IOutput {
+
+ /** @var ILogger */
+ private $logger;
+ private $appName;
+
+ public function __construct(ILogger $logger, $appName) {
+ $this->logger = $logger;
+ $this->appName = $appName;
+ }
+
+ /**
+ * @param string $message
+ * @since 9.1.0
+ */
+ public function info($message) {
+ $this->logger->info($message, ['app' => $this->appName]);
+ }
+
+ /**
+ * @param string $message
+ * @since 9.1.0
+ */
+ public function warning($message) {
+ $this->logger->warning($message, ['app' => $this->appName]);
+ }
+
+ /**
+ * @param int $max
+ * @since 9.1.0
+ */
+ public function startProgress($max = 0) {
+ }
+
+ /**
+ * @param int $step
+ * @param string $description
+ * @since 9.1.0
+ */
+ public function advance($step = 1, $description = '') {
+ }
+
+ /**
+ * @since 9.1.0
+ */
+ public function finishProgress() {
+ }
+}