mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-07 00:56:48 +01:00
Pasting of folders in same dir adds (num)
If the dir exists, run thru from 2 to 1billion looking for next available number and set the $dest name as that. All exactly the same as how it works for pasting files.
This commit is contained in:
@@ -68,6 +68,14 @@ if ($_GET['action']=="paste") {
|
||||
if (is_dir($source)) {
|
||||
if (!is_dir($dest)) {
|
||||
mkdir($dest, 0705);
|
||||
} else {
|
||||
for ($i=2; $i<1000000000; $i++) {
|
||||
if (!is_dir($dest." (".$i.")")) {
|
||||
$dest = $dest." (".$i.")";
|
||||
mkdir($dest, 0705);
|
||||
$i=1000000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($iterator = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
|
||||
Reference in New Issue
Block a user