$file = file(__FILE__);
$in = new pq\COPY($c, "copy_test (line)", pq\COPY::FROM_STDIN, "DELIMITER '\t'");
+
+var_dump(
+ $c === $in->connection,
+ "copy_test (line)" === $in->expression,
+ pq\COPY::FROM_STDIN === $in->direction,
+ "DELIMITER '\t'" === $in->options
+);
+
foreach ($file as $i => $line) {
$in->put(addcslashes($line, "\\\t"));
}
$in->end();
$out = new pq\COPY($c, "copy_test (line)", pq\COPY::TO_STDOUT, "DELIMITER '\t'");
+
+var_dump(
+ $c === $out->connection,
+ "copy_test (line)" === $out->expression,
+ pq\COPY::TO_STDOUT === $out->direction,
+ "DELIMITER '\t'" === $out->options
+);
+
while ($out->get($line)) {
$lines[] = stripcslashes($line);
}
--EXPECT--
Test
bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
DONE