1 | <?php |
||
16 | class CachedCurlRequest extends CurlRequest { |
||
17 | |||
18 | /** |
||
19 | * Fixed constant |
||
20 | */ |
||
21 | const CACHE_PREFIX = 'onoi:http:'; |
||
22 | |||
23 | /** |
||
24 | * @var Cache |
||
25 | */ |
||
26 | private $cache; |
||
27 | |||
28 | /** |
||
29 | * @var boolean |
||
30 | */ |
||
31 | private $isFromCache = false; |
||
32 | |||
33 | /** |
||
34 | * @since 1.0 |
||
35 | * |
||
36 | * @param resource $handle |
||
37 | * @param Cache $cache |
||
38 | */ |
||
39 | 9 | public function __construct( $handle, Cache $cache ) { |
|
46 | |||
47 | /** |
||
48 | * @deprecated since 1.3, use option ONOI_HTTP_REQUEST_RESPONSECACHE_TTL instead |
||
49 | * @since 1.0 |
||
50 | * |
||
51 | * @param integer $expiry |
||
52 | */ |
||
53 | 1 | public function setExpiryInSeconds( $expiry ) { |
|
56 | |||
57 | /** |
||
58 | * @deprecated since 1.3, use option ONOI_HTTP_REQUEST_RESPONSECACHE_PREFIX instead |
||
59 | * @since 1.0 |
||
60 | * |
||
61 | * @param string $cachePrefix |
||
62 | */ |
||
63 | 2 | public function setCachePrefix( $cachePrefix ) { |
|
66 | |||
67 | /** |
||
68 | * @deprecated since 1.3, use CachedCurlRequest::isFromCache instead |
||
69 | * @since 1.0 |
||
70 | * |
||
71 | * @return boolean |
||
72 | */ |
||
73 | 1 | public function isCached() { |
|
76 | |||
77 | /** |
||
78 | * @since 1.3 |
||
79 | * |
||
80 | * @return boolean |
||
81 | */ |
||
82 | 2 | public function isFromCache() { |
|
85 | |||
86 | /** |
||
87 | * @since 1.0 |
||
88 | * |
||
89 | * @return mixed |
||
90 | */ |
||
91 | 5 | public function execute() { |
|
116 | |||
117 | 5 | private function getKeysFromOptions() { |
|
142 | |||
143 | } |
||
144 |