Updated cache file to depend on js group

This commit is contained in:
Timothy Warren 2011-09-07 19:24:17 -04:00
parent e10af876b1
commit 1e61405909

7
js.php
View File

@ -1,7 +1,6 @@
<?php
//Change as needed
$base_path = $_SERVER['DOCUMENT_ROOT'];
$cache_file = $base_path.'/cache/cache.js';
require('./config/jshrink.php');
@ -34,6 +33,8 @@ $modified = array();
if(isset($groups[$_GET['g']]))
{
$cache_file = $base_path.'/cache/'.$_GET['g'];
foreach($groups[$_GET['g']] as $file)
{
$new_file = realpath($base_path.$file);
@ -41,6 +42,10 @@ if(isset($groups[$_GET['g']]))
$modified[] = filemtime($new_file);
}
}
else //Nothing to display? Just exit
{
die("You must specify a group that exists");
}
//Add this page too
$modified[] = filemtime($base_path."js.php");