4 $mode = isset($_COOKIE[$cookie]) ?
(bool) $_COOKIE[$cookie] : false;
6 // purgatory mode lasts half a year
7 if (isset($_POST['purgatory'])) {
9 setcookie($cookie, $mode ?
'1' : '0',
10 time() +
60 * 60 * 24 * 7 * 21, '/'
14 ?
><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
15 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="en" lang
="en">
17 <title
>Purgatory
-mode
- XHTML Compiler
</title
>
18 <style type
="text/css">
19 form
{text
-align
: center
;}
24 <h1
>Purgatory
-mode
</h1
>
25 <p
>Purgatory
-mode is a special cookie that causes all requests to
26 redirect to
<code
>main
.php
</code
>. As such
, it
's good for page
27 developers who want to see their changes in real-time without
28 having to manually append <code>?purge=1</code> to their page name.</p>
29 <p>Note that purgatory-mode will still check if the source file
30 is newer than the cache file. To override completely, you must use
31 the purge parameter.</p>
32 <form method="post" action="">
34 <p>Purgatory mode is: <strong style="color:<?php echo $mode ? '#F00' : '#090' ?>"><?php echo $mode ? 'On' : 'Off' ?></strong></p>
35 <input name
="purgatory" type
="submit" value
="Toggle purgatory-mode" />