Overview
Comment:Générer une erreur quand même quand la suppression échoue et que le fichier existe toujours
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 1bdf70a9d5b6cf470cab111346d79d2200f7bc58
User & Date: bohwaz on 2018-09-13 22:06:38
Other Links: branch diff | manifest | tags
Context
2018-09-13
22:21
Utilisation de safe_unlink/safe_mkdir partout check-in: 85d5a50a94 user: bohwaz tags: dev
22:06
Générer une erreur quand même quand la suppression échoue et que le fichier existe toujours check-in: 1bdf70a9d5 user: bohwaz tags: dev
22:03
Parfois le fichier a déjà disparu ! check-in: 076971cb89 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Utils.php from [df58911e4f] to [d74b84d7b0].

389
390
391
392
393
394
395
396






397
398
399
400
401
402
403

        while ($file = $dir->read())
        {
            if ($file[0] != '.')
            {
            	if (file_exists($path . DIRECTORY_SEPARATOR . $file))
            	{
                	@unlink($path . DIRECTORY_SEPARATOR . $file);






                }
            }
        }

        $dir->close();
        return true;
    }







|
>
>
>
>
>
>







389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409

        while ($file = $dir->read())
        {
            if ($file[0] != '.')
            {
            	if (file_exists($path . DIRECTORY_SEPARATOR . $file))
            	{
                	if (!@unlink($path . DIRECTORY_SEPARATOR . $file))
                    {
                        if (file_exists($path . DIRECTORY_SEPARATOR . $file))
                        {
                            throw new \RuntimeException(sprintf('Impossible de supprimer le fichier %s: %s', $path . DIRECTORY_SEPARATOR . $file, error_get_last()));
                        }
                    }
                }
            }
        }

        $dir->close();
        return true;
    }