Fix: Meilleure gestion erreur en cas de rpertoire inexsitant.

This commit is contained in:
Laurent Destailleur 2004-08-15 18:46:12 +00:00
parent 9348137110
commit cf4ecdebe1

View File

@ -340,18 +340,19 @@ function init () {
if ( !defined('MAGPIE_CACHE_DIR') ) {
// Le rep de cache est defini dans DOL_DATA_ROOT
if (! file_exists(DOL_DATA_ROOT.'/rsscache')) {
if (! file_exists(DOL_DATA_ROOT)) {
mkdir(DOL_DATA_ROOT);
}
mkdir(DOL_DATA_ROOT.'/rsscache');
$ret=true;
if (! file_exists(DOL_DATA_ROOT)) {
$ret=mkdir(DOL_DATA_ROOT);
}
if ($ret && ! file_exists(DOL_DATA_ROOT.'/rsscache')) {
$ret=mkdir(DOL_DATA_ROOT.'/rsscache');
}
define('MAGPIE_CACHE_DIR', DOL_DATA_ROOT.'/rsscache');
// Si le rep de cache n'a pu etre trouvé ou créé, on utilise
// l'ancien dans DOL_DOCUMENT_ROOT pour raison de compatibilite
// avec anciennes versions
if (! file_exists(DOL_DATA_ROOT.'/rsscache')) {
if (! $ret) {
define('MAGPIE_CACHE_DIR', DOL_DOCUMENT_ROOT.'/rsscache');
}