Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * Generic interface providing Time-To-Live constants for expirable object storage |
4 | * |
5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. |
9 | * |
10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. |
14 | * |
15 | * You should have received a copy of the GNU General Public License along |
16 | * with this program; if not, write to the Free Software Foundation, Inc., |
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
18 | * http://www.gnu.org/copyleft/gpl.html |
19 | * |
20 | * @file |
21 | * @ingroup Cache |
22 | */ |
23 | |
24 | namespace Wikimedia\LightweightObjectStore; |
25 | |
26 | /** |
27 | * Generic interface providing Time-To-Live constants for expirable object storage |
28 | * |
29 | * @ingroup Cache |
30 | * @since 1.35 |
31 | */ |
32 | interface ExpirationAwareness { |
33 | /** @var int One second, in seconds */ |
34 | public const TTL_SECOND = 1; |
35 | /** @var int One minute, in seconds */ |
36 | public const TTL_MINUTE = 60; |
37 | /** @var int One hour, in seconds */ |
38 | public const TTL_HOUR = 3_600; |
39 | /** @var int One day, in seconds */ |
40 | public const TTL_DAY = 86_400; |
41 | /** @var int One week, in seconds */ |
42 | public const TTL_WEEK = 604_800; |
43 | /** @var int One month, in seconds */ |
44 | public const TTL_MONTH = 2_592_000; |
45 | /** @var int One year, in seconds */ |
46 | public const TTL_YEAR = 31_536_000; |
47 | |
48 | /** @var int Reasonably strict cache time that last the life of quick requests */ |
49 | public const TTL_PROC_SHORT = 3; |
50 | /** @var int Loose cache time that can survive slow web requests */ |
51 | public const TTL_PROC_LONG = 30; |
52 | |
53 | /** @var int Idiom for "store indefinitely" */ |
54 | public const TTL_INDEFINITE = 0; |
55 | /** @var int Idiom for "do not store the newly generated result" */ |
56 | public const TTL_UNCACHEABLE = -1; |
57 | } |