From c0534db585236af8ca3723632cf73754cff345f7 Mon Sep 17 00:00:00 2001 From: Nick Freear Date: Mon, 11 Dec 2017 14:01:03 +0000 Subject: [PATCH] Bug #6, stderr fix to `bin/csv-import` commandline PHP [iet:10277221] * [iet:10277034] --- bin/csv-import.php | 3 ++- db/User.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/csv-import.php b/bin/csv-import.php index 0d0d426..b543f26 100755 --- a/bin/csv-import.php +++ b/bin/csv-import.php @@ -63,9 +63,10 @@ if (FANCY_PROGRESS) { $bar->progress(); } else { - cli_write('.'); + fwrite(STDERR, '.'); // Was: cli_write('.'); } }); +fwrite(STDERR, "\n"); if (FANCY_PROGRESS) { $bar->end(); } diff --git a/db/User.php b/db/User.php index b51e67b..fa73fea 100644 --- a/db/User.php +++ b/db/User.php @@ -166,8 +166,8 @@ protected static function validateOucu($oucu, $row) { if (!preg_match(self::OUCU_REGEX, $oucu)) { self::$warnings[] = [ 'row' => $row, 'msg' => 'Unexpected OUCU', 'oucu' => $oucu ]; - echo 'W'; - //throw new Exception('Unexpected OUCU format: ' . $oucu); + fwrite(STDERR, 'W'); // Was: echo 'W'; + // Was: throw new Exception('Unexpected OUCU format: ' . $oucu); } return $oucu; }