PHP Класс ExpressiveInstaller\OptionalPackages

Add this script to composer.json: "scripts": { "pre-update-cmd": "ExpressiveInstaller\\OptionalPackages::install", "pre-install-cmd": "ExpressiveInstaller\\OptionalPackages::install" },
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addPackage ( Composer\IO\IOInterface $io, string $packageName, string $packageVersion ) Add a package
copyFile ( Composer\IO\IOInterface $io, string $projectRoot, string $source, string $target, boolean $force = false ) Copy a file to its final destination in the skeleton.
install ( Composer\Script\Event $event ) Install command: choose packages and provide configuration.
processAnswer ( Composer\IO\IOInterface $io, array $question, string | integer $answer, string $copyFilesKey ) : boolean Process the answer of a question
removeDevDependencies ( ) Cleanup development dependencies.
removeInstallerFromDefinition ( ) Remove the installer from the composer definition
removeLinesContainingStrings ( array $entries, string $content ) : string Remove lines from string content containing words in array.
requestMinimal ( Composer\IO\IOInterface $io ) : boolean Ask if the user would like a minimal install.

Приватные методы

Метод Описание
askQuestion ( Composer\Composer $composer, Composer\IO\IOInterface $io, string $question, string $defaultOption ) : boolean | integer | string Prepare and ask questions and return the answer
cleanUp ( Composer\IO\IOInterface $io, string $projectRoot ) Clean up/remove installer classes and assets.
clearComposerLockFile ( Composer\IO\IOInterface $io, string $projectRoot )
recursiveRmdir ( string $directory ) Recursively remove a directory.
removeDefaultMiddleware ( Composer\IO\IOInterface $io, string $projectRoot ) If a minimal install was requested, remove the default middleware and assets.

Описание методов

addPackage() публичный статический метод

Add a package
public static addPackage ( Composer\IO\IOInterface $io, string $packageName, string $packageVersion )
$io Composer\IO\IOInterface
$packageName string
$packageVersion string

copyFile() публичный статический метод

Copy a file to its final destination in the skeleton.
public static copyFile ( Composer\IO\IOInterface $io, string $projectRoot, string $source, string $target, boolean $force = false )
$io Composer\IO\IOInterface
$projectRoot string
$source string Source file.
$target string Destination.
$force boolean whether or not to copy over an existing file.

install() публичный статический метод

Prompts users for package selections, and copies in package-specific configuration when known. Updates the composer.json with the package selections, and removes the install and update commands on completion.
public static install ( Composer\Script\Event $event )
$event Composer\Script\Event

processAnswer() публичный статический метод

This process
public static processAnswer ( Composer\IO\IOInterface $io, array $question, string | integer $answer, string $copyFilesKey ) : boolean
$io Composer\IO\IOInterface
$question array
$answer string | integer
$copyFilesKey string
Результат boolean

removeDevDependencies() публичный статический метод

The dev dependencies should be removed from the stability flags, require-dev and the composer file.
public static removeDevDependencies ( )

removeInstallerFromDefinition() публичный статический метод

Remove the installer from the composer definition
public static removeInstallerFromDefinition ( )

removeLinesContainingStrings() публичный статический метод

Remove lines from string content containing words in array.
public static removeLinesContainingStrings ( array $entries, string $content ) : string
$entries array Entries to remove.
$content string String to remove entry from.
Результат string

requestMinimal() публичный статический метод

Ask if the user would like a minimal install.
public static requestMinimal ( Composer\IO\IOInterface $io ) : boolean
$io Composer\IO\IOInterface
Результат boolean