diff options
Diffstat (limited to 'php/functions.php')
-rw-r--r-- | php/functions.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/php/functions.php b/php/functions.php new file mode 100644 index 0000000..61bc13e --- /dev/null +++ b/php/functions.php | |||
@@ -0,0 +1,26 @@ | |||
1 | <?php | ||
2 | // php/functions.php | ||
3 | |||
4 | // commande pour lancer une application graphique en ouvrant un fichier | ||
5 | function window_app_command(string $app, string $path = ''): string | ||
6 | { | ||
7 | $command = 'nohup ' . $app; // détache l'appli du script PHP | ||
8 | if($path != '') | ||
9 | { | ||
10 | $command .= ' ' . $path; | ||
11 | } | ||
12 | $command .= ' > /dev/null 2>&1 &'; | ||
13 | // stdout > /dev/null et & permettent de rendre la main à PHP | ||
14 | // stderr > stdout pour cacher un message inutile | ||
15 | return $command; | ||
16 | } | ||
17 | |||
18 | function recherche_client(string $saisie): array | ||
19 | { | ||
20 | $resultats = []; | ||
21 | |||
22 | // recherche dans la BDD | ||
23 | |||
24 | |||
25 | return($resultats); | ||
26 | } | ||