Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createOutputDirectory example
$this
->
sendHeaders
(
)
;
$productFeed
=
$this
->
get
(
'models'
)
->
getRepository
(
'\Shopware\Models\ProductFeed\ProductFeed'
)
->
find
(
(int)
$this
->
Request
(
)
->feedID
)
;
// Live generation
if
(
$productFeed
->
getInterval
(
)
=== 0
)
{
$this
->
generateExport
(
'php://output'
)
;
return
;
}
$directory
=
$this
->
createOutputDirectory
(
)
;
$fileName
=
$productFeed
->
getHash
(
)
. '_' .
$productFeed
->
getFileName
(
)
;
$filePath
=
$directory
.
$fileName
;
if
(
$productFeed
->
getInterval
(
)
=== -1 &&
file_exists
(
$filePath
)
)
{
readfile
(
$filePath
)
;
return
;
}
$diffInterval
=
time
(
)
;
if
(
$productFeed
->
getCacheRefreshed
(
)
)
{