PHP Класс CraftCli\Application

Наследование: extends Symfony\Component\Console\Application
Показать файл Открыть проект

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

Свойство Тип Описание
$addonAuthorName string Author name for generated addons
$addonAuthorUrl string Author url for generated addons
$config array Configuration items
$craftPath string Path to the craft folder
$hasValidCraftPath boolean Whether the craft folder has been set/guessed correctly
$userDefinedCommandDirs array A list of Command dirs
$userDefinedCommands array A list of Command objects
$vendorPath string Path to the Composer vendor folder

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

Метод Описание
__construct ( $vendorPath = null )
addComposerCommands ( ) : void Find any Command plugins installed via composer or supplied by the main composer.json and add them to the Application
addComposerPlugins ( ) : void Find any Command plugins installed via composer and add them to the Application
addCustomComposerCommands ( ) : void Find any Command plugins upplied by the main composer.json and add them to the Application
addUserDefinedCommands ( ) : void Find any user-defined Commands in the config and add them to the Application
bootstrap ( ) : Craft\ConsoleApp Boot up craft
canBeBootstrapped ( ) : boolean Whether or not a valid system folder was found
findClassInDir ( string $subclassOf, string $dir, string $namespace = null ) : array Get a list of classes in the specified directory
findCommandsInDir ( string $dir, string $namespace = null ) : array Get a list of Symfony Console Commands classes in the specified directory
getAddonAuthorName ( ) : string Get the default addon author name
getAddonAuthorUrl ( ) : string Get the default addon author URL
getComposerConfig ( ) : array Get craft-cli configuration stored in the root composer.json
getConfig ( ) : array Get all configuration items
getConfigItem ( string $key ) : mixed Get the specified config item
getCraftFolder ( ) : string Get the name of the craft folder
getCraftPath ( ) : string Get the path to the craft folder
onCommand ( Symfony\Component\Console\Event\ConsoleCommandEvent $event ) : void On Command Event Handler
registerCommand ( string | callable $class ) : void Add a command to the Application by class name or callback that return a Command class
setVendorPath ( string $vendorPath ) Set the path to the Composer vendor folder

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

Метод Описание
findConfigFile ( string | null $dir = null ) : string | null Traverse up a directory to find a config file
getEnvironmentOption ( ) : string | null Get the environment from the --environment option or from the CRAFT_ENVIRONMENT env variable
isCommandExemptFromBootstrap ( Command $command ) : boolean Check whether a command should be exempt from bootstrapping
loadConfig ( ) : void Looks for ~/.craft-cli.php and ./.craft-cli.php and combines them into an array

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

__construct() публичный Метод

public __construct ( $vendorPath = null )

addComposerCommands() публичный Метод

Find any Command plugins installed via composer or supplied by the main composer.json and add them to the Application
public addComposerCommands ( ) : void
Результат void

addComposerPlugins() публичный Метод

Find any Command plugins installed via composer and add them to the Application
public addComposerPlugins ( ) : void
Результат void

addCustomComposerCommands() публичный Метод

Find any Command plugins upplied by the main composer.json and add them to the Application
public addCustomComposerCommands ( ) : void
Результат void

addUserDefinedCommands() публичный Метод

Find any user-defined Commands in the config and add them to the Application
public addUserDefinedCommands ( ) : void
Результат void

bootstrap() публичный Метод

Boot up craft
public bootstrap ( ) : Craft\ConsoleApp
Результат Craft\ConsoleApp

canBeBootstrapped() публичный Метод

Whether or not a valid system folder was found
public canBeBootstrapped ( ) : boolean
Результат boolean

findClassInDir() публичный Метод

Get a list of classes in the specified directory
public findClassInDir ( string $subclassOf, string $dir, string $namespace = null ) : array
$subclassOf string
$dir string
$namespace string
Результат array

findCommandsInDir() публичный Метод

Get a list of Symfony Console Commands classes in the specified directory
public findCommandsInDir ( string $dir, string $namespace = null ) : array
$dir string
$namespace string
Результат array

findConfigFile() защищенный Метод

Traverse up a directory to find a config file
protected findConfigFile ( string | null $dir = null ) : string | null
$dir string | null defaults to getcwd if null
Результат string | null

getAddonAuthorName() публичный Метод

Get the default addon author name
public getAddonAuthorName ( ) : string
Результат string

getAddonAuthorUrl() публичный Метод

Get the default addon author URL
public getAddonAuthorUrl ( ) : string
Результат string

getComposerConfig() публичный Метод

Get craft-cli configuration stored in the root composer.json
public getComposerConfig ( ) : array
Результат array

getConfig() публичный Метод

Get all configuration items
public getConfig ( ) : array
Результат array

getConfigItem() публичный Метод

Get the specified config item
public getConfigItem ( string $key ) : mixed
$key string
Результат mixed

getCraftFolder() публичный Метод

Get the name of the craft folder
public getCraftFolder ( ) : string
Результат string

getCraftPath() публичный Метод

Get the path to the craft folder
public getCraftPath ( ) : string
Результат string

getEnvironmentOption() защищенный Метод

Get the environment from the --environment option or from the CRAFT_ENVIRONMENT env variable
protected getEnvironmentOption ( ) : string | null
Результат string | null

isCommandExemptFromBootstrap() защищенный Метод

Check whether a command should be exempt from bootstrapping
protected isCommandExemptFromBootstrap ( Command $command ) : boolean
$command Symfony\Component\Console\Command\Command
Результат boolean

loadConfig() защищенный Метод

Looks for ~/.craft-cli.php and ./.craft-cli.php and combines them into an array
protected loadConfig ( ) : void
Результат void

onCommand() публичный Метод

Check if the current command requires EE bootstrapping and throw an exception if EE is not bootstrapped
public onCommand ( Symfony\Component\Console\Event\ConsoleCommandEvent $event ) : void
$event Symfony\Component\Console\Event\ConsoleCommandEvent
Результат void

registerCommand() публичный Метод

Add a command to the Application by class name or callback that return a Command class
public registerCommand ( string | callable $class ) : void
$class string | callable class name or callback that returns a command
Результат void

setVendorPath() публичный Метод

Set the path to the Composer vendor folder
public setVendorPath ( string $vendorPath )
$vendorPath string

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

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

Author name for generated addons
protected string $addonAuthorName
Результат string

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

Author url for generated addons
protected string $addonAuthorUrl
Результат string

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

Configuration items
protected array $config
Результат array

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

Path to the craft folder
protected string $craftPath
Результат string

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

Whether the craft folder has been set/guessed correctly
protected bool $hasValidCraftPath
Результат boolean

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

A list of Command dirs
protected array $userDefinedCommandDirs
Результат array

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

A list of Command objects
protected array $userDefinedCommands
Результат array

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

Path to the Composer vendor folder
protected string $vendorPath
Результат string