PHP Класс Symfony\Installer\DownloadCommand

Автор: Christophe Coevoet ([email protected])
Автор: Javier Eguiluz ([email protected])
Наследование: extends Symfony\Component\Console\Command\Command
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$composerManager Symfony\Installer\Manager\ComposerManager
$downloadedFilePath The path to the downloaded file
$fs To dump content to a file
$latestInstallerVersion The latest installer version
$localInstallerVersion The version of the local installer being executed
$output To output content
$projectDir The project dir
$projectName The project name
$requirementsErrors The requirement errors
$version The version to install

Защищенные методы

Метод Описание
checkInstallerVersion ( ) Checks if the installed version is the latest one and displays some warning messages if not.
checkPermissions ( ) Checks if the installer has enough permissions to create the project.
checkProjectName ( ) Checks the project name.
checkSymfonyRequirements ( ) Checks if environment meets symfony requirements.
createGitIgnore ( ) Creates the appropriate .gitignore file for a Symfony project if it doesn't exist.
download ( ) Chooses the best compressed file format to download (ZIP or TGZ) depending upon the available operating system uncompressing commands and the enabled PHP extensions and it downloads the file.
extract ( ) Extracts the compressed Symfony file (ZIP or TGZ) using the native operating system commands if available or PHP code otherwise.
generateRandomSecret ( ) : string Generates a good random value for Symfony's 'secret' option.
getDownloadedApplicationType ( ) : string Returns the type of the downloaded application in a human readable format.
getErrorMessage ( Requirement $requirement, integer $lineSize = 70 ) : string Formats the error message contained in the given Requirement item using the optional line length provided.
getExecutedCommand ( ) : string Returns the executed command with all its arguments (e.g. "symfony new blog 2.8.1").
getGuzzleClient ( ) : Client Returns the Guzzle client configured according to the system environment (e.g. it takes into account whether it should use a proxy server or not).
getInstalledSymfonyVersion ( ) : string Returns the full Symfony version number of the project by getting it from the composer.lock file.
getRemoteFileUrl ( ) : string Returns the absolute URL of the remote file downloaded by the command.
getUrlContents ( string $url ) : string Returns the contents obtained by making a GET request to the given URL.
initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
isEmptyDirectory ( string $dir ) : boolean Checks whether the given directory is empty or not.
isInstallerUpdated ( ) : boolean
isSymfony3 ( ) : boolean Checks that the asked version is in the 3.x branch.
updateComposerConfig ( ) Updates the composer.json file to provide better values for some of the default configuration values.

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

Метод Описание
enableSignalHandler ( ) Enables the signal handler.
getSymfonyRequirementsFilePath ( )

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

checkInstallerVersion() защищенный метод

Checks if the installed version is the latest one and displays some warning messages if not.
protected checkInstallerVersion ( )

checkPermissions() защищенный метод

Checks if the installer has enough permissions to create the project.
protected checkPermissions ( )

checkProjectName() защищенный метод

Checks the project name.
protected checkProjectName ( )

checkSymfonyRequirements() защищенный метод

Checks if environment meets symfony requirements.
protected checkSymfonyRequirements ( )

createGitIgnore() защищенный метод

Creates the appropriate .gitignore file for a Symfony project if it doesn't exist.
protected createGitIgnore ( )

download() защищенный метод

Chooses the best compressed file format to download (ZIP or TGZ) depending upon the available operating system uncompressing commands and the enabled PHP extensions and it downloads the file.
protected download ( )

extract() защищенный метод

Extracts the compressed Symfony file (ZIP or TGZ) using the native operating system commands if available or PHP code otherwise.
protected extract ( )

generateRandomSecret() защищенный метод

Generates a good random value for Symfony's 'secret' option.
protected generateRandomSecret ( ) : string
Результат string The randomly generated secret

getDownloadedApplicationType() абстрактный защищенный метод

It's mainly used to display readable error messages.
abstract protected getDownloadedApplicationType ( ) : string
Результат string The type of the downloaded application in a human readable format

getErrorMessage() защищенный метод

Formats the error message contained in the given Requirement item using the optional line length provided.
protected getErrorMessage ( Requirement $requirement, integer $lineSize = 70 ) : string
$requirement Requirement The Symfony requirements
$lineSize integer The maximum line length
Результат string The formatted error message

getExecutedCommand() защищенный метод

Returns the executed command with all its arguments (e.g. "symfony new blog 2.8.1").
protected getExecutedCommand ( ) : string
Результат string The executed command with all its arguments

getGuzzleClient() защищенный метод

Returns the Guzzle client configured according to the system environment (e.g. it takes into account whether it should use a proxy server or not).
protected getGuzzleClient ( ) : Client
Результат GuzzleHttp\Client The configured Guzzle client

getInstalledSymfonyVersion() защищенный метод

Returns the full Symfony version number of the project by getting it from the composer.lock file.
protected getInstalledSymfonyVersion ( ) : string
Результат string The installed Symfony version

getRemoteFileUrl() абстрактный защищенный метод

Returns the absolute URL of the remote file downloaded by the command.
abstract protected getRemoteFileUrl ( ) : string
Результат string The absolute URL of the remote file downloaded by the command

getUrlContents() защищенный метод

Returns the contents obtained by making a GET request to the given URL.
protected getUrlContents ( string $url ) : string
$url string The URL to get the contents from
Результат string The obtained contents of $url

initialize() защищенный метод

protected initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface

isEmptyDirectory() защищенный метод

Checks whether the given directory is empty or not.
protected isEmptyDirectory ( string $dir ) : boolean
$dir string the path of the directory to check
Результат boolean Whether the given directory is empty

isInstallerUpdated() защищенный метод

protected isInstallerUpdated ( ) : boolean
Результат boolean Whether the installed version is the latest one

isSymfony3() защищенный метод

Checks that the asked version is in the 3.x branch.
protected isSymfony3 ( ) : boolean
Результат boolean Whether is Symfony3

updateComposerConfig() защищенный метод

Updates the composer.json file to provide better values for some of the default configuration values.
protected updateComposerConfig ( )

Описание свойств

$composerManager защищенное свойство

protected ComposerManager,Symfony\Installer\Manager $composerManager
Результат Symfony\Installer\Manager\ComposerManager

$downloadedFilePath защищенное свойство

The path to the downloaded file
protected $downloadedFilePath

$fs защищенное свойство

To dump content to a file
protected $fs

$latestInstallerVersion защищенное свойство

The latest installer version
protected $latestInstallerVersion

$localInstallerVersion защищенное свойство

The version of the local installer being executed
protected $localInstallerVersion

$output защищенное свойство

To output content
protected $output

$projectDir защищенное свойство

The project dir
protected $projectDir

$projectName защищенное свойство

The project name
protected $projectName

$requirementsErrors защищенное свойство

The requirement errors
protected $requirementsErrors

$version защищенное свойство

The version to install
protected $version