From b6c976b4b1bd9014fc39a68cd8e37c8073dada4a Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Sat, 30 Oct 2021 16:11:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Replaced=20dbname=20in=20TRUNCAT?= =?UTF-8?q?E=20query=20by=20.env=20var?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjetProgWeb/scripts/extract.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ProjetProgWeb/scripts/extract.php b/ProjetProgWeb/scripts/extract.php index 9252255..531b1f1 100644 --- a/ProjetProgWeb/scripts/extract.php +++ b/ProjetProgWeb/scripts/extract.php @@ -3,12 +3,15 @@ require_once("../class/these.php"); require_once("../class/dump.php"); require_once("../class/conf.php"); +require_once('../class/dotEnv.php'); + +(new DotEnv(__DIR__ . '/../.env'))->load(); if (($handle = fopen("2021-09-15-theses.csv", "r")) !== FALSE) { $pdo_obj = new conf(); $pdo = $pdo_obj->getPDO(); - $stmt = $pdo->query("TRUNCATE `projet_prog_web`.`theses`"); + $stmt = $pdo->query("TRUNCATE `" . getenv('DBNAME') ."`.`theses`"); $row = 1; $new_these = these::emptyThese();