| Total Complexity | 4 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class RuleController extends Controller implements TestOnly |
||
| 10 | { |
||
| 11 | private static $url_segment = 'HTTPCacheControlIntegrationTest_RuleController'; |
||
|
|
|||
| 12 | |||
| 13 | private static $allowed_actions = [ |
||
| 14 | 'privateaction', |
||
| 15 | 'publicaction', |
||
| 16 | 'disabledaction', |
||
| 17 | ]; |
||
| 18 | |||
| 19 | protected function init() |
||
| 20 | { |
||
| 21 | parent::init(); |
||
| 22 | // Prefer public by default |
||
| 23 | HTTPCacheControlMiddleware::singleton()->publicCache(); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function privateaction() |
||
| 30 | } |
||
| 31 | |||
| 32 | public function publicaction() |
||
| 33 | { |
||
| 34 | HTTPCacheControlMiddleware::singleton() |
||
| 35 | ->publicCache() |
||
| 36 | ->setMaxAge(9000); |
||
| 37 | return 'public content'; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function disabledaction() |
||
| 44 | } |
||
| 45 | } |
||
| 46 |