baserCMS クラスリファレンス

BcZip
in package

Class BcZip

Table of Contents

Properties

$error  : null
error
$topArchiveName  : null
Top Archive Name
$Zip  : bool|ZipArchive
ZipArchive

Methods

__construct()  : mixed
BcZip constructor.
create()  : void
zip生成
extract()  : bool
ZIP を展開する
_escapePath()  : string
CUI 向けにパスをエスケープする
_extractByCommand()  : bool
コマンドによる展開
_extractByPhpLib()  : bool
ZipArchive クラスによる展開
_isZipEntrySafe()  : bool
ZIPエントリがターゲット配下か確認する
_normalizeAbsolutePath()  : string|null
絶対パスを正規化する
_normalizeRelativePath()  : string|null
相対パスを正規化する
_normalizeTargetPath()  : string|false
展開先ディレクトリの正規化
_validateZipEntries()  : bool
ZIPエントリ一覧を検証する
zipSub()  : void
再帰的にzip生成対象ファイルを追加する

Properties

$error

error

public null $error = null

$topArchiveName

Top Archive Name

public null $topArchiveName = null

$Zip

ZipArchive

public bool|ZipArchive $Zip = false

Methods

__construct()

BcZip constructor.

public __construct() : mixed
Tags
checked
noTodo
unitTest

create()

zip生成

public create(string $sorce, string $dist) : void
Parameters
$sorce : string

元データ

$dist : string

出力先

Tags
checked
noTodo
unitTest

extract()

ZIP を展開する

public extract(mixed $source, mixed $target) : bool
Parameters
$source : mixed
$target : mixed
Tags
checked
noTodo
unitTest
Return values
bool

_escapePath()

CUI 向けにパスをエスケープする

protected _escapePath(mixed $path) : string
Parameters
$path : mixed
Tags
checked
noTodo
unitTest
Return values
string

_extractByCommand()

コマンドによる展開

protected _extractByCommand(mixed $source, mixed $target) : bool
Parameters
$source : mixed
$target : mixed
Tags
checked
noTodo
unitTest
Return values
bool

_extractByPhpLib()

ZipArchive クラスによる展開

protected _extractByPhpLib(mixed $source, mixed $target) : bool
Parameters
$source : mixed
$target : mixed
Tags
checked
noTodo
unitTest
Return values
bool

_isZipEntrySafe()

ZIPエントリがターゲット配下か確認する

protected _isZipEntrySafe(string $entry, string $targetPath) : bool
Parameters
$entry : string
$targetPath : string
Tags
checked
noTodo
unitTest
Return values
bool

_normalizeAbsolutePath()

絶対パスを正規化する

protected _normalizeAbsolutePath(string $path) : string|null
Parameters
$path : string
Tags
checked
noTodo
unitTest
Return values
string|null

_normalizeRelativePath()

相対パスを正規化する

protected _normalizeRelativePath(string $path) : string|null
Parameters
$path : string
Tags
checked
noTodo
unitTest
Return values
string|null

_normalizeTargetPath()

展開先ディレクトリの正規化

protected _normalizeTargetPath(string $target) : string|false

展開前検証用に、存在しない場合は親ディレクトリで解決して基準パスを作る。

Parameters
$target : string
Tags
checked
noTodo
unitTest
Return values
string|false

_validateZipEntries()

ZIPエントリ一覧を検証する

protected _validateZipEntries(string $targetPath) : bool
Parameters
$targetPath : string
Tags
checked
noTodo
unitTest
Return values
bool

zipSub()

再帰的にzip生成対象ファイルを追加する

private zipSub(ZipArchive $za, string $path[, string $parentPath = '' ]) : void
Parameters
$za : ZipArchive
$path : string
$parentPath : string = ''
Tags
checked
noTodo
unitTest
On this page

Search results