From 9d4808d64fa4618d85198860df6214a9491b05ee Mon Sep 17 00:00:00 2001 From: "fred.boniface" Date: Mon, 19 Sep 2022 19:33:48 +0100 Subject: [PATCH] Create a php-cli test script for gitea web call. --- php/submitIssue-cli-test.php | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 php/submitIssue-cli-test.php diff --git a/php/submitIssue-cli-test.php b/php/submitIssue-cli-test.php new file mode 100644 index 0000000..96647d4 --- /dev/null +++ b/php/submitIssue-cli-test.php @@ -0,0 +1,37 @@ + $body, + 'title' => $subject, + 'closed' => 'false' + ); + + $issueData = json_encode($rawData); + + // Prepare CURL + $curlConnection = curl_init('https://git.fjla.uk/api/v1/repos/fred.boniface/athena.fb-infra.uk/issues'); + curl_setopt($curlConnection, CURLOPT_POSTFIELDS, $issueData); + curl_setopt($curlConnection, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curlConnection, CURLOPT_HTTPHEADER, $httpHeaders); + + // Get response and exit CURL + $giteaResponse = curl_exec($curlConnection); + curl_close($curlConnection); + + echo $issueData . "\n\n"; + echo $giteaResponse; +?>