Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120835381
Cache.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
942 B
Referenced Files
None
Subscribers
None
Cache.php
View Options
<?php
namespace
App\Policy\SPF
;
use
Illuminate\Support\Facades\Cache
as
LaravelCache
;
/**
* A caching layer for SPF check results, as sometimes the chasing of DNS entries can take a while but submissions
* inbound are virtually not rate-limited.
*
* A cache key should have the format of ip(4|6)_id_domain and last for 12 hours.
*
* A cache value should have a serialized version of the \SPFLib\Checker.
*/
class
Cache
{
public
static
function
get
(
$key
)
{
if
(
LaravelCache
::
has
(
$key
))
{
return
LaravelCache
::
get
(
$key
);
}
return
null
;
}
public
static
function
has
(
$key
)
{
return
LaravelCache
::
has
(
$key
);
}
public
static
function
set
(
$key
,
$value
)
{
if
(
LaravelCache
::
has
(
$key
))
{
LaravelCache
::
forget
(
$key
);
}
// cache the DNS record result for 12 hours
LaravelCache
::
put
(
$key
,
$value
,
60
*
60
*
12
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 1:17 PM (4 d, 44 s ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18747696
Default Alt Text
Cache.php (942 B)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline