From 397d0c2972b9b7764628fafad9bacdeb7e511f37 Mon Sep 17 00:00:00 2001 From: Emmanuel ROY Date: Tue, 8 Dec 2020 09:28:12 +0100 Subject: [PATCH 1/2] update console bin update composer.json for autoload of Command update in order to make it usefull --- .idea/codeStyles/codeStyleConfig.xml | 5 +++ application/class/Dumper.php | 17 +++++++ application/class/Logger.php | 19 ++++++++ composer.json | 5 ++- console/bin.php | 21 ++++++--- .../command/{cache.class.php => Cache.php} | 3 +- .../command/{module.class.php => Module.php} | 45 ++++++++++--------- console/command/{page.class.php => Page.php} | 3 +- .../{symfony.class.php => Symfony.php} | 3 +- .../objets => domain}/phantom.gitkeep | 0 10 files changed, 88 insertions(+), 33 deletions(-) create mode 100644 .idea/codeStyles/codeStyleConfig.xml rename console/command/{cache.class.php => Cache.php} (94%) rename console/command/{module.class.php => Module.php} (96%) rename console/command/{page.class.php => Page.php} (98%) rename console/command/{symfony.class.php => Symfony.php} (88%) rename {application/objets => domain}/phantom.gitkeep (100%) diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/application/class/Dumper.php b/application/class/Dumper.php index 922a63b..87dcfd0 100644 --- a/application/class/Dumper.php +++ b/application/class/Dumper.php @@ -14,5 +14,22 @@ class Dumper{ } echo ""; } + /** + * Fonction Statique permettant d'initialiser les valeurs de php lors du script courant + * + * @return void + */ + public static function setPHPvalues() + { + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + ini_set('memory_limit', -1); + ini_set('max_execution_time', 0); + ini_set('default_socket_timeout', -1); + + error_reporting(E_ALL); + + return; + } } \ No newline at end of file diff --git a/application/class/Logger.php b/application/class/Logger.php index 79334eb..aa05216 100644 --- a/application/class/Logger.php +++ b/application/class/Logger.php @@ -22,5 +22,24 @@ class Logger file_put_contents($file, $what); } } + /** + * Fonction courante permettant de logger les erreurs obtenues dans un fichier + * + * @param array $errors + * @return void + */ + public static function logCommandErrors(array $errors) + { + // log connection errors to the web service + ob_start(); + foreach ($errors as $key => $value) { + echo "\n\n$key : \n"; + print_r($value); + } + $write_string = ob_get_clean(); + file_put_contents(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "logs" . DIRECTORY_SEPARATOR . "errors_command.log", $write_string); + + return; + } } \ No newline at end of file diff --git a/composer.json b/composer.json index a15090e..eb87393 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,9 @@ ], "psr-4": { - "MVC\\Classe\\":"./application/class", - "MVC\\Objets\\":"./application/objets" + "MVC\\Classe\\" : "./application/class", + "MVC\\Domain\\" : "./domain", + "MVC\\Command\\": "./console/command" } }, "require": { diff --git a/console/bin.php b/console/bin.php index 83564dd..0ca8caa 100644 --- a/console/bin.php +++ b/console/bin.php @@ -1,18 +1,27 @@ #!/usr/bin/php Date: Fri, 18 Dec 2020 18:05:20 +0100 Subject: [PATCH 2/2] Del .idea --- .idea/.gitignore | 2 -- .idea/SAND-framework.iml | 43 ---------------------------- .idea/codeStyles/codeStyleConfig.xml | 5 ---- .idea/deployment.xml | 15 ---------- .idea/misc.xml | 6 ---- .idea/modules.xml | 8 ------ .idea/php.xml | 40 -------------------------- .idea/vcs.xml | 9 ------ 8 files changed, 128 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/SAND-framework.iml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/deployment.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/php.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 5c98b42..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Default ignored files -/workspace.xml \ No newline at end of file diff --git a/.idea/SAND-framework.iml b/.idea/SAND-framework.iml deleted file mode 100644 index 560fdc0..0000000 --- a/.idea/SAND-framework.iml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index a55e7a1..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/deployment.xml b/.idea/deployment.xml deleted file mode 100644 index 5273e29..0000000 --- a/.idea/deployment.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 28a804d..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index eb34315..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index 9d660cd..0000000 --- a/.idea/php.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 0f2fbee..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file