Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
MissingShopUrlException example
new
EqualsFilter
(
'name',
$appName
)
)
;
/** @var AppEntity|null $app */
$app
=
$this
->appRepository->
search
(
$criteria
,
$context
)
->
first
(
)
;
if
(
$app
=== null
)
{
throw
new
AppByNameNotFoundException
(
$appName
)
;
}
$shopUrl
= EnvironmentHelper::
getVariable
(
'APP_URL'
)
;
if
(
!\
is_string
(
$shopUrl
)
)
{
throw
new
MissingShopUrlException
(
)
;
}
$appSecret
=
$app
->
getAppSecret
(
)
;
if
(
$appSecret
=== null
)
{
throw
new
MissingAppSecretException
(
)
;
}
$targetUrl
=
$requestDataBag
->
get
(
'url'
)
;
$targetHost
= \
parse_url
(
(string)
$targetUrl
, \PHP_URL_HOST
)
;
$allowedHosts
=
$app
->
getAllowedHosts
(
)
??
[
]
;
if
(
!
$targetHost
|| !\
in_array
(
$targetHost
,
$allowedHosts
, true
)
)
{