function fileDeleteDir($remoteDir) { $errorMess = true; $remoteDir = $remoteDir; $readDir = $remoteDir; if (is_dir($readDir)) { $filesArray = array(); $filesArray = fileReadDirContents($readDir); // do recursive delete if dir contains files // foreach ($filesArray as $name) { if (is_dir($readDir . '/' . $name)) { fileDeleteDir($remoteDir . '/' . $name); } elseif (file_exists($readDir . '/' . $name)) { if (!unlink($remoteDir . '/' . $name)) { throw new Exception(MSG00058); $errorMess = false; } } } // remove dir // if (rmdir($readDir)) { $errorMess = false; } else { $errorMess = true; } } else { $errorMess = true; } return $errorMess; }
function createWebsiteCopyTheme($fromDir, $toDir) { $readFromDir = $fromDir; $readToDir = $toDir; createDir($toDir); if (is_dir($readFromDir)) { $filesArray = array(); $filesArray = fileReadDirContents($readFromDir); foreach ($filesArray as $name) { if (is_dir($readFromDir . '/' . $name)) { $result = fileCopyDir($fromDir . '/' . $name, $toDir . '/' . $name); } elseif (file_exists($readFromDir . '/' . $name)) { if ($name == 'style.css' || $name == 'style.ie6.css' || $name == 'style.ie7.css' || $name == 'favicon.ico') { $result = fileCopy($fromDir . '/' . $name, $toDir . '/' . $name); } } } } }