145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
static public function checkAndCreateDirectories()
{
// Vérifier que les répertoires vides existent, sinon les créer
$paths = [DATA_ROOT, PLUGINS_ROOT, CACHE_ROOT, CACHE_ROOT . '/static', CACHE_ROOT . '/compiled'];
foreach ($paths as $path)
{
if (!file_exists($path))
{
@mkdir($path, 0777, true);
}
if (!is_dir($path))
{
throw new UserException('Le répertoire '.$path.' n\'existe pas ou n\'est pas un répertoire.');
}
// On en profite pour vérifier qu'on peut y lire et écrire
|
<
<
|
<
|
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
static public function checkAndCreateDirectories()
{
// Vérifier que les répertoires vides existent, sinon les créer
$paths = [DATA_ROOT, PLUGINS_ROOT, CACHE_ROOT, CACHE_ROOT . '/static', CACHE_ROOT . '/compiled'];
foreach ($paths as $path)
{
Utils::safe_mkdir($path);
if (!is_dir($path))
{
throw new UserException('Le répertoire '.$path.' n\'existe pas ou n\'est pas un répertoire.');
}
// On en profite pour vérifier qu'on peut y lire et écrire
|