Merge branch 'cedricAbonnel-main-patch-79942' into 'main'
Update trierPhoto.php See merge request cedricAbonnel/trierPhotos!1
This commit is contained in:
commit
8b0b2d56e5
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/php
|
||||
<?PHP
|
||||
|
||||
if ($handle = opendir('.')) {
|
||||
|
@ -14,7 +15,7 @@ if ($handle = opendir('.')) {
|
|||
unset($dateTimeOriginal_explode);
|
||||
$traitement_ok = false;
|
||||
|
||||
$message='';
|
||||
$message='';
|
||||
$file_img_ok = false;
|
||||
$file_vid_ok = false;
|
||||
$file_exif_ok = false;
|
||||
|
@ -64,7 +65,7 @@ if ($handle = opendir('.')) {
|
|||
$dateTimeOriginal['d'] = explode(" ", $dateTimeOriginal_explode[2])[0];
|
||||
}
|
||||
}
|
||||
$message .= " Traitement sur date EXIF";
|
||||
$message .= " Traitement sur date EXIF\n";
|
||||
|
||||
}
|
||||
|
||||
|
@ -88,7 +89,7 @@ if ($handle = opendir('.')) {
|
|||
|
||||
}
|
||||
|
||||
$message .= "Traitement sur nom du fichier";
|
||||
$message .= "Traitement sur nom du fichier\n";
|
||||
|
||||
}
|
||||
|
||||
|
@ -126,23 +127,23 @@ if ($handle = opendir('.')) {
|
|||
}
|
||||
}
|
||||
|
||||
$file_dest = $rep_dest."/".$entry;
|
||||
if (!file_exists($file_dest)) {
|
||||
rename($entry, $file_dest);
|
||||
$message .= " => ".$file_dest."\n";
|
||||
} else {
|
||||
$md5_file_src = md5_file($entry);
|
||||
$md5_file_dst = md5_file($file_dest);
|
||||
if ($md5_file_src == $md5_file_dst) {
|
||||
$message .= " [ERREUR] ".$file_dest." existe déjà ! Destruction car même empreinte $md5_file_src / $md5_file_dst\n";
|
||||
unlink($entry);
|
||||
} else {
|
||||
$message .= " [ERREUR] ".$file_dest." existe déjà !\n";
|
||||
}
|
||||
$file_dest = $rep_dest."/".$entry;
|
||||
if (!file_exists($file_dest)) {
|
||||
rename($entry, $file_dest);
|
||||
$message .= " => ".$file_dest."\n";
|
||||
} else {
|
||||
$md5_file_src = md5_file($entry);
|
||||
$md5_file_dst = md5_file($file_dest);
|
||||
if ($md5_file_src == $md5_file_dst) {
|
||||
$message .= " [ERREUR] ".$file_dest." existe déjà ! Destruction car même empreinte $md5_file_src / $md5_file_dst\n";
|
||||
unlink($entry);
|
||||
} else {
|
||||
$message .= " [ERREUR] ".$file_dest." existe déjà ! Mais pas avec la même empreinte.\n";
|
||||
}
|
||||
|
||||
}
|
||||
fwrite($file_log_out, $message);
|
||||
echo $message;
|
||||
}
|
||||
fwrite($file_log_out, $message);
|
||||
echo $message;
|
||||
}
|
||||
|
||||
|
||||
|
@ -150,7 +151,7 @@ if ($handle = opendir('.')) {
|
|||
}
|
||||
|
||||
closedir($handle);
|
||||
|
||||
fclose($file_log_out);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue