1<?php
2/**
3 * @license GPL v2 (http://www.gnu.org/licenses/gpl.html)
4 * @author  Willi Schönborn (w.schoenborn@googlemail.com)
5 */
6
7if (!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__) . '/../../../');
8define('NOSESSION', true);
9require_once(DOKU_INC . 'inc/init.php');
10
11$data = $_REQUEST;
12$plugin = plugin_load('syntax', 'plantuml');
13$cache  = $plugin->_imgfile($data);
14
15if ($cache) {
16    header('Content-Type: image/png;');
17    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + max($conf['cachetime'], 3600)) . ' GMT');
18    header('Cache-Control: public, proxy-revalidate, no-transform, max-age=' . max($conf['cachetime'], 3600));
19    header('Pragma: public');
20    http_conditionalRequest($time);
21    echo io_readFile($cache, false);
22} else {
23    header('HTTP/1.0 404 Not Found');
24    header('Content-Type: image/png');
25    echo io_readFile('res/file-broken/file-broken.png', false);
26}
27