diff options
| author | polo <ordipolo@gmx.fr> | 2025-06-18 14:48:31 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-06-18 14:48:31 +0200 |
| commit | 9db3f7c6c636eb2bc8368d83ca09b12b4bb94c7b (patch) | |
| tree | f9fc4f4d4592daf23c0c60adc9445dbe698a456e /src/controller | |
| parent | 92c511f4aaa156e5c943ef553645a066cfb8db9e (diff) | |
| download | cms-9db3f7c6c636eb2bc8368d83ca09b12b4bb94c7b.tar.gz cms-9db3f7c6c636eb2bc8368d83ca09b12b4bb94c7b.tar.bz2 cms-9db3f7c6c636eb2bc8368d83ca09b12b4bb94c7b.zip | |
contrôle extensions PHP
Diffstat (limited to 'src/controller')
| -rw-r--r-- | src/controller/installation.php | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/controller/installation.php b/src/controller/installation.php index ad87b72..f87843c 100644 --- a/src/controller/installation.php +++ b/src/controller/installation.php | |||
| @@ -10,20 +10,31 @@ use App\Entity\Image; | |||
| 10 | use Doctrine\Common\Collections\ArrayCollection; | 10 | use Doctrine\Common\Collections\ArrayCollection; |
| 11 | use Doctrine\ORM\EntityManager; | 11 | use Doctrine\ORM\EntityManager; |
| 12 | 12 | ||
| 13 | function installation(): void | 13 | function phpDependancies() |
| 14 | { | 14 | { |
| 15 | /* -- extensions PHP -- */ | 15 | $flag = false; |
| 16 | $extensions = []; | 16 | //$extensions = ['pdo_mysql', 'mbstring', 'ctype', 'json', 'tokenizer', 'zip', 'dom']; // les 5 premières sont pour doctrine |
| 17 | $extensions = ['pdo_mysql', 'mbstring', 'ctype', 'json', 'tokenizer']; | ||
| 17 | foreach($extensions as $extension){ | 18 | foreach($extensions as $extension){ |
| 18 | if(!extension_loaded($extension)) | 19 | if(!extension_loaded($extension)) |
| 19 | { | 20 | { |
| 20 | echo("l'extension " . $extension . ' est manquante<br>'); | 21 | echo("<p>l'extension <b>" . $extension . '</b> est manquante</p>'); |
| 22 | $flag = true; | ||
| 21 | } | 23 | } |
| 22 | } | 24 | } |
| 23 | if(!extension_loaded('imagick') && !extension_loaded('gd')){ | 25 | if(!extension_loaded('imagick') && !extension_loaded('gd')){ |
| 24 | echo("il manque une de ces extensions au choix: imagick (de préférence) ou gd<br>"); | 26 | echo("<p>il manque une de ces extensions au choix pour le traitement des images: <b>imagick</b> (de préférence) ou <b>gd</b>.</p>"); |
| 27 | $flag = true; | ||
| 28 | } | ||
| 29 | if($flag){ | ||
| 30 | echo '<p>Réalisez les actions nécéssaires sur le serveur ou contactez l\'administrateur du site.<br> | ||
| 31 | Quand le problème sera résolu, il vous suffira de <a href="#">recharger la page<a>.</p>'; | ||
| 32 | die; | ||
| 25 | } | 33 | } |
| 34 | } | ||
| 26 | 35 | ||
| 36 | function installation(): void | ||
| 37 | { | ||
| 27 | /* -- droits des fichiers et dossiers -- */ | 38 | /* -- droits des fichiers et dossiers -- */ |
| 28 | $droits_dossiers = 0700; | 39 | $droits_dossiers = 0700; |
| 29 | $droits_fichiers = 0600; | 40 | $droits_fichiers = 0600; |
| @@ -41,7 +52,7 @@ HTACCESS; | |||
| 41 | fputs($fichier, $contenu); | 52 | fputs($fichier, $contenu); |
| 42 | fclose($fichier); | 53 | fclose($fichier); |
| 43 | chmod('../config/.htaccess', $droits_fichiers); | 54 | chmod('../config/.htaccess', $droits_fichiers); |
| 44 | //echo("danger<br>pas de .htaccess dans config<br>prévenez le respondable du site"); | 55 | //echo("danger<br>pas de .htaccess dans config<br>prévenez le responsable du site"); |
| 45 | //die; | 56 | //die; |
| 46 | } | 57 | } |
| 47 | 58 | ||
