fileName = $fileName; $this->createZip = new createDirZip(); } public function addDirectory($directoryPath, $zipPath) { $this->createZip->addDirectory($zipPath); $this->createZip->get_files_from_folder($directoryPath, $zipPath); } public function addFile($filePath, $parentDirectory) { if(empty($parentDirectory)) { $this->addTrailingSlash($parentDirectory); } $filedata = implode("", file($filePath)); $this->createZip->addFile($filedata,$parentDirectory.'database.sql'); } public function close() { $fd = fopen ($this->fileName, 'wb'); $out = fwrite ($fd, $this->createZip->getZippedfile()); fclose ($fd); } } ?>