From 1f993d37b3065dfaa47787ccddc24d13d2d3966b Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 17 Oct 2014 19:25:45 +0200 Subject: [PATCH] Added warning support to migration script --- scripts/migrate-szuru1.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/migrate-szuru1.php b/scripts/migrate-szuru1.php index 66816a43..f4fa7a42 100644 --- a/scripts/migrate-szuru1.php +++ b/scripts/migrate-szuru1.php @@ -55,11 +55,16 @@ function removeRecursively($dir) abstract class Task { + private $warnings = []; + public function execute() { echo $this->getDescription() . '...'; $this->run(); echo PHP_EOL; + + foreach ($this->warnings as $message) + echo 'Warning: ' . $message . PHP_EOL; } protected function progress() @@ -67,6 +72,11 @@ abstract class Task echo '.'; } + protected function warn($message) + { + $this->warnings[] = $message; + } + protected function withProgress($source, $callback, $chunkSize = 666, callable $callbackLoopRunner = null) { if ($source instanceof \Traversable)