From d172d744f2956ef8d3ec0c305f86712679862080 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Fri, 12 Jul 2013 15:57:54 -0400 Subject: [PATCH] BUG 8665 "32K Issue - Maximum of folder in shared/sites/files" SOLVED - Al realizar la migracion a la nueva estructura de directorios, no se puede descargar los archivos, desde HOME>Documents - Problema resuelto, al crear la nueva estructura de directorios se ha dado los permisos necesarios para dicho directorio * Available from version ProcessMaker-2.5.1-testing.4 --- gulliver/system/class.g.php | 6 ++++-- workflow/engine/classes/class.wsTools.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index de8e2d674..7fbff3ce9 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -391,9 +391,11 @@ class G return false; } $dir = opendir($source); - if (! file_exists($destination)) { - @mkdir($destination); + + if (!file_exists($destination)) { + G::mk_dir($destination, 0777); } + while (false !== ( $file = readdir($dir))) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($source . '/' . $file) ) { diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 6565710e3..5c65a144d 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -547,8 +547,9 @@ class workspaceTools //lenght = 2, because the function check . and .. dir links $newDiretory = G::getPathFromUIDPlain($UIdDir); CLI::logging("Migrating $UIdDir to $newDiretory\n"); - G::mk_dir($newDiretory); + G::mk_dir($newDiretory, 0777); //echo `cp -R $UIdDir/* $newDiretory/`; + if (G::recursive_copy($UIdDir, $newDiretory)) { CLI::logging("Removing $UIdDir...\n"); G::rm_dir($UIdDir); @@ -576,8 +577,9 @@ class workspaceTools $goalFile = $levelfile[$lastlevel - 1]; $newpattern = G::getPathFromFileUIDPlain($blackHoleDir, $goalFile); CLI::logging("Migrating $blackHoleDir file: $goalFile\n"); - G::mk_dir($blackHoleDir . '/' . $newpattern[0]); + G::mk_dir($blackHoleDir . PATH_SEP . $newpattern[0], 0777); //echo `cp -R $black$goalFile $black$newpattern[0]/$newpattern[1]`; + if (copy($black . $goalFile, $black . $newpattern[0] . '/' . $newpattern[1])) { unlink($file[$index]); } else {