. /** * JS and CSS compression. * * @package core * @copyright 2013 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * Collection of JS and CSS compression methods. */ class core_minify { /** * Minify JS code. * * @param string $content * @return string minified JS code */ public static function js($content) { try { $minifier = new MatthiasMullie\Minify\JS($content); return $minifier->minify(); } catch (Exception $e) { ob_end_clean(); $error = $e->getMessage(); } $return = <<minify(); } catch (Exception $e) { $error = $e->getMessage(); } $return = <<