PHP Class Hypernode\Magento\Command\Hypernode\Performance\PerformanceCommand

Inheritance: extends Hypernode\Magento\Command\AbstractHypernodeCommand
Exibir arquivo Open project: Hypernode/hypernode-magerun

Protected Properties

Property Type Description
$_batches
$_options
$_results
$_sitemaps
$_totalTime

Protected Methods

Method Description
askReplaceOrCompare ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, $definedUrl, $foundUrl ) : boolean | integer Asks the user what to do in case of a mismatched URL
askSitemapsToProcess ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : array | boolean Asks the user which sitemaps from Magento's sitemap collection to process.
configure ( ) Configure Command
convertTxtToXml ( $txt ) : string Convert a txt URL list to XML using Magento sitemap structure.
execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : boolean | void Executes command.
executeBatches ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : array Executes all prepared batches of requests.
generateTablesData ( $results ) : array | boolean Generates data to output in a table.
generateTablesDataForFormat ( $results ) : array Generates table data without console styling.
getEffectiveUrl ( $url ) : mixed Gets the effective URL by following the redirects.
getSitemapFromInput ( $options ) : array | boolean Processes the sitemap data from input.
getStoreSitemaps ( ) : array | boolean Gets the store sitemap collection.
getStrippedUrl ( $url ) : boolean Strips the domain to only domain name and tld.
matchUrls ( $url, $match ) : mixed Checks if URL's are identical.
parseResponseCode ( $code ) : boolean | string Parses the response code colorized.
parseStatusMessage ( $result ) : string Parses the status message for the user in between requests.
prepareRequests ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : mixed Prepares all requests data by processing (sitemap) input.
replaceUrl ( $sitemapUrl, $replaceUrl ) : string Replaces the URL by a regex strip.
replaceUrlByParse ( $sitemapUrl, $replaceUrl ) : mixed Replaces the Sitemap URL
retrieveSitemaps ( ) : array Retrieve the sitemapCollection
simpleCurl ( $url ) : array A simple Curl function used to process the requests.
ttfbCompare ( $new, $old ) : string Compare the TTFB Values and give colorized response if necessary.
validateUrl ( $url ) : boolean Validates an URL

Method Details

askReplaceOrCompare() protected method

Asks the user what to do in case of a mismatched URL
protected askReplaceOrCompare ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, $definedUrl, $foundUrl ) : boolean | integer
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
$definedUrl
$foundUrl
return boolean | integer

askSitemapsToProcess() protected method

Asks the user which sitemaps from Magento's sitemap collection to process.
protected askSitemapsToProcess ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : array | boolean
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return array | boolean

configure() protected method

Configure Command
protected configure ( )

convertTxtToXml() protected method

Convert a txt URL list to XML using Magento sitemap structure.
protected convertTxtToXml ( $txt ) : string
$txt
return string

execute() protected method

Executes command.
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : boolean | void
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return boolean | void

executeBatches() protected method

Executes all prepared batches of requests.
protected executeBatches ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : array
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return array

generateTablesData() protected method

Generates data to output in a table.
protected generateTablesData ( $results ) : array | boolean
$results
return array | boolean

generateTablesDataForFormat() protected method

Generates table data without console styling.
protected generateTablesDataForFormat ( $results ) : array
$results
return array

getEffectiveUrl() protected method

Gets the effective URL by following the redirects.
protected getEffectiveUrl ( $url ) : mixed
$url
return mixed

getSitemapFromInput() protected method

Processes the sitemap data from input.
protected getSitemapFromInput ( $options ) : array | boolean
$options
return array | boolean

getStoreSitemaps() protected method

Gets the store sitemap collection.
protected getStoreSitemaps ( ) : array | boolean
return array | boolean

getStrippedUrl() protected method

Strips the domain to only domain name and tld.
protected getStrippedUrl ( $url ) : boolean
$url
return boolean

matchUrls() protected method

Checks if URL's are identical.
protected matchUrls ( $url, $match ) : mixed
$url
$match
return mixed

parseResponseCode() protected method

Parses the response code colorized.
protected parseResponseCode ( $code ) : boolean | string
$code
return boolean | string

parseStatusMessage() protected method

Parses the status message for the user in between requests.
protected parseStatusMessage ( $result ) : string
$result
return string

prepareRequests() protected method

Prepares all requests data by processing (sitemap) input.
protected prepareRequests ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : mixed
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return mixed

replaceUrl() protected method

Replaces the URL by a regex strip.
protected replaceUrl ( $sitemapUrl, $replaceUrl ) : string
$sitemapUrl
$replaceUrl
return string

replaceUrlByParse() protected method

Replaces the Sitemap URL
protected replaceUrlByParse ( $sitemapUrl, $replaceUrl ) : mixed
$sitemapUrl
$replaceUrl
return mixed

retrieveSitemaps() protected method

Retrieve the sitemapCollection
protected retrieveSitemaps ( ) : array
return array

simpleCurl() protected method

A simple Curl function used to process the requests.
protected simpleCurl ( $url ) : array
$url
return array

ttfbCompare() protected method

Compare the TTFB Values and give colorized response if necessary.
protected ttfbCompare ( $new, $old ) : string
$new
$old
return string

validateUrl() protected method

Validates an URL
protected validateUrl ( $url ) : boolean
$url
return boolean

Property Details

$_batches protected_oe property

protected $_batches

$_options protected_oe property

protected $_options

$_results protected_oe property

protected $_results

$_sitemaps protected_oe property

protected $_sitemaps

$_totalTime protected_oe property

protected $_totalTime