Files Backup Pro Class
Version: 1.3
Last update: 3 year ago
Platforms: PHP, WebDAV, FTP, MAIL, HTTP, ZIP
Example included: yes
Asq a question Purchase
description

Files Backup Pro Class allows you:

  • backup your files as ZIP archive;
  • upload backup to FTP server;
  • send backup as email attachment;
  • upload to Google Drive, Dropbox, Box, SkyDrive and other cloud using WebDAV;
  • send to server using PUTS HTTP;
  • exclusion filter for files and folders;
  • use CRON to automate backup your data;
  • easy installation on any server;
  • examples of both functions are included;
  • fully documented.
installation

Copy backup.php on your server and include in PHP script when you need it:

require_once('backup.php');
create backup

Function File_backup::zip($params) can get parameters:

  • $params['path'] : Path to files;
  • $params['extensions'] : Exclusion filter for files (exclude from backup files by extension);
  • $extensions = array('zip','png','ignore');
  • $params['exclusions'] : Exclusion filter for folders (exclude from backup folders by path);
  • $exclusions = array('/images/','/files/');
  • strong>$params['temp'] : Path to save files. By default script's folder
save

Save backup on server. Parameters:

  • $path - path to save file
File_backup::zip($params)->save($path);
mail

Send backup as attachment on email. Parameters:

  • $email - email address receive backup files
File_backup::zip($params)->mail('your_emal@mail.com');
ftp

Upload backup to FTP server. Parameters (array):

  • server - server name or ip;
  • user - username;
  • pass - password;
  • dest - folder when file is saving.
File_backup::zip($params)->ftp($ftp_params);
http

Upload backup to HTTP server using method PUTS. Parameters (array):

  • server - server name or ip;
  • user - username;
  • pass - password.
File_backup::zip($params)->http($http_params);
webdav

Upload backup to cloud using WebDAV. Support services:

  • Google Drive (https://dav-pocket.appspot.com);
  • Box.com;
  • Dropbox (http://dropdav.com);
  • SkyDrive;
  • Yandesk.Disk;
  • and other supported WebDAV.

Parameters (array):

  • server - server name;
  • user - username;
  • pass - password.

Strongly recommended to use single quotes with password: 'pass'=>'my_pass_$_with_dollar'

File_backup::zip($params)->webdav($webdav_params);

remove

Remove files after sending.

Example:

Backup::init($params)->as_sql()->zip()->http($http_params)->remove();
showerrors

Show Errors, collected in the class.

Example:

Backup::init($params)->as_sql()->zip()->showErrors();
Changelog
Version 1.3
  • Add remove method
  • Add temp path parameter
  • New error system
Version 1.1
  • Minor bug fixes
Version 1.0
  • Released
0