PHP Class N98\Magento\Command\AbstractMagentoCommand

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

Protected Properties

Property Type Description
$_deprecatedAlias array
$_magentoEnterprise boolean
$_magentoMajorVersion integer
$_magentoRootFolder string
$_websiteCodeMap array

Public Methods

Method Description
detectMagento ( Symfony\Component\Console\Output\OutputInterface $output, boolean $silent = true ) Search for magento root folder
run ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer

Protected Methods

Method Description
_getModel ( string $mage1code, string $mage2class ) : Mage_Core_Model_Abstract Magento 1 / 2 switches
_getResourceModel ( string $mage1code, string $mage2class ) : Mage_Core_Model_Abstract Magento 1 / 2 switches
_getResourceSingleton ( string $mage1code, string $mage2class ) : Mage_Core_Model_Abstract Magento 1 / 2 switches
_getWebsiteCodeById ( integer $websiteId ) : string
_getWebsiteIdByCode ( string $websiteCode ) : integer
_parseBoolOption ( string $value ) : boolean
addDeprecatedAlias ( string $alias, string $message ) : AbstractMagentoCommand
askForArrayEntry ( array $entries, Symfony\Component\Console\Output\OutputInterface $output, string $question ) : mixed
checkDeprecatedAliases ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
checkRepository ( Composer\Package\PackageInterface $package, string $targetFolder ) brings locally cached repository up to date if it is missing the requested tag
chooseInstallationFolder ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
createComposerPackageByConfig ( array | Composer\Package\PackageInterface $config ) : Composer\Package\CompletePackage
downloadByComposerConfig ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, array | Composer\Package\PackageInterface $config, string $targetFolder, boolean $preferSource = true ) : Composer\Package\CompletePackage
formatActive ( string $value ) : string
getArgumentMessage ( string $argument, string $message = null ) : string
getCommandConfig ( string | null $commandClass = null ) : array
getComposer ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : Composer\Composer obtain composer
getComposerDownloadManager ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : Composer\Downloader\DownloadManager
getCoreHelper ( ) : Mage_Core_Helper_Data
getOrAskForArgument ( string $argument, Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, string $message = null ) : string
initMagento ( boolean $soft = false ) : boolean Bootstrap magento shop
initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) Initializes the command just after the input has been validated.
isSourceTypeRepository ( string $type ) : boolean
normalizePath ( string $path ) : string normalize paths on windows / cygwin / msysgit
requireEnterprise ( Symfony\Component\Console\Output\OutputInterface $output ) Die if not Enterprise
writeSection ( Symfony\Component\Console\Output\OutputInterface $output, string $text, string $style = 'bg=blue;fg=white' )

Private Methods

Method Description
_initWebsites ( )

Method Details

_getModel() protected method

Magento 1 / 2 switches
protected _getModel ( string $mage1code, string $mage2class ) : Mage_Core_Model_Abstract
$mage1code string Magento 1 class code
$mage2class string Magento 2 class name
return Mage_Core_Model_Abstract

_getResourceModel() protected method

Magento 1 / 2 switches
protected _getResourceModel ( string $mage1code, string $mage2class ) : Mage_Core_Model_Abstract
$mage1code string Magento 1 class code
$mage2class string Magento 2 class name
return Mage_Core_Model_Abstract

_getResourceSingleton() protected method

Magento 1 / 2 switches
protected _getResourceSingleton ( string $mage1code, string $mage2class ) : Mage_Core_Model_Abstract
$mage1code string Magento 1 class code
$mage2class string Magento 2 class name
return Mage_Core_Model_Abstract

_getWebsiteCodeById() protected method

protected _getWebsiteCodeById ( integer $websiteId ) : string
$websiteId integer
return string

_getWebsiteIdByCode() protected method

protected _getWebsiteIdByCode ( string $websiteCode ) : integer
$websiteCode string
return integer

_parseBoolOption() protected method

protected _parseBoolOption ( string $value ) : boolean
$value string
return boolean

addDeprecatedAlias() protected method

protected addDeprecatedAlias ( string $alias, string $message ) : AbstractMagentoCommand
$alias string
$message string
return AbstractMagentoCommand

askForArrayEntry() protected method

protected askForArrayEntry ( array $entries, Symfony\Component\Console\Output\OutputInterface $output, string $question ) : mixed
$entries array zero-indexed array of entries (represented by strings) to select from
$output Symfony\Component\Console\Output\OutputInterface
$question string
return mixed

checkDeprecatedAliases() protected method

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

checkRepository() protected method

brings locally cached repository up to date if it is missing the requested tag
protected checkRepository ( Composer\Package\PackageInterface $package, string $targetFolder )
$package Composer\Package\PackageInterface
$targetFolder string

chooseInstallationFolder() protected method

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

createComposerPackageByConfig() protected method

protected createComposerPackageByConfig ( array | Composer\Package\PackageInterface $config ) : Composer\Package\CompletePackage
$config array | Composer\Package\PackageInterface
return Composer\Package\CompletePackage

detectMagento() public method

Search for magento root folder
public detectMagento ( Symfony\Component\Console\Output\OutputInterface $output, boolean $silent = true )
$output Symfony\Component\Console\Output\OutputInterface
$silent boolean print debug messages

downloadByComposerConfig() protected method

protected downloadByComposerConfig ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, array | Composer\Package\PackageInterface $config, string $targetFolder, boolean $preferSource = true ) : Composer\Package\CompletePackage
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
$config array | Composer\Package\PackageInterface
$targetFolder string
$preferSource boolean
return Composer\Package\CompletePackage

formatActive() protected method

protected formatActive ( string $value ) : string
$value string
return string

getArgumentMessage() protected method

protected getArgumentMessage ( string $argument, string $message = null ) : string
$argument string
$message string [optional]
return string

getCommandConfig() protected method

protected getCommandConfig ( string | null $commandClass = null ) : array
$commandClass string | null
return array

getComposer() protected method

obtain composer
protected getComposer ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : Composer\Composer
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return Composer\Composer

getComposerDownloadManager() protected method

protected getComposerDownloadManager ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : Composer\Downloader\DownloadManager
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return Composer\Downloader\DownloadManager

getCoreHelper() protected method

protected getCoreHelper ( ) : Mage_Core_Helper_Data
return Mage_Core_Helper_Data

getOrAskForArgument() protected method

protected getOrAskForArgument ( string $argument, Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, string $message = null ) : string
$argument string
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
$message string
return string

initMagento() protected method

Bootstrap magento shop
protected initMagento ( boolean $soft = false ) : boolean
$soft boolean
return boolean

initialize() protected method

This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options.
protected initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface An InputInterface instance
$output Symfony\Component\Console\Output\OutputInterface An OutputInterface instance

isSourceTypeRepository() protected method

protected isSourceTypeRepository ( string $type ) : boolean
$type string
return boolean

normalizePath() protected method

when using a path value that has been created in a cygwin shell but then PHP uses it inside a cmd shell it needs to be filtered.
protected normalizePath ( string $path ) : string
$path string
return string

requireEnterprise() protected method

Die if not Enterprise
protected requireEnterprise ( Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface

run() public method

public run ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return integer

writeSection() protected method

protected writeSection ( Symfony\Component\Console\Output\OutputInterface $output, string $text, string $style = 'bg=blue;fg=white' )
$output Symfony\Component\Console\Output\OutputInterface
$text string
$style string

Property Details

$_deprecatedAlias protected_oe property

protected array $_deprecatedAlias
return array

$_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

$_websiteCodeMap protected_oe property

protected array $_websiteCodeMap
return array