Archive_Tar::create PHP Method

create() public method

If a file with the same name exist and is writable, it is replaced by the new tar. The method return false and a PEAR error text. The $p_filelist parameter can be an array of string, each string representing a filename or a directory name with their path if needed. It can also be a single string with names separated by a single blank. For each directory added in the archive, the files and sub-directories are also added. See also createModify() method for more details.
See also: createModify()
public create ( array $p_filelist ) : true
$p_filelist array An array of filenames and directory names, or a single string with names separated by a single blank space.
return true on success, false on error.
    function create($p_filelist)
    {
        return $this->createModify($p_filelist, '', '');
    }

Usage Example

Ejemplo n.º 1
0
 protected function getArchive()
 {
     $obj = new Archive_Tar($this->getBackupFile());
     if (!is_file($this->getBackupFile())) {
         $files = array();
         if (!$obj->create($files)) {
             echo "can't create archive";
         }
     }
     return $obj;
 }
All Usage Examples Of Archive_Tar::create