Reapplied customisations to tiny_mce_gzip.php

See previously applied customisations at https://github.com/silverstripe/silverstripe-framework/blob/3/thirdparty/tinymce/tiny_mce_gzip.php
See https://github.com/silverstripe/silverstripe-framework/pull/5258
This commit is contained in:
Ingo Schommer 2016-04-04 08:01:17 +12:00
parent b1b85b539e
commit c2b6f6199c

View File

@ -9,6 +9,11 @@
* Contributing: http://tinymce.moxiecode.com/contributing * Contributing: http://tinymce.moxiecode.com/contributing
*/ */
$frameworkPath = rtrim(dirname(dirname(dirname(__FILE__))), DIRECTORY_SEPARATOR);
$basePath = rtrim(dirname($frameworkPath), DIRECTORY_SEPARATOR);
require_once $frameworkPath . '/core/Constants.php';
// Handle incoming request if it's a script call // Handle incoming request if it's a script call
if (TinyMCE_Compressor::getParam("js")) { if (TinyMCE_Compressor::getParam("js")) {
// Default settings // Default settings
@ -21,6 +26,9 @@ if (TinyMCE_Compressor::getParam("js")) {
* "files" => "somescript,anotherscript", * "files" => "somescript,anotherscript",
* "expires" => "1m", * "expires" => "1m",
*/ */
// CUSTOM SilverStripe
'cache_dir' => TEMP_FOLDER
// CUSTOM END
)); ));
// Handle request, compress and stream to client // Handle request, compress and stream to client
@ -49,7 +57,9 @@ class TinyMCE_Compressor {
"plugins" => "", "plugins" => "",
"themes" => "", "themes" => "",
"languages" => "", "languages" => "",
"disk_cache" => false, // CUSTOM SilverStripe
"disk_cache" => true,
// END CUSTOM
"expires" => "30d", "expires" => "30d",
"cache_dir" => "", "cache_dir" => "",
"compress" => true, "compress" => true,
@ -179,7 +189,9 @@ class TinyMCE_Compressor {
} }
// Generate hash for all files // Generate hash for all files
$hash = md5(implode('', $allFiles)); // CUSTOM SilverStripe Webroot-specific caches
$hash = md5(implode('', $allFiles) . $_SERVER['SCRIPT_NAME']);
// CUSTOM END
// Check if it supports gzip // Check if it supports gzip
$zlibOn = ini_get('zlib.output_compression') || (ini_set('zlib.output_compression', 0) === false); $zlibOn = ini_get('zlib.output_compression') || (ini_set('zlib.output_compression', 0) === false);