PHP Classes

Big Backup maker: Create backup of a directory in an archive file

Recommend this page to a friend!
  Info   View files Example   View files View files (20)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 373 This week: 1All time: 6,776 This week: 571Up
Version License PHP version Categories
bbm 1.0.0Custom (specified...5PHP 5, Files and Folders, Systems adm...
Description 

Author

This class can create a backup of a directory in an archive file.

It can traverse a given directory and retrieve the list of files to backup.

The class than can create a compressed archive in another directory with the contents of the files to backup to be downloaded without time limitation or folder size limitation and without touching the PHP INI configurations like max_execution_time or memory_limit.

Innovation Award
PHP Programming Innovation award nominee
September 2017
Number 4
Many sites need to perform backup operations so they can have additional copies of the information and files they need to work correctly.

Taking a backup of data of a site may take a long time, especially when there is a lot of files and data to copy.

When the process takes too long, it may be impossible to complete the whole process during a single run of a PHP script because in many hosting environments a script may only run for a limited length of time and using a limited amount or memory.

This package implements an approach that works around this limitation of running long time PHP scripts. It uses session variables to keep track of the backup progress and output data contents.

Then it redirects the user browser to the same script, so it can resume where the process was suspended as many times as necessary.

Manuel Lemos
Picture of zinsou A.A.E.Moïse
  Performance   Level  
Name: zinsou A.A.E.Moïse is available for providing paid consulting. Contact zinsou A.A.E.Moïse .
Classes: 50 packages by
Country: Benin Benin
Age: 34
All time rank: 6781 in Benin Benin
Week rank: 420 Up2 in Benin Benin Down
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

Example

<?php
session_start
();
include_once
'../BigBackupMaker.class.php';
$Dir = new BigBackupMaker();
$mypath="../../pootest/wp-includes/";/*relative path works in every situation ...for test you must
replace the folder by existing folder...here "pootest" is supposed to be in root directory of the server
but you can choose any directory provided that your relative path is correct*/

$Dir->Read($mypath, "", true,true,false,"", "" );
$Dir->ActForCompress($mypath,"./tocompress.php");
?>


Details

Package for reading a directory structure and backup the chosen types of files and folders in another directory or in compressed archive to be automatically downloaded. This package can take the path of a folder and rebuild the hierachy of subfolders and copy all the chosen files in another folder or in a compressed archive to be downloaded without time limitation or folder size limitation and without touching the PHP INI configurations like max_execution_time or memory_limit. When you want to make a big size backup you can't exactly know how many time it will take so you can't just set a time like 9999 seconds and be sure that your folder with a size up to 1 giga and more will effectively be saved as you except.Now you can even if the max time is lower and the memory limit is the default size without worries make very large size backup. See some how to use examples in the examples folder. examples for compress and download are compressmaker.php and tocompress.php examples for backup in a specified folder are archivemaker.php and copyfile.php some other examples to simply show what else the package can do are in the file othersimpletests.php the class declaration,methods, and properties are well documented in comments in the class source BigBackupMaker.class.php The package also used two excellent third party packages found in the PHPCLASSES REPOSITORY and already included(so no need to download): BF_DOWNLOAD(binary files download) and UNIFIED-ARCHIVE(thanks to these authors for their perfect work...). You can therefore use all of the features of these two packages without the main classes: so you could read and extract archive or even create provided that you read the documentation... you could also serve files for download supporting resume and speed limitation... The package itself is based on the precious package CDIR of Hannesd found too in the PHPCLASSES REPOSITORY(Thanks to him for his precious works that inspired me)... keep in mind that the package only take care of the steps of files copy so it will be judicious to set your time at least at 60 seconds that will be sufficient in the most of case for rebuilding the folders hierachy For bug reporting,feedback and improvement please feel free to contact me at: leizmo@gmail.com or simply use the PHPCLASSES forum dedicated to this package...

  Files folder image Files  
File Role Description
Files folder imageexamples (5 files)
Files folder imagesrc (9 files, 1 directory)
Plain text file BigBackupMaker.class.php Class BigBackupMaker main class source
Accessible without login Plain text file license.txt Lic. license file
Accessible without login Plain text file readme.txt Doc. readme

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file archivemaker.php Example example script
  Accessible without login Plain text file compressmaker.php Example example script
  Accessible without login Plain text file copyfile.php Example example script
  Accessible without login Plain text file othersimpletests.php Example example script
  Accessible without login Plain text file tocompress.php Example example script

  Files folder image Files  /  src  
File Role Description
Files folder imagelicenseanddoc (3 files)
  Plain text file AbstractArchive.php Class auxilliary class source
  Plain text file class.Bf_Download.php Class auxilliary class source
  Accessible without login Plain text file function.gzip_stat.php Aux. auxilliary functions script
  Accessible without login Plain text file loadmyarchiver.php Aux. auxilliary script third party loader
  Plain text file LzwStreamWrapper.php Class auxilliary class source
  Plain text file PclZipLikeZipArchiveInterface.php Class auxilliary class source
  Plain text file PclZipOriginalInterface.php Class auxilliary class source
  Accessible without login Plain text file REGISTER_LZW_STREAM_WRAPPER.php Aux. auxilliary script
  Plain text file UnifiedArchive.php Class auxilliary class source

  Files folder image Files  /  src  /  licenseanddoc  
File Role Description
  Accessible without login Plain text file doc.archiveNodes.md Doc. auxilliary documentation
  Accessible without login Plain text file LICENSE.md Doc. auxilliary license file
  Accessible without login Plain text file README.md Doc. auxilliary documentation

 Version Control Unique User Downloads Download Rankings  
 0%
Total:373
This week:1
All time:6,776
This week:571Up