From 52ea4aa8dd3824ed90da82bbd9a4975f04a7d710 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Sun, 29 Sep 2019 20:35:51 +0200 Subject: [PATCH] Add install step for dependencies --- README.md | 4 ++++ build.php | 6 ++++-- install.php | 11 +++++++++++ patch.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ update.php | 49 +------------------------------------------------ 5 files changed, 70 insertions(+), 50 deletions(-) create mode 100644 install.php create mode 100644 patch.php diff --git a/README.md b/README.md index f946767..4ef73a8 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,10 @@ The following features are supported: ## Compilation +You can install all dependencies of this project using the following command: + + php install.php + You can compile all files into a single "`api.php`" file using: php build.php diff --git a/build.php b/build.php index a9774b3..7b2a49d 100644 --- a/build.php +++ b/build.php @@ -1,5 +1,7 @@ $entry) { @@ -34,8 +36,8 @@ function runDir(string $base, string $dir, array &$lines, array $ignore): int $data = preg_replace('/\s*<\?php\s+/s', '', $data, 1); $data = preg_replace('/^.*?(vendor\/autoload|declare\s*\(\s*strict_types\s*=\s*1).*?$/m', '', $data); array_push($lines, "// file: $dir/$entry"); - if (!preg_match('/^\s*(namespace[^;]*);/', $data)){ - $data = "namespace;\n".$data; + if (!preg_match('/^\s*(namespace[^;]*);/', $data)) { + $data = "namespace;\n" . $data; } foreach (explode("\n", trim($data)) as $line) { if ($line) { diff --git a/install.php b/install.php new file mode 100644 index 0000000..51c32db --- /dev/null +++ b/install.php @@ -0,0 +1,11 @@ +