diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 788ddb61c..fcdc711b9 100644 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -199,6 +199,12 @@ class workspaceTools $this->updatingWebEntryClassicModel($workSpace); $stop = microtime(true); CLI::logging("<*> Updating rows in Web Entry table for classic processes took " . ($stop - $start) . " seconds.\n"); + + $start = microtime(true); + CLI::logging("> Update framework paths...\n"); + $this->updatingFrameworkPaths($workSpace); + $stop = microtime(true); + CLI::logging("<*> Update framework paths took " . ($stop - $start) . " seconds.\n"); } /** @@ -3898,4 +3904,22 @@ class workspaceTools CLI::logging(CLI::error("Error:" . "Error updating generated class files for PM Tables, proceed to regenerate manually: " . $e)); } } + + /** + * Updating framework directory structure + * + */ + private function updatingFrameworkPaths($workSpace = SYS_SYS) + { + $paths = [ + PATH_DATA.'framework' => 0770, + PATH_DATA.'framework'.DIRECTORY_SEPARATOR.'cache' => 0770, + ]; + foreach ($paths as $path => $permission) { + if (!file_exists($path)) { + G::mk_dir($path, $permission); + } + CLI::logging(" $path [".(file_exists($path) ? 'OK' : 'MISSING')."]\n"); + } + } } diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index 64513a7b6..d47d26c56 100644 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -321,10 +321,12 @@ class Installer extends Controller if ($info->pathShared->result) { $info->pathShared->message = G::LoadTranslation('ID_WRITEABLE'); } else { + //Verify and create the shared path G::verifyPath( $_REQUEST['pathShared'], true ); $info->pathShared->result = G::is_writable_r( $_REQUEST['pathShared'], $noWritableFiles ); if ($info->pathShared->result) { $info->pathShared->message = G::LoadTranslation('ID_WRITEABLE'); + $info->success = $this->verifySharedFrameworkPaths($_REQUEST['pathShared']); } else { $info->success = false; } @@ -1739,4 +1741,25 @@ class Installer extends Controller } } } + + /** + * Verify/create framework shared directory structure + * + */ + private function verifySharedFrameworkPaths($sharedPath) + { + $paths = [ + $sharedPath.'framework' => 0770, + $sharedPath.'framework'.DIRECTORY_SEPARATOR.'cache' => 0770, + ]; + foreach ($paths as $path => $permission) { + if (!file_exists($path)) { + G::mk_dir($path, $permission); + } + if (!file_exists($path)) { + return false; + } + } + return true; + } }