includes/clientside/jsres.php
changeset 613 c08670a77871
parent 594 738c61b498a6
child 650 e45183014778
equal deleted inserted replaced
612:3e73e4996d64 613:c08670a77871
    66 // ENANO_ROOT is sometimes defined by plugins like AjIM that need the constant before the Enano API is initialized
    66 // ENANO_ROOT is sometimes defined by plugins like AjIM that need the constant before the Enano API is initialized
    67 if ( !defined('ENANO_ROOT') )
    67 if ( !defined('ENANO_ROOT') )
    68   define('ENANO_ROOT', dirname(dirname(dirname($filename))));
    68   define('ENANO_ROOT', dirname(dirname(dirname($filename))));
    69 
    69 
    70 chdir(ENANO_ROOT);
    70 chdir(ENANO_ROOT);
       
    71 
       
    72 // fetch only the site config
       
    73 define('ENANO_EXIT_AFTER_CONFIG', 1);
       
    74 require('includes/common.php');
    71 
    75 
    72 // CONFIG
    76 // CONFIG
    73 
    77 
    74 // Files safe to run full (aggressive) compression on
    78 // Files safe to run full (aggressive) compression on
    75 $full_compress_safe = array(
    79 $full_compress_safe = array(
    95 );
    99 );
    96 
   100 
    97 // Files that should NOT be compressed due to already being compressed, licensing, or invalid produced code
   101 // Files that should NOT be compressed due to already being compressed, licensing, or invalid produced code
    98 $compress_unsafe = array('SpryEffects.js', 'json.js', 'fat.js', 'admin-menu.js', 'autofill.js');
   102 $compress_unsafe = array('SpryEffects.js', 'json.js', 'fat.js', 'admin-menu.js', 'autofill.js');
    99 
   103 
   100 require('includes/functions.php');
       
   101 require('includes/json2.php');
       
   102 require('includes/js-compressor.php');
   104 require('includes/js-compressor.php');
   103 
   105 
   104 // try to gzip the output
   106 // try to gzip the output
   105 $do_gzip = false;
   107 $do_gzip = false;
   106 if ( isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
   108 if ( isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
   277         $loaded_cache = true;
   279         $loaded_cache = true;
   278         $file_contents = $cache_file['src'];
   280         $file_contents = $cache_file['src'];
   279       }
   281       }
   280     }
   282     }
   281   }
   283   }
   282   if ( !$loaded_cache )
   284   if ( !$loaded_cache && getConfig('cache_thumbs') == '1' )
   283   {
   285   {
   284     // Try to open the cache file and write to it. If we can't do that, just don't compress the code.
   286     // Try to open the cache file and write to it. If we can't do that, just don't compress the code.
   285     $handle = @fopen($cache_path, 'w');
   287     $handle = @fopen($cache_path, 'w');
   286     if ( $handle )
   288     if ( $handle )
   287     {
   289     {