Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getUserContextFromInput example
->
addOption
(
'user', 'u', InputOption::VALUE_OPTIONAL, 'User'
)
;
}
protected
function
execute
(
InputInterface
$input
, OutputInterface
$output
)
: int
{
$context
= Context::
createDefaultContext
(
)
;
$pluginName
=
(string)
$input
->
getOption
(
'pluginName'
)
;
$user
=
$input
->
getOption
(
'user'
)
;
$context
=
$this
->
getUserContextFromInput
(
$user
,
$context
)
;
$this
->
validatePluginIsNotManagedByComposer
(
$pluginName
,
$context
)
;
try
{
$data
=
$this
->storeClient->
getDownloadDataForPlugin
(
$pluginName
,
$context
)
;
}
catch
(
ClientException
$exception
)
{
throw
new
StoreApiException
(
$exception
)
;
}
$this
->pluginManagementService->
downloadStorePlugin
(
$data
,
$context
)
;