Skip to content

Commit

Permalink
Passing meta options into the parser
Browse files Browse the repository at this point in the history
  • Loading branch information
mwunsch committed Sep 2, 2010
1 parent c683bda commit 3ba2aa1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions theme.php
Expand Up @@ -4,6 +4,9 @@

$DATA = 'demo.yml';
$THEME = 'themes/'.$_GET['theme'];
$options = $_REQUEST;

unset($options['theme'], $options['auto-refresh']);

$last_modified_time = filemtime($THEME);
$etag = md5_file($THEME);
Expand All @@ -12,12 +15,12 @@
header("Etag: $etag");

if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time ||
trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
header("HTTP/1.1 304 Not Modified");
exit;
trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
header("HTTP/1.1 304 Not Modified");
exit;
}

$theme = new ThimbleParser(file_get_contents('data/'.$DATA));
echo $theme->parse(file_get_contents($THEME));
echo $theme->parse(file_get_contents($THEME), $options);

?>
?>

0 comments on commit 3ba2aa1

Please sign in to comment.