PHP 클래스 CraftCli\Application

상속: extends Symfony\Component\Console\Application
파일 보기 프로젝트 열기: rsanchez/craft-cli

보호된 프로퍼티들

프로퍼티 타입 설명
$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