Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createProfileFromData example
flock
(
$h
, \LOCK_UN
)
;
fclose
(
$h
)
;
if
(
\
function_exists
(
'gzdecode'
)
)
{
$data
= @
gzdecode
(
$data
)
?:
$data
;
}
if
(
!
$data
=
unserialize
(
$data
)
)
{
return
null;
}
return
$this
->
createProfileFromData
(
$token
,
$data
,
$profile
)
;
}
private
function
removeExpiredProfiles
(
)
: void
{
$minimalProfileTimestamp
=
time
(
)
- 2 * 86400;
$file
=
$this
->
getIndexFilename
(
)
;
$handle
=
fopen
(
$file
, 'r'
)
;
if
(
$offset
=
is_file
(
$file
.'.offset'
)
?
(int)
file_get_contents
(
$file
.'.offset'
)
: 0
)
{
fseek
(
$handle
,
$offset
)
;
}
flock
(
$h
, \LOCK_UN
)
;
fclose
(
$h
)
;
if
(
\
function_exists
(
'gzdecode'
)
)
{
$data
= @
gzdecode
(
$data
)
?:
$data
;
}
if
(
!
$data
=
unserialize
(
$data
)
)
{
return
null;
}
return
$this
->
createProfileFromData
(
$token
,
$data
,
$profile
)
;
}
private
function
removeExpiredProfiles
(
)
: void
{
$minimalProfileTimestamp
=
time
(
)
- 2 * 86400;
$file
=
$this
->
getIndexFilename
(
)
;
$handle
=
fopen
(
$file
, 'r'
)
;
if
(
$offset
=
is_file
(
$file
.'.offset'
)
?
(int)
file_get_contents
(
$file
.'.offset'
)
: 0
)
{
fseek
(
$handle
,
$offset
)
;
}