diff options
| author | polo <ordipolo@gmx.fr> | 2022-03-02 04:54:24 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2022-03-02 04:54:24 +0100 |
| commit | 9a28c38adb3585e55caeecd64d2171832a3684e9 (patch) | |
| tree | 0119caaaa405d0e1dc248611a3e9b4e5f2470548 /controller | |
| parent | 91af604a44d016b4b56fd45266d6928ba3108e9e (diff) | |
| download | melaine-9a28c38adb3585e55caeecd64d2171832a3684e9.tar.gz melaine-9a28c38adb3585e55caeecd64d2171832a3684e9.tar.bz2 melaine-9a28c38adb3585e55caeecd64d2171832a3684e9.zip | |
detection poids max php.ini
Diffstat (limited to 'controller')
| -rw-r--r-- | controller/backup.php | 4 | ||||
| -rw-r--r-- | controller/installation.php | 30 |
2 files changed, 32 insertions, 2 deletions
diff --git a/controller/backup.php b/controller/backup.php index 4fb01ef..1477c55 100644 --- a/controller/backup.php +++ b/controller/backup.php | |||
| @@ -156,8 +156,10 @@ function restaurer($from) | |||
| 156 | } | 156 | } |
| 157 | elseif(isset($_FILES['archive']) && $_FILES['archive']['error'] != 0) | 157 | elseif(isset($_FILES['archive']) && $_FILES['archive']['error'] != 0) |
| 158 | { | 158 | { |
| 159 | $message = '<p style="color: red;" >Erreur: Le fichier n\'a pas pu être téléchargé correctement."</p>'; | 159 | $message = '<p style="color: red;" >Erreur: Le fichier n\'a pas pu être téléchargé correctement.<br/> |
| 160 | Au fait, "upload_max_filesize" dans le php.ini vaut ' . ini_get('upload_max_filesize') . '.</p>'; | ||
| 160 | } | 161 | } |
| 161 | 162 | ||
| 162 | require('view/backup.php'); | 163 | require('view/backup.php'); |
| 163 | } | 164 | } |
| 165 | |||
diff --git a/controller/installation.php b/controller/installation.php index bf6826d..7e3863b 100644 --- a/controller/installation.php +++ b/controller/installation.php | |||
| @@ -52,6 +52,7 @@ function installation() | |||
| 52 | 52 | ||
| 53 | // valeur en octal | 53 | // valeur en octal |
| 54 | $droitsDossiers = 0777; // mettre 0755 en production | 54 | $droitsDossiers = 0777; // mettre 0755 en production |
| 55 | $droitsFichiers = 0666; | ||
| 55 | 56 | ||
| 56 | if(!file_exists('data') && !mkdir('data')) | 57 | if(!file_exists('data') && !mkdir('data')) |
| 57 | { | 58 | { |
| @@ -67,6 +68,8 @@ function installation() | |||
| 67 | require('view/backup.php'); | 68 | require('view/backup.php'); |
| 68 | exit(); | 69 | exit(); |
| 69 | } | 70 | } |
| 71 | touch('data/index.html'); | ||
| 72 | chmod('data/index.html', $droitsFichiers); | ||
| 70 | 73 | ||
| 71 | $listePages = array('melaine', 'discographie', 'concerts', 'presse', 'ateliers', 'liens', 'peinture', 'archives'); | 74 | $listePages = array('melaine', 'discographie', 'concerts', 'presse', 'ateliers', 'liens', 'peinture', 'archives'); |
| 72 | foreach ($listePages as $page) | 75 | foreach ($listePages as $page) |
| @@ -76,16 +79,31 @@ function installation() | |||
| 76 | mkdir('data/' . $page); | 79 | mkdir('data/' . $page); |
| 77 | chmod('data/' . $page, $droitsDossiers); | 80 | chmod('data/' . $page, $droitsDossiers); |
| 78 | } | 81 | } |
| 82 | if(!file_exists('data/' . $page . 'index.html')) | ||
| 83 | { | ||
| 84 | touch('data/' . $page . '/index.html'); | ||
| 85 | chmod('data/' . $page . '/index.html', $droitsFichiers); | ||
| 86 | } | ||
| 79 | if(!file_exists('data/' . $page . '/html')) | 87 | if(!file_exists('data/' . $page . '/html')) |
| 80 | { | 88 | { |
| 81 | mkdir('data/' . $page . '/html'); | 89 | mkdir('data/' . $page . '/html'); |
| 82 | chmod('data/' . $page . '/html', $droitsDossiers); | 90 | chmod('data/' . $page . '/html', $droitsDossiers); |
| 83 | } | 91 | } |
| 92 | if(!file_exists('data/' . $page . '/html/index.html')) | ||
| 93 | { | ||
| 94 | touch('data/' . $page . '/html/index.html'); | ||
| 95 | chmod('data/' . $page . '/html/index.html', $droitsFichiers); | ||
| 96 | } | ||
| 84 | if(!file_exists('data/' . $page . '/images')) | 97 | if(!file_exists('data/' . $page . '/images')) |
| 85 | { | 98 | { |
| 86 | mkdir('data/' . $page . '/images'); | 99 | mkdir('data/' . $page . '/images'); |
| 87 | chmod('data/' . $page . '/images', $droitsDossiers); | 100 | chmod('data/' . $page . '/images', $droitsDossiers); |
| 88 | } | 101 | } |
| 102 | if(!file_exists('data/' . $page . '/images/index.html')) | ||
| 103 | { | ||
| 104 | touch('data/' . $page . '/images/index.html'); | ||
| 105 | chmod('data/' . $page . '/images/index.html', $droitsFichiers); | ||
| 106 | } | ||
| 89 | // if(!file_exists('data/' . $page . '/multimedia')) | 107 | // if(!file_exists('data/' . $page . '/multimedia')) |
| 90 | // { | 108 | // { |
| 91 | // mkdir('data/' . $page . '/multimedia'); | 109 | // mkdir('data/' . $page . '/multimedia'); |
| @@ -98,11 +116,22 @@ function installation() | |||
| 98 | mkdir('data/discographie/json'); | 116 | mkdir('data/discographie/json'); |
| 99 | chmod('data/discographie/json', $droitsDossiers); | 117 | chmod('data/discographie/json', $droitsDossiers); |
| 100 | } | 118 | } |
| 119 | if(!file_exists('data/discographie/json/index.html')) | ||
| 120 | { | ||
| 121 | touch('data/discographie/json/index.html'); | ||
| 122 | chmod('data/discographie/json/index.html', $droitsFichiers); | ||
| 123 | } | ||
| 101 | if(!file_exists('data/discographie/images-mini')) | 124 | if(!file_exists('data/discographie/images-mini')) |
| 102 | { | 125 | { |
| 103 | mkdir('data/discographie/images-mini'); | 126 | mkdir('data/discographie/images-mini'); |
| 104 | chmod('data/discographie/images-mini', $droitsDossiers); | 127 | chmod('data/discographie/images-mini', $droitsDossiers); |
| 105 | } | 128 | } |
| 129 | if(!file_exists('data/discographie/images-mini/index.html')) | ||
| 130 | { | ||
| 131 | touch('data/discographie/images-mini/index.html'); | ||
| 132 | chmod('data/discographie/images-mini/index.html', $droitsFichiers); | ||
| 133 | } | ||
| 134 | // le modèle donnera les droits 0666 (octal) aux nouveaux fichiers à l'intérieur des dossiers | ||
| 106 | 135 | ||
| 107 | // créer le melainePHP.zip | 136 | // créer le melainePHP.zip |
| 108 | if(!file_exists("data/melainePHP.zip")) | 137 | if(!file_exists("data/melainePHP.zip")) |
| @@ -110,7 +139,6 @@ function installation() | |||
| 110 | require('controller/backup.php'); | 139 | require('controller/backup.php'); |
| 111 | creerMelainePHP(); | 140 | creerMelainePHP(); |
| 112 | } | 141 | } |
| 113 | // le modèle donnera les droits 0666 (octal) aux nouveaux fichiers à l'intérieur des dossiers | ||
| 114 | 142 | ||
| 115 | // création d'un mot de passe si password.txt est vide | 143 | // création d'un mot de passe si password.txt est vide |
| 116 | createPassword(); | 144 | createPassword(); |
