UpdateCheckTransientHourly.php
676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace ACP\Transient;
use AC\Expirable;
use AC\Storage;
class UpdateCheckTransientHourly implements Expirable {
/**
* @var Storage\Timestamp
*/
protected $timestamp;
public function __construct() {
$this->timestamp = new Storage\Timestamp(
new Storage\Option( 'acp_periodic_update_plugins_check_hourly' )
);
}
/**
* @param int|null $time
*
* @return bool
*/
public function is_expired( $time = null ) {
return $this->timestamp->is_expired( $time );
}
public function delete() {
$this->timestamp->delete();
}
/**
* @return bool
*/
public function save() {
return $this->timestamp->save( time() + HOUR_IN_SECONDS );
}
}