diff options
Diffstat (limited to 'controller/installation.php')
-rw-r--r-- | controller/installation.php | 30 |
1 files changed, 29 insertions, 1 deletions
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(); |