1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-10 08:34:09 +02:00

Scheduled Tasks: Database Backup now zips up the .sql file.

This commit is contained in:
Cameron
2015-04-06 13:59:15 -07:00
parent cfd438c827
commit b6dfef6b62
4 changed files with 34 additions and 7 deletions

View File

@@ -970,7 +970,7 @@ class e_file
* @param string $newFile
*/
public function zip($filePaths=null, $newFile='')
public function zip($filePaths=null, $newFile='', $options=array())
{
if(empty($newFile))
{
@@ -984,8 +984,10 @@ class e_file
require_once(e_HANDLER.'pclzip.lib.php');
$archive = new PclZip($newFile);
if ($archive->create($filePaths, PCLZIP_OPT_REMOVE_PATH,e_BASE) == 0)
$removePath = (!empty($options['remove_path'])) ? $options['remove_path'] : e_BASE;
if ($archive->create($filePaths, PCLZIP_OPT_REMOVE_PATH, $removePath) == 0)
{
$error = $archive->errorInfo(true);
e107::getAdminLog()->addError($error)->save('FILE',E_LOG_NOTICE);