Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
handleAuth example
$this
->
executeCommand
(
"STARTTLS\r\n",
[
220
]
)
;
if
(
!
$stream
->
startTLS
(
)
)
{
throw
new
TransportException
(
'Unable to connect with STARTTLS.'
)
;
}
$response
=
$this
->
executeCommand
(
sprintf
(
"EHLO %s\r\n",
$this
->
getLocalDomain
(
)
)
,
[
250
]
)
;
$this
->capabilities =
$this
->
parseCapabilities
(
$response
)
;
}
if
(
\
array_key_exists
(
'AUTH',
$this
->capabilities
)
)
{
$this
->
handleAuth
(
$this
->capabilities
[
'AUTH'
]
)
;
}
return
$response
;
}
private
function
parseCapabilities
(
string
$ehloResponse
)
: array
{
$capabilities
=
[
]
;
$lines
=
explode
(
"\r\n",
trim
(
$ehloResponse
)
)
;
array_shift
(
$lines
)
;
foreach
(
$lines
as
$line
)
{