Skip to content

Logger les appels par ProductController.php #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/php-rest-api-logging.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
9 changes: 9 additions & 0 deletions .idea/sonarlint/issuestore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/sonarlint/securityhotspotstore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/webServers.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions error_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[21-Apr-2023 20:02:57 UTC] PHP Fatal error: Uncaught TypeError: Return value of ErrorHandler::handleException() must be an instance of void, none returned in /home/z3csh562/public_html/mwoptique/src/ErrorHandler.php:15
Stack trace:
#0 [internal function]: ErrorHandler::handleException(Object(ParseError))
#1 {main}
thrown in /home/z3csh562/public_html/mwoptique/src/ErrorHandler.php on line 15
[21-Apr-2023 20:08:41 UTC] PHP Fatal error: Uncaught TypeError: Return value of ErrorHandler::handleException() must be an instance of void, none returned in /home/z3csh562/public_html/mwoptique/src/ErrorHandler.php:15
Stack trace:
#0 [internal function]: ErrorHandler::handleException(Object(ParseError))
#1 {main}
thrown in /home/z3csh562/public_html/mwoptique/src/ErrorHandler.php on line 15
Empty file added httpCall.log
Empty file.
34 changes: 7 additions & 27 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

spl_autoload_register(function ($class) {
Expand All @@ -12,31 +11,12 @@
header("Content-type: application/json; charset=UTF-8");

$parts = explode("/", $_SERVER["REQUEST_URI"]);
$request = str_replace("/mwoptique","",$_SERVER["REQUEST_URI"]);

if ($parts[1] != "products") {
http_response_code(404);
exit;
}

$id = $parts[2] ?? null;

$database = new Database("localhost", "product_db", "root", "");

$gateway = new ProductGateway($database);

$controller = new ProductController($gateway);

$controller->processRequest($_SERVER["REQUEST_METHOD"], $id);












//if ($parts[2] != "products") {
// http_response_code(404);
// exit;
//}

$controller = new ProductController();
$controller->processRequest($_SERVER["REQUEST_METHOD"], $request);
35 changes: 35 additions & 0 deletions paiement.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@


2023-04-21 20:36:22


2023-04-21 20:37:07


2023-04-21 20:39:14


2023-04-21 20:42:39


2023-04-21 20:43:36


2023-04-21 21:01:43


2023-04-21 21:06:36


2023-04-21 21:07:24


2023-04-21 21:12:38


2023-04-21 21:23:23
{"0":"HTTP\/1.1 200 OK","Date":"Fri, 21 Apr 2023 21:23:23 GMT","Server":"Apache","Upgrade":"h2,h2c","Connection":"Upgrade, close","Last-Modified":"Thu, 13 Sep 2018 02:34:43 GMT","Accept-Ranges":"bytes","Content-Length":"6023","Vary":"Accept-Encoding,User-Agent","Content-Type":"text\/html"}


2023-04-21 21:24:09
{"0":"HTTP\/1.1 200 OK","Date":"Fri, 21 Apr 2023 21:24:09 GMT","Server":"Apache","Upgrade":"h2,h2c","Connection":"Upgrade, close","Last-Modified":"Thu, 13 Sep 2018 02:34:43 GMT","Accept-Ranges":"bytes","Content-Length":"6023","Vary":"Accept-Encoding,User-Agent","Content-Type":"text\/html"}
Loading