FILE COMPRESSER USING PHP

Adeyeye George
2 min readAug 22, 2020

--

Today i was looking for various means to compress all files using PHP without using any third party online tools but unfortunately what i found was zip archives compress, zar and the rest. There was no single library on the internet designed with PHP to handle file compression including compressing zip files. I was curious and i had to design one.

I eventually did the design which i tested with a zip file having size of about 9.5MB and my PHP Class was able to compress this down to 8.2MB which was still okay for me. At least over 1.3MB was removed from the actual zip file.

I know you will want to ask whats the difference. The truth is that assuming you have a whole bunch of those zip files lets say 10 in which each had 9.5MB. Calculating this will give you a bunch of 95MB, thats lots of memory.

Looking through this you will see that over 13MB difference was removed when compressed. This 13MB could be used to save other files.

Designing a class that does this job took me 4 hours with over 15 test analysis.

If you are also curious about me and wish to use my library for your applications you can also find the github library here.

Please feel free to make a pull request incase you find any bugs or want to add something to it.

Best of wishes.

--

--

Adeyeye George
Adeyeye George

Written by Adeyeye George

Innovative tech mind with over 8 years of experience working as a professional programmer.

No responses yet