\Composer\DownloaderPearPackageExtractor

Extractor for pear packages.

Composer cannot rely on tar files structure when place it inside package target dir. Correct source files disposition must be read from package.xml This extract pear package source files to target dir.

Summary

Methods
Properties
Constants
__construct()
extractTo()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
copyFiles()
copyFile()
buildCopyActions()
applyRelease()
buildSourceList10()
buildSourceList20()
combine()
$rolesWithoutPackageNamePrefix
$filesystem
$file
N/A

Properties

$rolesWithoutPackageNamePrefix

$rolesWithoutPackageNamePrefix : 

Type

$file

$file : 

Type

Methods

__construct()

__construct(  $file) 

Parameters

$file

extractTo()

extractTo(string  $target, array  $roles = array('php' => '/', 'script' => '/bin'), array  $vars = array()) 

Installs PEAR source files according to package.xml definitions and removes extracted files

Parameters

string $target

target install location. all source installation would be performed relative to target path.

array $roles

types of files to install. default role for PEAR source files are 'php'.

array $vars

used for replacement tasks

Throws

\RuntimeException
\UnexpectedValueException

copyFiles()

copyFiles(array  $files,   $source,   $target, array  $roles, array  $vars) 

Perform copy actions on files

Parameters

array $files

array of copy actions ('from', 'to') with relative paths

$source

string path to source dir.

$target

string path to destination dir

array $roles

array [role => roleRoot] relative root for files having that role

array $vars

list of values can be used for replacement tasks

copyFile()

copyFile(  $from,   $to,   $tasks,   $vars) 

Parameters

$from
$to
$tasks
$vars

buildCopyActions()

buildCopyActions(string  $source, array  $roles, array  $vars) : array

Builds list of copy and list of remove actions that would transform extracted PEAR tarball into installed package.

Parameters

string $source

string path to extracted files

array $roles

array [role => roleRoot] relative root for files having that role

array $vars

list of values can be used for replacement tasks

Throws

\RuntimeException

Returns

array —

array of 'source' => 'target', where source is location of file in the tarball (relative to source path, and target is destination of file (also relative to $source path)

applyRelease()

applyRelease(  $actions,   $releaseNodes,   $vars) 

Parameters

$actions
$releaseNodes
$vars

buildSourceList10()

buildSourceList10(  $children,   $targetRoles,   $source,   $target,   $role,   $packageName) 

Parameters

$children
$targetRoles
$source
$target
$role
$packageName

buildSourceList20()

buildSourceList20(  $children,   $targetRoles,   $source,   $target,   $role,   $packageName) 

Parameters

$children
$targetRoles
$source
$target
$role
$packageName

combine()

combine(  $left,   $right) 

Parameters

$left
$right