PhpConcept

Developers Tools

  • Increase font size
  • Default font size
  • Decrease font size
Home PclZip User Guide

PclZip User Guide - PCLZIP_OPT_REPLACE_NEWER

Print PDF

PCLZIP_OPT_REPLACE_NEWER

By default PclZip, while extracting a file from the archive, follow these rules : if the file exist but has an older timeset, then it is replaced by the one coming from the archive. If the file in the archive is older, the file is not replaced.

By using PCLZIP_OPT_REPLACE_NEWER, you give to PclZip the ability to extract and replace the existing file in any situation. This can be usefull in situation like restoring an backup copy of some files/folders.

    $archive = new PclZip('test.zip');
    
$list $archive->extract(PCLZIP_OPT_BY_NAME"data/readme.txt",
                              
PCLZIP_OPT_REPLACE_NEWER);
    if (
$list == 0) {
      echo 
"ERROR : ".$archive->errorInfo(true);
    }
 

 

[Optional Arguments List]

 

Last Updated on Friday, 18 December 2009 13:25