From ff14091476a35de16a9ea3208501040cfae93a06 Mon Sep 17 00:00:00 2001 From: polo Date: Wed, 14 Dec 2022 12:55:46 +0100 Subject: MODEL + reorganisation --- src/functions.php | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/functions.php (limited to 'src/functions.php') diff --git a/src/functions.php b/src/functions.php new file mode 100644 index 0000000..d67a05e --- /dev/null +++ b/src/functions.php @@ -0,0 +1,51 @@ + /dev/null 2>&1 &'; + // stdout > /dev/null et & permettent de rendre la main à PHP + // stderr > stdout pour cacher un message inutile + return $command; +} + +function recherche_client(string $saisie): array +{ + $resultats = []; + + // recherche dans la BDD + + + return($resultats); +} + +// compilation à partir d'un fichier .tex +function latexToPdf(string $fileName, string $latexPath, string $pdfPath) +{ + $outputDir = ''; + if($pdfPath !== '') + { + $outputDir = '-output-directory=' . $pdfPath . ' '; + } + + // compilation + exec('pdflatex ' . $outputDir . $latexPath . $fileName); + + // nettoyage + $basename = basename($fileName, '.tex'); + unlink($pdfPath . $basename . '.aux'); + unlink($pdfPath . $basename . '.log'); +} -- cgit v1.2.3