essaie cette fonction, et dis nous ce que ça te retourne:
UPDATE: 04:20
/**
* Test un unlink() sur un fichier, et affiche des informations de debug
* si des events sont rencontrés
* @param string $file
* @return bool
**/
function jaimeLesCourgettes($file){
$realpath = realpath($file);
switch($file){
case !file_exists($file):
yaQuoiDansCeDossier(dirname($file));
var_dump(
'Path to file : '.$file,
'Realpath : '.$realpath
);
return false;
break;
default:
var_dump( 'You can unlink($file) !' );
// unlink($file);
// or you can try
// unlink($realpath);
return true;
break;
}
}
/**
* Affiche les fichiers contenue dans un dossiers
* @param string $path chemion vers le dossier
* @return bool
**/
function yaQuoiDansCeDossier($path){
if(!file_exists($path) || file_exists($path) && !opendir($path)){
yaQuoiDansCeDossier(dirname($path));
return true;
}
$folderOpen = opendir($path);
$listFiles = ];
while($entry = readdir($folderOpen)){
if(in_array($entry, '.', '..'])) continue;
$path = preg_replace("/\\\|\//", DIRECTORY_SEPARATOR, $path);
$pathEntry = $path.DIRECTORY_SEPARATOR.$entry;
$listFiles] = $pathEntry;
}
echo '<h1>Files contents from '.$path.'</h1>';
var_dump( $pathEntry );
echo '-----------------';
return true;
}
tu l'appel AVANT la ligne 9 (selon ton past)
jaimeLesCourgettes(WEBROOT . 'img/works/' . $image'img_name']);