yii\composer\Installer - Yii2 类参考手册

Class yii\composer\Installer

Inheritanceyii\composer\Installer » Composer\Installer\LibraryInstaller
Available since version2.0

Public Methods

隐藏继承的方法 Hide inherited methods

方法 Method简介 Description定义在 Defined By
copyFiles() Copy files to specified locations. yii\composer\Installer
generateCookieValidationKey() Generates a cookie validation key for every app config listed in "config" in extra section. yii\composer\Installer
install() yii\composer\Installer
postCreateProject() Special method to run tasks defined in [extra][yii\composer\Installer::postCreateProject] key in composer.json yii\composer\Installer
postInstall() Special method to run tasks defined in [extra][yii\composer\Installer::postInstall] key in composer.json yii\composer\Installer
setPermission() Sets the correct permission for the files and directories listed in the extra section. yii\composer\Installer
supports() yii\composer\Installer
uninstall() yii\composer\Installer
update() yii\composer\Installer

常量 Constants

隐藏继承的常量 Hide inherited constants

常量 Constant值 Value简介 Description定义在 Defined By
EXTENSION_FILE 'yiisoft/extensions.php' yii\composer\Installer
EXTRA_BOOTSTRAP 'bootstrap' yii\composer\Installer

方法详情 Method Details

addPackage() protected method

protected void addPackage ( \Composer\Package\PackageInterface $package )
$package
copyFiles() public static method (available since version 2.0.5)

Copy files to specified locations.

public static void copyFiles ( array $paths )
$paths array

The source files paths (keys) and the corresponding target locations for copied files (values). Location can be specified as an array - first element is target location, second defines whether file can be overwritten (by default method don't overwrite existing files).

generateCookieValidationKey() public static method

Generates a cookie validation key for every app config listed in "config" in extra section.

You can provide one or multiple parameters as the configuration files which need to have validation key inserted.

public static void generateCookieValidationKey ( )
generateDefaultAlias() protected method

protected void generateDefaultAlias ( \Composer\Package\PackageInterface $package )
$package
generateRandomString() protected static method

protected static void generateRandomString ( )
install() public method

public void install ( \Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $package )
$repo
$package
linkBaseYiiFiles() protected method

protected void linkBaseYiiFiles ( )
loadExtensions() protected method

protected void loadExtensions ( )
postCreateProject() public static method

Special method to run tasks defined in [extra][yii\composer\Installer::postCreateProject] key in composer.json

public static void postCreateProject ( $event )
$event \Composer\Script\Event
postInstall() public static method (available since version 2.0.5)

Special method to run tasks defined in [extra][yii\composer\Installer::postInstall] key in composer.json

public static void postInstall ( $event )
$event \Composer\Script\Event
removeBaseYiiFiles() protected method

protected void removeBaseYiiFiles ( )
removePackage() protected method

protected void removePackage ( \Composer\Package\PackageInterface $package )
$package
runCommands() protected static method (available since version 2.0.5)

Special method to run tasks defined in [extra][$extraKey] key in composer.json

protected static void runCommands ( $event, $extraKey )
$event \Composer\Script\Event
$extraKey string
saveExtensions() protected method

protected void saveExtensions ( array $extensions )
$extensions
setPermission() public static method

Sets the correct permission for the files and directories listed in the extra section.

public static void setPermission ( array $paths )
$paths array

The paths (keys) and the corresponding permission octal strings (values)

supports() public method

public void supports ( $packageType )
$packageType
uninstall() public method

public void uninstall ( \Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $package )
$repo
$package
update() public method

public void update ( \Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $initial, \Composer\Package\PackageInterface $target )
$repo
$initial
$target