Documentation

ArchiveRar extends BaseArchive
in package

Table of Contents

Properties

$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()  : BaseArchive
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
createArchiveItem()  : ArchiveItem
parse()  : static
parser()  : mixed

Properties

$binaryPath

protected string|null $binaryPath = null

$outputDirectory

protected string|null $outputDirectory = null

Methods

binaryP7zipTest()

public static binaryP7zipTest([bool $exception = true ]) : bool
Parameters
$exception : bool = true
Return values
bool

bytesToHuman()

public static bytesToHuman(mixed $bytes) : string|null
Parameters
$bytes : mixed
Return values
string|null

extract()

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
bool

fileIsHidden()

public static fileIsHidden(string $filename) : bool
Parameters
$filename : string
Return values
bool

fileIsImage()

public static fileIsImage(string|null $extension) : bool
Parameters
$extension : string|null
Return values
bool

filter()

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>|null

find()

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|null

getBasename()

Get basename of the archive.

public getBasename() : string
Return values
string

getContent()

Get content from file.

public getContent(ArchiveItem|null $item[, bool $toBase64 = false ]) : string|null

Use getContents() instead

Parameters
$item : ArchiveItem|null
$toBase64 : bool = false
Return values
string|null

getContents()

Get content from file.

public getContents(ArchiveItem|null $item[, bool $toBase64 = false ]) : string|null
Parameters
$item : ArchiveItem|null
$toBase64 : bool = false
Return values
string|null

getCount()

Get count of files.

public getCount() : int
Return values
int

getExtension()

Get extension of the archive.

public getExtension() : string
Return values
string

getFileItem()

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|null

getFilename()

Get filename of the archive.

public getFilename() : string
Return values
string

getPath()

Get path to the archive.

public getPath() : string
Return values
string

overrideBinaryPath()

Override binary path for `7z` or `rar` command.

public overrideBinaryPath(string $path) : static
Parameters
$path : string
Return values
static

pathToOsPath()

public static pathToOsPath(string $path) : string
Parameters
$path : string
Return values
string

read()

Create a new instance of Archive with path.

public static read(string $path[, string|null $password = null ]) : BaseArchive
Parameters
$path : string
$password : string|null = null
Return values
BaseArchive

recurseRmdir()

public static recurseRmdir(string $dir) : mixed
Parameters
$dir : string

timestampToDateTime()

public static timestampToDateTime(int $timestamp) : DateTime
Parameters
$timestamp : int
Return values
DateTime

convertStream()

protected convertStream(mixed $stream) : string
Parameters
$stream : mixed
Return values
string

createItemFromSplFileInfo()

protected createItemFromSplFileInfo(SplFileInfo $file, string $output) : ArchiveItem
Parameters
$file : SplFileInfo
$output : string
Return values
ArchiveItem

extensionImagickTest()

protected static extensionImagickTest([bool $exception = true ]) : bool
Parameters
$exception : bool = true
Return values
bool

extensionRarTest()

protected static extensionRarTest([bool $exception = true ]) : bool
Parameters
$exception : bool = true
Return values
bool

findFiles()

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
static

parse()

private parse() : static
Return values
static

parser()

private parser(callable(ArchiveItem $file, resource $stream): mixed $closure) : mixed
Parameters
$closure : callable(ArchiveItem $file, resource $stream): mixed

        
On this page

Search results