\TinyMCE4_Compressor
This class combines and compresses the TinyMCE core, plugins, themes and language packs into one disk cached gzipped request. It improves the loading speed of TinyMCE dramatically but still provides dynamic initialization.
Example of direct usage:
require_once("../jscripts/tiny_mce/tiny_mce_gzip.php");
// Renders script tag with compressed scripts
TinyMCE_Compressor::renderTag(array(
"url" => "../jscripts/tiny_mce/tiny_mce_gzip.php",
"plugins" => "pagebreak,style",
"themes" => "advanced",
"languages" => "en"
));
Synopsis
class TinyMCE4_Compressor
{
- // members
- private $files;
- private static array $defaultSettings = ;
- // methods
- public void __construct()
- public void addFile()
- public void handleRequest()
- public static String renderTag()
- public static String getParam()
- private Int parseTime()
- private String getFileContents()
Members
private
- $defaultSettings
- $files
Methods
private
- getFileContents() — Returns the contents of the script file if it exists and removes the UTF-8 BOM header if it exists.
- parseTime() — Parses the specified time format into seconds. Supports formats like 10h, 10d, 10m.
public
- __construct() — Constructs a new compressor instance.
- addFile() — Adds a file to the concatenation/compression process.
- getParam() — Returns a sanitized query string parameter.
- handleRequest() — Handles the incoming HTTP request and sends back a compressed script depending on settings and client support.
- renderTag() — Renders a script tag that loads the TinyMCE script.