Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getFreePlugin example
$this
->input =
$input
;
$this
->output =
$output
;
$technicalName
=
$input
->
getArgument
(
'technical-name'
)
;
$domain
=
$this
->
checkDomain
(
)
;
$version
=
$this
->
checkVersion
(
)
;
$token
= null;
$io
=
$this
->io =
new
SymfonyStyle
(
$input
,
$output
)
;
$io
->
title
(
'Community Store Download Command'
)
;
$plugin
=
$this
->
getFreePlugin
(
$technicalName
,
$version
)
;
if
(
$plugin
&&
$plugin
->
getCode
(
)
!== null
)
{
if
(
$plugin
->
hasFreeDownload
(
)
=== false &&
$plugin
->
hasCapabilityDummy
(
)
=== false
)
{
$io
->
note
(
sprintf
(
'You must be authenticated to download: %s',
$plugin
->
getLabel
(
)
)
)
;
$token
=
$this
->
checkAuthentication
(
)
;
}
}
else
{
$io
->
note
(
'Plugin was not found. Retrying as authenticated used.'
)
;
$token
=
$this
->
checkAuthentication
(
)
;