Changeset 8075 for trunk/include
- Timestamp:
- Dec 11, 2010, 2:24:09 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r8012 r8075 1144 1144 } 1145 1145 1146 $is_css = $this->type == "css"; 1146 1147 global $conf; 1147 1148 $key = array(); 1148 1149 if ($is_css) 1150 $key[] = get_absolute_root_url(false);//because we modify bg url 1149 1151 for ($i=0; $i<count($this->files); $i++) 1150 1152 { … … 1157 1159 $file = base_convert(crc32($key),10,36); 1158 1160 $file = self::OUT_SUB_DIR . $file . '.' . $this->type; 1159 if (file_exists( PHPWG_ROOT_PATH . $file ) ) 1161 1162 $exists = file_exists( PHPWG_ROOT_PATH . $file ); 1163 if ($exists) 1164 { 1165 $is_reload = 1166 (isset($_SERVER['HTTP_CACHE_CONTROL']) && strpos($_SERVER['HTTP_CACHE_CONTROL'], 'max-age=0') !== false) 1167 || (isset($_SERVER['HTTP_PRAGMA']) && strpos($_SERVER['HTTP_PRAGMA'], 'no-cache')); 1168 if ($is_reload) 1169 {// the user pressed F5 in the browser 1170 if ($is_css || $conf['template_compile_check']==false) 1171 $exists = false; // we foce regeneration of css because @import sub-files are never checked for modification 1172 } 1173 } 1174 1175 if ($exists) 1160 1176 { 1161 1177 $out_file = $file; … … 1170 1186 { 1171 1187 $output .= "/* BEGIN $input_file */\n"; 1172 if ($ this->type == "css")1188 if ($is_css) 1173 1189 $output .= self::process_css($input_file); 1174 1190 else 1175 1191 $output .= self::process_js($input_file); 1176 1192 $output .= "\n"; 1177 1193 } … … 1184 1200 } 1185 1201 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1202 private static function process_js($file) 1203 { 1204 $js = file_get_contents(PHPWG_ROOT_PATH . $file); 1205 if (strpos($file, '.min')===false and strpos($file, '.packed')===false ) 1206 { 1207 //TODO minify javascript with some php lib from www... 1208 } 1209 return $js; 1210 } 1211 1196 1212 private static function process_css($file) 1197 1213 {
Note: See TracChangeset
for help on using the changeset viewer.