Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
js.php
Go to the documentation of this file.
1 <?php
2 if ( !defined('DATAFACE_SITE_PATH') ) die("Cannot be called directly");
3 if ( !$_GET['--id'] ) die("No id specified");
4 $path = DATAFACE_SITE_PATH.DIRECTORY_SEPARATOR.'templates_c'.DIRECTORY_SEPARATOR.basename($_GET['--id']).'.js';
5 if ( !file_exists($path) ){
6  dir("File could not be found");
7 }
8 // seconds, minutes, hours, days
9 //ob_start("ob_gzhandler"); //Removed due to PHP BUG 55544
10 ob_start();
11 $expires = 60*60*24*14;
12 session_cache_limiter('public');
13 header("Pragma: public", true);
14 header("Cache-Control:max-age=".$expires.', public, s-maxage='.$expires, true);
15 header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT', true);
16 header('Content-type: text/javascript', true);
17 //header('Content-Length: '.strlen($out), true);
18 header('Connection: close', true);
19 echo file_get_contents($path);
20 
21 
22 exit;
23