Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $plugin_address="D:/processmaker-3.2.1-x/apps/processmaker/htdocs/cakephp/plugins";
- $rootPath = $plugin_address."/".$R;
- $zipFileName = $rootPath.'.zip';
- $zip = new ZipArchive();
- $zip->open($zipFileName, ZipArchive::CREATE | ZipArchive::OVERWRITE);
- $files = new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator($rootPath),
- RecursiveIteratorIterator::LEAVES_ONLY
- );
- foreach ($files as $name => $file)
- {
- if (!$file->isDir())
- {
- $filePath = $file->getRealPath();
- $relativePath = substr($filePath, strlen($rootPath) + 1);
- $filePath=str_replace("\","/",$filePath);
- $zip->addFile($filePath, $relativePath);
- }
- }
- $zip->close();
- $zipAdress="/var/www/cakephp/plugins/backup/EstelamBasic.zip";
- $plugin_address="/var/www/cakephp/plugins/EstelamBasic/";
- $zip = new ZipArchive;
- $res = $zip->open($zipAdress);
- if ($res === TRUE) {
- $zip->extractTo($plugin_address);
- $zip->close();
- }
Add Comment
Please, Sign In to add comment