mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 16:34:23 -05:00
DC6 to PNG item conversion. Read in order from docpath,d2modder img path
This commit is contained in:
@@ -150,4 +150,43 @@ function print_mem()
|
||||
|
||||
echo 'The script is now using: <strong>' . round($mem_usage / 1024) . 'KB</strong> of memory.<br>';
|
||||
echo 'Peak usage: <strong>' . round($mem_peak / 1024) . 'KB</strong> of memory.<br><br>';
|
||||
}
|
||||
|
||||
|
||||
function rcopy($src, $dst) {
|
||||
// open the source directory
|
||||
$dir = opendir($src);
|
||||
// Make the destination directory if not exist
|
||||
@mkdir($dst);
|
||||
// Loop through the files in source directory
|
||||
while( $file = readdir($dir) ) {
|
||||
if (( $file != '.' ) && ( $file != '..' )) {
|
||||
if ( is_dir($src . '/' . $file) )
|
||||
{
|
||||
rcopy($src . '/' . $file, $dst . '/' . $file);
|
||||
}
|
||||
else {
|
||||
copy($src . '/' . $file, $dst . '/' . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
|
||||
function rrmdir($src) {
|
||||
$dir = opendir($src);
|
||||
while(false !== ( $file = readdir($dir)) ) {
|
||||
if (( $file != '.' ) && ( $file != '..' )) {
|
||||
$full = $src . '/' . $file;
|
||||
if ( is_dir($full) ) {
|
||||
rrmdir($full);
|
||||
}
|
||||
else {
|
||||
unlink($full);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
rmdir($src);
|
||||
}
|
Reference in New Issue
Block a user