diff --git a/src/Pdo/PdoConnect.php b/src/Pdo/PdoConnect.php new file mode 100644 index 0000000..18f72bd --- /dev/null +++ b/src/Pdo/PdoConnect.php @@ -0,0 +1,45 @@ +params = $params; } - public function connection() - { - return new PDO($this->params->get('urlDatabase'), $this->params->get('dbUser'), $this->params->get('dbPassword')); - } - public function fetchDatas($email) { try { - $dbh = $this->connection(); + $pdo = PdoConnect::getInstance(); + $dbh = $pdo->connect($this->params->get('urlDatabase'), $this->params->get('dbUser'), $this->params->get('dbPassword')); $query = $dbh->prepare($this->getParameter('queryFetchDatas')); $query->execute(['email'=> $email]); $datas = $query->fetch(PDO::FETCH_ASSOC); diff --git a/supervisord.log b/supervisord.log index 809054b..c916816 100644 --- a/supervisord.log +++ b/supervisord.log @@ -4300,3 +4300,13 @@ 2022-05-03 14:32:13,009 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-05-03 14:32:13,011 INFO spawned: 'rsyslog' with pid 77 2022-05-03 14:32:14,019 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +2022-05-03 16:04:28,347 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. +2022-05-03 16:04:28,349 INFO RPC interface 'supervisor' initialized +2022-05-03 16:04:28,349 CRIT Server 'unix_http_server' running without any HTTP authentication checking +2022-05-03 16:04:28,349 INFO supervisord started with pid 26 +2022-05-03 16:04:29,352 INFO spawned: 'apache2' with pid 27 +2022-05-03 16:04:29,353 INFO spawned: 'php-fpm' with pid 28 +2022-05-03 16:04:29,353 INFO spawned: 'rsyslog' with pid 29 +2022-05-03 16:04:30,374 INFO success: apache2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +2022-05-03 16:04:30,374 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +2022-05-03 16:04:30,374 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) diff --git a/supervisord.pid b/supervisord.pid index 48082f7..6f4247a 100644 --- a/supervisord.pid +++ b/supervisord.pid @@ -1 +1 @@ -12 +26