ArchiveSevenZip
extends BaseArchive
in package
Table of Contents
Properties
- $archiveType : string
- $basename : string|null
- $binaryPath : string|null
- $count : int
- $extension : string|null
- $filename : string|null
- $files : array<string|int, ArchiveItem>
- $outputDirectory : string|null
- $password : string|null
- $path : string|null
- $pdf : PdfMeta|null
- $stat : ArchiveStat|null
- $tempDir : string|null
- $type : ArchiveEnum|null
Methods
- binaryP7zipTest() : bool
- bytesToHuman() : string|null
- extract() : array<string|int, string>
- Extract selected files from archive.
- extractAll() : array<string|int, string>
- Extract all files from archive.
- fileIsDirectory() : bool
- fileIsHidden() : bool
- fileIsImage() : bool
- filter() : array<string|int, ArchiveItem>|null
- Filter files by search to get `ArchiveItem[]`.
- find() : ArchiveItem|null
- Find file by search to get `ArchiveItem`.
- getBasename() : string
- Get basename of the archive.
- getContent() : string|null
- Get content from file.
- getContents() : string|null
- Get content from file.
- getCount() : int
- Get count of files.
- getExtension() : string
- Get extension of the archive.
- getFileItem() : ArchiveItem|null
- Get file from archive from path.
- getFileItems() : array<string|int, ArchiveItem>
- Get files from archive.
- getFilename() : string
- Get filename of the archive.
- getFiles() : array<string|int, ArchiveItem>
- getFirst() : ArchiveItem
- Get first file from archive.
- getLast() : ArchiveItem
- Get last file from archive.
- getPath() : string
- Get path to the archive.
- getPdf() : PdfMeta|null
- Get PDF metadata.
- getStat() : ArchiveStat|null
- Get archive stat.
- getText() : string|null
- Get text from file.
- getType() : ArchiveEnum
- Get `ArchiveEnum` of the archive.
- overrideBinaryPath() : static
- Override binary path for `7z` or `rar` command.
- pathToOsPath() : string
- read() : self
- Create a new instance of Archive with path.
- recurseRmdir() : mixed
- timestampToDateTime() : DateTime
- __construct() : mixed
- convertStream() : string
- createItemFromSplFileInfo() : ArchiveItem
- extensionImagickTest() : bool
- extensionRarTest() : bool
- findFiles() : array<string|int, ArchiveItem>
- getAllFiles() : array<string|int, mixed>
- setup() : static
- sortFiles() : mixed
- parse() : static
Properties
$archiveType
protected
string
$archiveType
= '7z'
$basename
protected
string|null
$basename
= null
$binaryPath
protected
string|null
$binaryPath
= null
$count
protected
int
$count
= 0
$extension
protected
string|null
$extension
= null
$filename
protected
string|null
$filename
= null
$files
protected
array<string|int, ArchiveItem>
$files
= []
$outputDirectory
protected
string|null
$outputDirectory
= null
$password
protected
string|null
$password
= null
$path
protected
string|null
$path
= null
protected
PdfMeta|null
$pdf
= null
$stat
protected
ArchiveStat|null
$stat
= null
$tempDir
protected
string|null
$tempDir
= null
$type
protected
ArchiveEnum|null
$type
= null
Methods
binaryP7zipTest()
public
static binaryP7zipTest([bool $exception = true ]) : bool
Parameters
- $exception : bool = true
Return values
boolbytesToHuman()
public
static bytesToHuman(mixed $bytes) : string|null
Parameters
- $bytes : mixed
Return values
string|nullextract()
Extract selected files from archive.
public
extract(string $toPath, array<string|int, mixed> $files) : array<string|int, string>
Parameters
- $toPath : string
- $files : array<string|int, mixed>
Return values
array<string|int, string>extractAll()
Extract all files from archive.
public
extractAll(string $toPath) : array<string|int, string>
Parameters
- $toPath : string
Return values
array<string|int, string>fileIsDirectory()
public
static fileIsDirectory(string $path) : bool
Parameters
- $path : string
Return values
boolfileIsHidden()
public
static fileIsHidden(string $filename) : bool
Parameters
- $filename : string
Return values
boolfileIsImage()
public
static fileIsImage(string|null $extension) : bool
Parameters
- $extension : string|null
Return values
boolfilter()
Filter files by search to get `ArchiveItem[]`.
public
filter(string $search[, bool $skipHidden = true ]) : array<string|int, ArchiveItem>|null
Parameters
- $search : string
- $skipHidden : bool = true
Return values
array<string|int, ArchiveItem>|nullfind()
Find file by search to get `ArchiveItem`.
public
find(string $search[, bool $skipHidden = true ]) : ArchiveItem|null
Parameters
- $search : string
- $skipHidden : bool = true
Return values
ArchiveItem|nullgetBasename()
Get basename of the archive.
public
getBasename() : string
Return values
stringgetContent()
Get content from file.
public
getContent(ArchiveItem|null $file[, bool $toBase64 = false ]) : string|null
Use getContents() instead
Parameters
- $file : ArchiveItem|null
- $toBase64 : bool = false
Return values
string|nullgetContents()
Get content from file.
public
getContents(ArchiveItem|null $file[, bool $toBase64 = false ]) : string|null
Parameters
- $file : ArchiveItem|null
- $toBase64 : bool = false
Return values
string|nullgetCount()
Get count of files.
public
getCount() : int
Return values
intgetExtension()
Get extension of the archive.
public
getExtension() : string
Return values
stringgetFileItem()
Get file from archive from path.
public
getFileItem(string $path) : ArchiveItem|null
Parameters
- $path : string
-
Path to the file in the archive.
Return values
ArchiveItem|nullgetFileItems()
Get files from archive.
public
getFileItems() : array<string|int, ArchiveItem>
Return values
array<string|int, ArchiveItem>getFilename()
Get filename of the archive.
public
getFilename() : string
Return values
stringgetFiles()
public
getFiles() : array<string|int, ArchiveItem>
Use getFileItems() instead.
Return values
array<string|int, ArchiveItem>getFirst()
Get first file from archive.
public
getFirst() : ArchiveItem
Return values
ArchiveItemgetLast()
Get last file from archive.
public
getLast() : ArchiveItem
Return values
ArchiveItemgetPath()
Get path to the archive.
public
getPath() : string
Return values
stringgetPdf()
Get PDF metadata.
public
getPdf() : PdfMeta|null
Return values
PdfMeta|nullgetStat()
Get archive stat.
public
getStat() : ArchiveStat|null
Return values
ArchiveStat|nullgetText()
Get text from file.
public
getText(ArchiveItem $file) : string|null
Parameters
- $file : ArchiveItem
Return values
string|nullgetType()
Get `ArchiveEnum` of the archive.
public
getType() : ArchiveEnum
Return values
ArchiveEnumoverrideBinaryPath()
Override binary path for `7z` or `rar` command.
public
overrideBinaryPath(string $path) : static
Parameters
- $path : string
Return values
staticpathToOsPath()
public
static pathToOsPath(string $path) : string
Parameters
- $path : string
Return values
stringread()
Create a new instance of Archive with path.
public
static read(string $path[, string|null $password = null ]) : self
Parameters
- $path : string
- $password : string|null = null
Return values
selfrecurseRmdir()
public
static recurseRmdir(string $dir) : mixed
Parameters
- $dir : string
timestampToDateTime()
public
static timestampToDateTime(int $timestamp) : DateTime
Parameters
- $timestamp : int
Return values
DateTime__construct()
protected
__construct() : mixed
convertStream()
protected
convertStream(mixed $stream) : string
Parameters
- $stream : mixed
Return values
stringcreateItemFromSplFileInfo()
protected
createItemFromSplFileInfo(SplFileInfo $file, string $output) : ArchiveItem
Parameters
- $file : SplFileInfo
- $output : string
Return values
ArchiveItemextensionImagickTest()
protected
static extensionImagickTest([bool $exception = true ]) : bool
Parameters
- $exception : bool = true
Return values
boolextensionRarTest()
protected
static extensionRarTest([bool $exception = true ]) : bool
Parameters
- $exception : bool = true
Return values
boolfindFiles()
protected
findFiles(string $search, bool $skipHidden) : array<string|int, ArchiveItem>
Parameters
- $search : string
- $skipHidden : bool
Return values
array<string|int, ArchiveItem>getAllFiles()
protected
getAllFiles(string $path) : array<string|int, mixed>
Parameters
- $path : string
Return values
array<string|int, mixed>setup()
protected
setup(string $path) : static
Parameters
- $path : string
Return values
staticsortFiles()
protected
sortFiles() : mixed
parse()
private
parse() : static