web/wp-content/plugins/duplicator/inc/class.zip.php
author Anthony Ly <anthonyly.com@gmail.com>
Tue, 12 Mar 2013 18:21:39 +0100
changeset 206 919b4ddb13fa
parent 204 09a1c134465b
permissions -rw-r--r--
modification logo footer cccb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
195
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     1
<?php 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     2
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     3
class Duplicator_Zip 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     4
{
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     5
	protected $limit = DUPLICATOR_ZIP_FILE_POOL;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     6
	protected $zipArchive;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     7
	protected $rootFolder;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     8
	protected $skipNames;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     9
	protected $zipFilePath;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    10
	private   $limitItems = 0;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    11
	
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    12
	/**
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    13
	 *  DUPLICATOR ZIP
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    14
	 *  Creates the zip file
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    15
	 *
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    16
	 *  @param string $zipFilePath	The full path to the zip file that will be made
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    17
	 *  @param string $folderPath	The folder that will be zipped
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    18
	 *  @param string $sqlfilepath	The path to the database file to include in the package
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    19
	 */
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    20
	function __construct($zipFilePath, $folderPath, $sqlfilepath) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    21
		try 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    22
		{
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    23
		
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    24
			duplicator_log("log:class.zip=>started");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    25
			duplicator_log("archive this folder: {$folderPath}");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    26
			duplicator_log("archive file name:   {$zipFilePath}");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    27
			
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    28
			$this->zipArchive  = new ZipArchive();
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    29
			$this->zipFilePath = duplicator_safe_path($zipFilePath);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    30
			$this->rootFolder  = rtrim(duplicator_safe_path($folderPath), '/');
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    31
			$this->skipNames   = $GLOBALS['duplicator_skip_ext-array'];
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    32
			
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    33
			$exts_list = implode(";", $this->skipNames);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    34
			$path_list = implode(";", $GLOBALS['duplicator_bypass-array']);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    35
			duplicator_log("filter file extensions: '{$exts_list}'");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    36
			duplicator_log("filter directory paths: '{$path_list}'");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    37
			
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    38
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    39
			if ($this->zipArchive->open($this->zipFilePath, ZIPARCHIVE::CREATE) === TRUE) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    40
				duplicator_log("zipArchive opened");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    41
			} 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    42
			else {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    43
				$err = "cannot open <{$this->zipFilePath}>";
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    44
				duplicator_log($err);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    45
				throw new Exception($err);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    46
			}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    47
			
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    48
			//Recursive Call
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    49
			$this->resursiveZip($this->rootFolder);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    50
			
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    51
			//ADD SQL File
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    52
			$this->zipArchive->addFile($sqlfilepath, "database.sql");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    53
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    54
			duplicator_log("archive info: " . print_r($this->zipArchive, true));
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    55
			duplicator_log("close returned: " . $this->zipArchive->close() . " (if null check your disk quota)" );
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    56
			duplicator_log("log:class.zip=>ended");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    57
		} 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    58
		catch(Exception $e) 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    59
		{
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    60
			duplicator_log("log:class.zip=>runtime error: " . $e);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    61
		}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    62
	}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    63
	
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    64
	
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    65
	function resursiveZip($directory)
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    66
	{
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    67
		try 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    68
		{
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    69
			$folderPath = duplicator_safe_path($directory);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    70
			if(!$dh = opendir($folderPath)) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    71
				return false;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    72
			}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    73
			
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    74
			//EXCLUDE: Snapshot directory
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    75
			if( strstr($folderPath, DUPLICATOR_SSDIR_PATH)) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    76
				return;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    77
			}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    78
			
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    79
			//EXCLUDE: Directory Exclusions List
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    80
			if ($GLOBALS['duplicator_bypass-array'] != null) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    81
				foreach ($GLOBALS['duplicator_bypass-array'] as $val) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    82
					if (duplicator_safe_path($val) == $folderPath) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    83
						duplicator_log("path filter found: {$val}", 2);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    84
						return;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    85
					}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    86
				}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    87
			}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    88
			
204
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
    89
			/* Legacy: Excludes empty diretories and files with no extention
195
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    90
			while (false !== ($file = @readdir($dh))) { 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    91
				if ($file != '.' && $file != '..') { 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    92
					$fullpath = "{$folderPath}/{$file}";
204
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
    93
					
195
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    94
					if(is_dir($fullpath)) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    95
						duplicator_fcgi_flush();
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    96
						$this->resursiveZip($fullpath);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    97
					}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    98
					else if(is_file($fullpath) && is_readable($fullpath)) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    99
						//Check filter extensions
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   100
						if(!in_array(@pathinfo($fullpath, PATHINFO_EXTENSION), $this->skipNames)) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   101
							$localpath = str_replace($this->rootFolder, '', $folderPath);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   102
							$localname = empty($localpath) ? '' : ltrim("{$localpath}/", '/');
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   103
							$this->zipArchive->addFile("{$folderPath}/{$file}", "{$localname}{$file}");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   104
						}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   105
					} 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   106
					$this->limitItems++;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   107
				}
204
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   108
			} */
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   109
			
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   110
			
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   111
			while (false !== ($file = @readdir($dh))) {
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   112
                 if ($file != '.' && $file != '..') {
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   113
                    $fullpath = "{$folderPath}/{$file}";
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   114
					$localpath = str_replace($this->rootFolder, '', $folderPath);
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   115
					$localname = empty($localpath) ? '' : ltrim("{$localpath}/", '/');
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   116
                     if(is_dir($fullpath)) {
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   117
                         duplicator_fcgi_flush();
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   118
 						 $this->zipArchive->addEmptyDir("{$localname}{$file}");
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   119
                         $this->resursiveZip($fullpath);
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   120
                     }
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   121
                     else if(is_file($fullpath) && is_readable($fullpath)) {
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   122
                         //Check filter extensions
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   123
                        $ext = @pathinfo($fullpath, PATHINFO_EXTENSION);
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   124
                        if($ext == '' || !in_array($ext, $this->skipNames)) {
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   125
							$this->zipArchive->addFile("{$folderPath}/{$file}", "{$localname}{$file}");
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   126
                        }
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   127
                     }
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   128
					 $this->limitItems++;
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   129
				}
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   130
			}
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   131
			
09a1c134465b man wordpress + plugins order post + slideshow
Anthony Ly <anthonyly.com@gmail.com>
parents: 195
diff changeset
   132
			
195
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   133
			
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   134
			//Check if were over our count
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   135
			if($this->limitItems > $this->limit) {
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   136
				duplicator_log("log:class.zip=>new open handle {$this->zipArchive->numFiles}");
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   137
				$this->zipArchive->close();
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   138
				$this->zipArchive->open($this->zipFilePath, ZIPARCHIVE::CREATE);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   139
				$this->limitItems = 0;
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   140
				duplicator_fcgi_flush();
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   141
			}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   142
			
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   143
			closedir($dh);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   144
		} 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   145
		catch(Exception $e) 
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   146
		{
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   147
			duplicator_log("log:class.zip=>runtime error: " . $e);
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   148
		}		
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   149
	}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   150
}
c7c0fbc09788 ajout du plugin Duplicator
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
   151
?>