diff options
Diffstat (limited to 'framework/Web/Javascripts/clientscripts.php')
-rw-r--r-- | framework/Web/Javascripts/clientscripts.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/framework/Web/Javascripts/clientscripts.php b/framework/Web/Javascripts/clientscripts.php index f66ebb3d..158b3210 100644 --- a/framework/Web/Javascripts/clientscripts.php +++ b/framework/Web/Javascripts/clientscripts.php @@ -175,12 +175,12 @@ function save_javascript($content, $filename) */
function get_saved_javascript($filename)
{
+ $fn=$filename;
if(supports_gzip_encoding())
- $filename .= '.gz';
- if(is_file($filename))
- return file_get_contents($filename);
- else
- error_log('Prado client script: no such file '.$filename);
+ $fn .= '.gz';
+ if(!is_file($fn))
+ save_javascript(get_javascript_code(true), $filename);
+ return file_get_contents($fn);
}
/**
@@ -533,8 +533,6 @@ if(count(get_script_requests()) > 0) {
if(($filename = compressed_js_filename()) !== null)
{
- if(!is_file($filename))
- save_javascript(get_javascript_code(true), $filename);
print_headers();
echo get_saved_javascript($filename);
}
|