DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

Erhan Kฤฑlฤฑรง
Erhan Kฤฑlฤฑรง

Posted on

Php ZipMaster - Zip files and folders with php

Hello to everyone. This is my first article. If there are any mistakes, please do not look up.

Compressing files in PHP and creating a zip file is easy, but the situation changes when you include folders into the job. You may want to automatically back up the files on your server like me and you may want to have a solution for it. I have a vps with a lot of sites and I want these sites to be automatically backed up. My solution is to write a script in PHP creates a cronjob.

It is simple to use and you can use it as you like. Please do not hesitate if you want to improve.

Sample use;

<?php

include 'ZipMaster.php';

$zip = new ZipMaster\ZipMaster('backup/test.zip', 'test_folder');
$zip->archive();

You can reach the project here.

Top comments (0)

Timeless DEV post...

How to write a kickass README

Arguably the single most important piece of documentation for any open source project is the README. A good README not only informs people what the project does and who it is for but also how they use and contribute to it.

If you write a README without sufficient explanation of what your project does or how people can use it then it pretty much defeats the purpose of being open source as other developers are less likely to engage with or contribute towards it.