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