virt2/api/php/js.php

14 lines
508 B
PHP
Raw Permalink Normal View History

<?php
ini_set('display_errors', 1);
header("Content-type: text/javascript");
function compress($buffer) {
$buffer = preg_replace("/(?:(?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:(?<!\:|\\\|\'|\")\/\/.*))/", "", $buffer);
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", " ", " ", " "), "", $buffer);
return $buffer;
}
ob_start("compress");
include($_SERVER['DOCUMENT_ROOT'] . '/api/code/js/' . $_GET['mod'] . '.js'); // Ссылка на скрипт 1
ob_end_flush();
?>