Bitrix API

CZip implements IBXArchive

Table of Contents

Interfaces

IBXArchive

Constants

ReadBlockSize  = 2048

Properties

$zipfile  : mixed
$zipname  : mixed

Methods

__construct()  : mixed
Add()  : array<string|int, mixed>|int
Archives files and folders
Create()  : array<string|int, mixed>|int
Creates an archive
Delete()  : array<string|int, mixed>|int
Deletes a file from the archive
Extract()  : array<string|int, mixed>|int
Extracts archive content
GetContent()  : array<string|int, mixed>|int
Returns the list of files and folders in the archive
GetErrors()  : array<string|int, mixed>
Returns an array containing error codes and messages. Call this method after Pack or Unpack
GetOptions()  : array<string|int, mixed>
Returns an array of packing/unpacking options and their current values
GetProperties()  : array<string|int, mixed>|int
Returns archive properties
GetStartFile()  : string
Called from the archive object it returns the name of the file for the next step during multistep archivation. Call if Pack method returned 2
Pack()  : mixed
Packs files and folders into archive
SetOptions()  : void
Lets the user define packing/unpacking options
Unpack()  : mixed
Unpacks archive into specified folder

Constants

ReadBlockSize

public mixed ReadBlockSize = 2048

Properties

$zipfile

public mixed $zipfile = 0

$zipname

public mixed $zipname = ''

Methods

__construct()

public __construct(mixed $pzipname) : mixed
Parameters
$pzipname : mixed

Add()

Archives files and folders

public Add(array<string|int, mixed> $arFileList[, array<string|int, mixed>|int $arParams = 0 ]) : array<string|int, mixed>|int
Parameters
$arFileList : array<string|int, mixed>

containing files and folders to be packed into archive

$arParams : array<string|int, mixed>|int = 0
  • if specified contains options to use for archivation
Return values
array<string|int, mixed>|int

0 or false if error, array with the list of packed files and folders if success. Errors can be seen using GetErrors() method

Create()

Creates an archive

public Create(array<string|int, mixed> $arFileList[, array<string|int, mixed>|int $arParams = 0 ]) : array<string|int, mixed>|int
Parameters
$arFileList : array<string|int, mixed>

containing files and folders to be added to the archive

$arParams : array<string|int, mixed>|int = 0

an array of parameters

Return values
array<string|int, mixed>|int

0 if error, array $arResultList with packed files if success

Delete()

Deletes a file from the archive

public Delete(array<string|int, mixed> $arParams) : array<string|int, mixed>|int
Parameters
$arParams : array<string|int, mixed>

rules defining which files should be deleted

Return values
array<string|int, mixed>|int

0 if error, array $arResultList with deleted files if success

Extract()

Extracts archive content

public Extract([array<string|int, mixed>|int $arParams = 0 ]) : array<string|int, mixed>|int
Parameters
$arParams : array<string|int, mixed>|int = 0

an array of parameters

Return values
array<string|int, mixed>|int

0 or false if error, array of extracted files and folders if success. Errors can be seen using GetErrors() method

GetContent()

Returns the list of files and folders in the archive

public GetContent() : array<string|int, mixed>|int
Return values
array<string|int, mixed>|int

0 if error, array of results if success

GetErrors()

Returns an array containing error codes and messages. Call this method after Pack or Unpack

public GetErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>

GetOptions()

Returns an array of packing/unpacking options and their current values

public GetOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

GetProperties()

Returns archive properties

public GetProperties() : array<string|int, mixed>|int
Return values
array<string|int, mixed>|int

0 if error, array $arProperties if success

GetStartFile()

Called from the archive object it returns the name of the file for the next step during multistep archivation. Call if Pack method returned 2

public GetStartFile() : string
Return values
string

path to file

Pack()

Packs files and folders into archive

public Pack(array<string|int, mixed> $arFileList[, string $startFile = "" ]) : mixed
Parameters
$arFileList : array<string|int, mixed>

containing files and folders to be packed into archive

$startFile : string = ""
  • if specified then all files before it won't be packed during the traversing of $arFileList. Can be used for multistep archivation
Return values
mixed

0 or false if error, 1 if success, 2 if the next step should be performed. Errors can be seen using GetErrors() method

SetOptions()

Lets the user define packing/unpacking options

public SetOptions(array<string|int, mixed> $arOptions) : void
Parameters
$arOptions : array<string|int, mixed>

an array with the options' names and their values

Unpack()

Unpacks archive into specified folder

public Unpack(string $strPath) : mixed
Parameters
$strPath : string
  • path to the directory to unpack archive to
Return values
mixed

0 or false if error, 1 if success. Errors can be seen using GetErrors() method


        
On this page

Search results