From 76aa81b3164fb0d6b9674579ef8d466e3fa3c508 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Thu, 1 Sep 2022 16:50:01 +0200 Subject: Import concat.php --- concat/concat.php | 77 +++++++++++++++++++++++++++++++++++++++++++++ concat/test.sh | 2 ++ concat/testfiles/a.php | 1 + concat/testfiles/b.php | 5 +++ concat/testfiles/c.php | 2 ++ concat/testfiles/result.php | 12 +++++++ 6 files changed, 99 insertions(+) create mode 100644 concat/concat.php create mode 100755 concat/test.sh create mode 100644 concat/testfiles/a.php create mode 100644 concat/testfiles/b.php create mode 100644 concat/testfiles/c.php create mode 100644 concat/testfiles/result.php diff --git a/concat/concat.php b/concat/concat.php new file mode 100644 index 0000000..6594fd9 --- /dev/null +++ b/concat/concat.php @@ -0,0 +1,77 @@ +'.PHP_EOL, 0 ]; + } + +} /* foreach args */ + +/* Optionnal : output T_CLOSE_TAG if was deferred and it's the last file +if ( is_array($deferred_close_tag) ) { + echo $deferred_close_tag[1]; +}*/ diff --git a/concat/test.sh b/concat/test.sh new file mode 100755 index 0000000..7aab13f --- /dev/null +++ b/concat/test.sh @@ -0,0 +1,2 @@ +#!/bin/bash +diff -sy <(php concat.php testfiles/?.php) testfiles/result.php diff --git a/concat/testfiles/a.php b/concat/testfiles/a.php new file mode 100644 index 0000000..068821b --- /dev/null +++ b/concat/testfiles/a.php @@ -0,0 +1 @@ +HTML2 +HTML3 + +HTML +HTML2 +HTML3 +