Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
DownloadRequest example
private
function
handleDummyUpdate
(
PluginStruct
$plugin
,
$domain
,
$version
)
{
if
(
!
$plugin
->
isUpdateAvailable
(
)
)
{
$this
->io->
text
(
sprintf
(
'No update available for plugin %s',
$plugin
->
getLabel
(
)
)
)
;
return
;
}
$this
->io->
comment
(
sprintf
(
'Download plugin update package %s',
$plugin
->
getLabel
(
)
)
)
;
$request
=
new
DownloadRequest
(
$plugin
->
getTechnicalName
(
)
,
$version
,
$domain
, null
)
;
$model
=
$this
->
getPluginModel
(
$plugin
->
getTechnicalName
(
)
)
;
if
(
$plugin
->
isActive
(
)
)
{
$this
->container->
get
(
InstallerService::
class
)
->
deactivatePlugin
(
$model
)
;
}
$this
->container->
get
(
'shopware_plugininstaller.plugin_download_service'
)
->
download
(
$request
)
;
}
/** * @param string $version * @param string $domain * * @throws Exception */