PHP Class N98\Magento\Application

Inheritance: extends Symfony\Component\Console\Application
Exibir arquivo Open project: netz98/n98-magerun Class Usage Examples

Protected Properties

Property Type Description
$_directRootDir boolean If root dir is set by root-dir option this flag is true
$_isInitialized boolean
$_isPharMode boolean
$_magento2EntryPoint Magento\Mtf\EntryPoint\EntryPoint
$_magentoDetected boolean
$_magentoEnterprise boolean
$_magentoMajorVersion integer
$_magentoRootFolder string
$_magerunStopFileFolder string
$_magerunStopFileFound boolean
$autoloader Composer\Autoload\ClassLoader
$config N98\Magento\Application\Config
$dispatcher Symfony\Component\EventDispatcher\EventDispatcher

Public Methods

Method Description
__construct ( Composer\Autoload\ClassLoader $autoloader = null )
add ( Command $command ) : Command Override standard command registration. We want alias support.
checkVarDir ( Symfony\Component\Console\Output\OutputInterface $output ) : null | false
detectMagento ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : void Search for magento root folder
doRun ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer Runs the current application with possible command aliases
getAutoloader ( ) : Composer\Autoload\ClassLoader
getConfig ( string | integer $key = null ) : array | null Get config array
getConfigurationLoader ( array $initConfig, Symfony\Component\Console\Output\OutputInterface $output ) : ConfigurationLoader
getDispatcher ( ) : EventDispatcher
getHelp ( ) : string
getLongVersion ( )
getMagentoMajorVersion ( ) : integer
getMagentoRootFolder ( ) : string
init ( array $initConfig = [], Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : void
initMagento ( boolean $soft = false ) : boolean Loads and initializes the Magento application
isMagentoEnterprise ( ) : boolean
isMagerunStopFileFound ( ) : boolean
isPharMode ( ) : boolean
reinit ( array $initConfig = [], Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null )
run ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : integer
setAutoloader ( Composer\Autoload\ClassLoader $autoloader )
setConfig ( array $config )
setConfigurationLoader ( ConfigurationLoader $configurationLoader )
setMagentoRootFolder ( string $magentoRootFolder )
setPharMode ( boolean $mode )

Protected Methods

Method Description
_addOutputStyles ( Symfony\Component\Console\Output\OutputInterface $output )
_checkRootDirOption ( Symfony\Component\Console\Input\InputInterface $input ) : string
_checkSkipConfigOption ( Symfony\Component\Console\Input\InputInterface $input ) : boolean
_initMagento1 ( boolean $soft = false ) : void
_initMagento2 ( ) : void
checkConfigCommandAlias ( Symfony\Component\Console\Input\InputInterface $input ) : Symfony\Component\Console\Input\ArgvInput | Symfony\Component\Console\Input\InputInterface
getDefaultInputDefinition ( ) : Symfony\Component\Console\Input\InputDefinition
hasCustomCommands ( ) : boolean
isCommandDisabled ( string $class ) : boolean
registerConfigCommandAlias ( Command $command )
registerCustomAutoloaders ( ) Adds autoloader prefixes from user's config
registerCustomCommands ( ) : void
registerEventSubscribers ( ) : void
registerHelpers ( ) : void Add own helpers to helperset.

Private Methods

Method Description
outputMagerunCompatibilityNotice ( string $version ) Show a hint that this is Magento incompatible with Magerun and how to obtain the correct Magerun for it
requireOnce ( string $path ) use require-once inside a function with it's own variable scope w/o any other variables and $this unbound.
setRootDir ( string $path ) Set root dir (chdir()) of magento directory

Method Details

__construct() public method

public __construct ( Composer\Autoload\ClassLoader $autoloader = null )
$autoloader Composer\Autoload\ClassLoader

_addOutputStyles() protected method

protected _addOutputStyles ( Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface

_checkRootDirOption() protected method

protected _checkRootDirOption ( Symfony\Component\Console\Input\InputInterface $input ) : string
$input Symfony\Component\Console\Input\InputInterface
return string

_checkSkipConfigOption() protected method

Deprecation: 1.97.27
protected _checkSkipConfigOption ( Symfony\Component\Console\Input\InputInterface $input ) : boolean
$input Symfony\Component\Console\Input\InputInterface
return boolean

_initMagento1() protected method

protected _initMagento1 ( boolean $soft = false ) : void
$soft boolean
return void

_initMagento2() protected method

protected _initMagento2 ( ) : void
return void

add() public method

Override standard command registration. We want alias support.
public add ( Command $command ) : Command
$command Symfony\Component\Console\Command\Command
return Symfony\Component\Console\Command\Command

checkConfigCommandAlias() protected method

protected checkConfigCommandAlias ( Symfony\Component\Console\Input\InputInterface $input ) : Symfony\Component\Console\Input\ArgvInput | Symfony\Component\Console\Input\InputInterface
$input Symfony\Component\Console\Input\InputInterface
return Symfony\Component\Console\Input\ArgvInput | Symfony\Component\Console\Input\InputInterface

checkVarDir() public method

public checkVarDir ( Symfony\Component\Console\Output\OutputInterface $output ) : null | false
$output Symfony\Component\Console\Output\OutputInterface
return null | false

detectMagento() public method

Search for magento root folder
public detectMagento ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : void
$input Symfony\Component\Console\Input\InputInterface [optional]
$output Symfony\Component\Console\Output\OutputInterface [optional]
return void

doRun() public method

Runs the current application with possible command aliases
public doRun ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer
$input Symfony\Component\Console\Input\InputInterface An Input instance
$output Symfony\Component\Console\Output\OutputInterface An Output instance
return integer 0 if everything went fine, or an error code

getAutoloader() public method

public getAutoloader ( ) : Composer\Autoload\ClassLoader
return Composer\Autoload\ClassLoader

getConfig() public method

Specify one key per parameter to traverse the config. Then returns null if the path of the key(s) can not be obtained.
public getConfig ( string | integer $key = null ) : array | null
$key string | integer ... (optional)
return array | null

getConfigurationLoader() public method

public getConfigurationLoader ( array $initConfig, Symfony\Component\Console\Output\OutputInterface $output ) : ConfigurationLoader
$initConfig array
$output Symfony\Component\Console\Output\OutputInterface
return N98\Magento\Application\ConfigurationLoader

getDefaultInputDefinition() protected method

protected getDefaultInputDefinition ( ) : Symfony\Component\Console\Input\InputDefinition
return Symfony\Component\Console\Input\InputDefinition

getDispatcher() public method

public getDispatcher ( ) : EventDispatcher
return Symfony\Component\EventDispatcher\EventDispatcher

getHelp() public method

public getHelp ( ) : string
return string

getLongVersion() public method

public getLongVersion ( )

getMagentoMajorVersion() public method

public getMagentoMajorVersion ( ) : integer
return integer

getMagentoRootFolder() public method

public getMagentoRootFolder ( ) : string
return string

hasCustomCommands() protected method

protected hasCustomCommands ( ) : boolean
return boolean

init() public method

public init ( array $initConfig = [], Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : void
$initConfig array [optional]
$input Symfony\Component\Console\Input\InputInterface [optional]
$output Symfony\Component\Console\Output\OutputInterface [optional]
return void

initMagento() public method

Loads and initializes the Magento application
public initMagento ( boolean $soft = false ) : boolean
$soft boolean
return boolean false if magento root folder is not set, true otherwise

isCommandDisabled() protected method

protected isCommandDisabled ( string $class ) : boolean
$class string
return boolean

isMagentoEnterprise() public method

public isMagentoEnterprise ( ) : boolean
return boolean

isMagerunStopFileFound() public method

public isMagerunStopFileFound ( ) : boolean
return boolean

isPharMode() public method

public isPharMode ( ) : boolean
return boolean

registerConfigCommandAlias() protected method

protected registerConfigCommandAlias ( Command $command )
$command Symfony\Component\Console\Command\Command

registerCustomAutoloaders() protected method

Adds autoloader prefixes from user's config

registerCustomCommands() protected method

protected registerCustomCommands ( ) : void
return void

registerEventSubscribers() protected method

protected registerEventSubscribers ( ) : void
return void

registerHelpers() protected method

Add own helpers to helperset.
protected registerHelpers ( ) : void
return void

reinit() public method

public reinit ( array $initConfig = [], Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null )
$initConfig array [optional]
$input Symfony\Component\Console\Input\InputInterface [optional]
$output Symfony\Component\Console\Output\OutputInterface [optional]

run() public method

public run ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : integer
$input Symfony\Component\Console\Input\InputInterface [optional]
$output Symfony\Component\Console\Output\OutputInterface [optional]
return integer

setAutoloader() public method

public setAutoloader ( Composer\Autoload\ClassLoader $autoloader )
$autoloader Composer\Autoload\ClassLoader

setConfig() public method

public setConfig ( array $config )
$config array

setConfigurationLoader() public method

public setConfigurationLoader ( ConfigurationLoader $configurationLoader )
$configurationLoader N98\Magento\Application\ConfigurationLoader

setMagentoRootFolder() public method

public setMagentoRootFolder ( string $magentoRootFolder )
$magentoRootFolder string

setPharMode() public method

public setPharMode ( boolean $mode )
$mode boolean

Property Details

$_directRootDir protected_oe property

If root dir is set by root-dir option this flag is true
protected bool $_directRootDir
return boolean

$_isInitialized protected_oe property

protected bool $_isInitialized
return boolean

$_isPharMode protected_oe property

protected bool $_isPharMode
return boolean

$_magento2EntryPoint protected_oe property

protected EntryPoint,Magento\Mtf\EntryPoint $_magento2EntryPoint
return Magento\Mtf\EntryPoint\EntryPoint

$_magentoDetected protected_oe property

protected bool $_magentoDetected
return boolean

$_magentoEnterprise protected_oe property

protected bool $_magentoEnterprise
return boolean

$_magentoMajorVersion protected_oe property

protected int $_magentoMajorVersion
return integer

$_magentoRootFolder protected_oe property

protected string $_magentoRootFolder
return string

$_magerunStopFileFolder protected_oe property

protected string $_magerunStopFileFolder
return string

$_magerunStopFileFound protected_oe property

protected bool $_magerunStopFileFound
return boolean

$autoloader protected_oe property

protected ClassLoader,Composer\Autoload $autoloader
return Composer\Autoload\ClassLoader

$config protected_oe property

protected Config,N98\Magento\Application $config
return N98\Magento\Application\Config

$dispatcher protected_oe property

protected EventDispatcher,Symfony\Component\EventDispatcher $dispatcher
return Symfony\Component\EventDispatcher\EventDispatcher