The configuration options of
Rar for PHP are the next:
- $rar: You must put here the path to rar.exe file.
- $rarpasswords: If you would like save the passwords of the files you compress, put here the path
o the file to save it. Otherwise, you should put nothing here.
- $defaultCompression: You must put here the default compression level
- "NINGUNO" - Without compression
- "BAJO" - Low compression
- "MEDIO" - Medium compression
- "NORMAL" - Normal compression
- "ALTO" - High compression
- "MAXIMO" - Maximun compression
You should have present that more compression take more time to finish.
- $mkSolid: If you put true the out file will be solid. This is useful if you have a lot of little files
to add in 1 package.
- $limitetiempo: It's the max time of execution of the script
With this functions you can configure the compression parameters to each file you create:
- setPassword(txtContraseña): If you would like a file with password you must call this function before compress nothing.
You can put in txtContraseña the desired password. Call this function withos parameters to make a random password among 8-32 characters.
- compression(txtNivelCompres, boolSolido): With this function you can adjust the compression level.
The first parameter is the level of compression (see Configuration) and the second choose between solid or not solid file (true or false)
- getPassword(): Return the actual password used to compress the files.
- setRecovery(intRatio): Add recovery data to the volume. The parameter intRatio is an integer with the percent
of recovery data will be added (1-10).
This functions are used to compress files and folders:
- addfile(txtArchivo): Add to the package the file indicated by txtArchivo
- addfolder(txtCarpeta, boolRecursivo): Add to the package the folder indicated by txtCarpeta.
This compress all the files and folders that contains the txtCarpeta. If you wouldn't like a recursive compression, you should put in
boolRecursivo "false". Otherwise, put "true" or nothing
- addList(arrayLista): Add a list of files and folders indicated by arrayLista.
This parameter can be an array with the list or a string separated with ";"