125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
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
|
<
<
|
<
|
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
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
|