forked from shannah/xataface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs.php
23 lines (20 loc) · 824 Bytes
/
js.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
if ( !defined('DATAFACE_SITE_PATH') ) die("Cannot be called directly");
if ( !$_GET['--id'] ) die("No id specified");
$path = DATAFACE_SITE_PATH.DIRECTORY_SEPARATOR.'templates_c'.DIRECTORY_SEPARATOR.basename($_GET['--id']).'.js';
if ( !file_exists($path) ){
dir("File could not be found");
}
// seconds, minutes, hours, days
//ob_start("ob_gzhandler"); //Removed due to PHP BUG 55544
ob_start();
$expires = 60*60*24*14;
session_cache_limiter('public');
header("Pragma: public", true);
header("Cache-Control:max-age=".$expires.', public, s-maxage='.$expires, true);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT', true);
header('Content-type: text/javascript', true);
//header('Content-Length: '.strlen($out), true);
header('Connection: close', true);
echo file_get_contents($path);
exit;