From bcd7365f764a6bc374f2d39cbdea0e3aa5d4cad0 Mon Sep 17 00:00:00 2001 From: southerntofu Date: Tue, 29 Sep 2020 12:27:33 +0200 Subject: [PATCH] First commit --- .gitignore | 1 + README.md | 3 + index.php | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++ server | 14 +++++ 4 files changed, 189 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 index.php create mode 100755 server diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..726c3ca --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.*.sw* diff --git a/README.md b/README.md new file mode 100644 index 0000000..ab7f7fb --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# forge-endpoints.php + +PHP implementation of the forgehook endpoints. The server script should never be used in production, it's only here to run tests. diff --git a/index.php b/index.php new file mode 100644 index 0000000..b7acb45 --- /dev/null +++ b/index.php @@ -0,0 +1,171 @@ + diff --git a/server b/server new file mode 100755 index 0000000..4d4194c --- /dev/null +++ b/server @@ -0,0 +1,14 @@ +#! /bin/bash +# This script should be used by the test suite, don't useit manually +# or you may end up with zombie processes lying around + +if [ -z "$FORGEHOOKPORT" ]; then + [ -z "$1" ] && exit 1 + FORGEHOOKPORT="$1" +fi +[ -z "$FORGEHOOK" ] && FORGEHOOK="forgehook" + +php -S localhost:$FORGEHOOKPORT +if [[ $? != 0 ]]; then + exit 2 +fi