summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2016-06-09 16:32:27 +0200
committerUrban Müller2016-06-09 16:32:27 +0200
commit0ac54018f481c9d4f18a2874ff3da071ec431929 (patch)
treeec9f3fd07be01d746ae6bdabbbd78b47ebcfc33c
parent6c59336f4a8adb5cc31934b04409ed0d54b5fbb4 (diff)
downloaditools-0ac54018f481c9d4f18a2874ff3da071ec431929.tar.gz
itools-0ac54018f481c9d4f18a2874ff3da071ec431929.tar.bz2
itools-0ac54018f481c9d4f18a2874ff3da071ec431929.zip
better err msg
-rw-r--r--it_pipe.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_pipe.class b/it_pipe.class
index 6b43466..8b240ed 100644
--- a/it_pipe.class
+++ b/it_pipe.class
@@ -172,7 +172,7 @@ function csv($forceschema = null)
setlocale(LC_CTYPE, 'de_CH.iso-8859-1'); # this works for utf-8 as well
foreach ($this->lines as $line)
- $records[] = (object)array_combine($cols, str_getcsv($line, $splitchar, '"')); # could do a function_exists('str_getcsv') here...
+ $records[] = (object)(($t = array_combine($cols, $t2 = str_getcsv($line, $splitchar, '"'))) ? $t : it::error("schema mismatch: " . count($cols) . " vs " . count($t2))); # NOPHPLINT
setlocale(LC_CTYPE, $oldlocale);