PHP Classes

compressing files/folders

Recommend this page to a friend!

      PHP RAR Library  >  All threads  >  compressing files/folders  >  (Un) Subscribe thread alerts  
Subject:compressing files/folders
Summary:requires other resources
Messages:2
Author:Fred Savage
Date:2019-01-21 03:38:21
 

  1. compressing files/folders   Reply   Report abuse  
Picture of Fred Savage Fred Savage - 2019-01-21 03:38:21
This is a decent RAR class but after testing it is apparent that it does not actually "compress" the files/folders.

My findings are that due to it "mocking" RAR behavior and format, AV's may *falsely* flag it as a trojan (Trojan:Script/Foretype.A!ml or Trojan:HTML/Brocoiner.N!lib).

For those interested, there is a solution but it involves installing RAR on your OS (Windows or Unix) plus using PHP's shell_exec to execute RAR commands.

One does not actually need this class at all using RAR via shell_exec but this class does make it easier to manipulate files.

After this RAR-Archiver class creates your RAR archive, you can use shell_exec to instruct RAR to fix the file. This will indeed compress its contents properly and allow your archives to pass AV checks.

Please read the authentic GitHub account for Rar-Archiver class.
The author seems to be dormant for the moment therefore at this time I suggest reading my PR (pull request) for details about the needed change. It will give instruction and the necessary file edit.

I am hesitant to leave the GitHub link as the Administrator may find that in violation of his terms. Just use a search engine to find "GitHub rar archiver" and you should be able to find this authors account.

I hope this helps people in search of creating true compressed RAR archives.

Good luck.



  2. Re: compressing files/folders   Reply   Report abuse  
Picture of Dmitry Mamontov Dmitry Mamontov - 2019-01-21 08:47:49 - In reply to message 1 from Fred Savage
Greetings. in fact, I am preparing a new version of the class with the possibility of compression. presumably I will publish in March.