return true;
} public function onFilterRender(Enlight_Event_EventArgs
$args) { /** @var Enlight_Controller_Request_RequestHttp $request */
$request =
$args->
getSubject()->
Action()->
Request();
/** @var Enlight_Controller_Response_ResponseHttp $response */
$response =
$args->
getSubject()->
Action()->
Response();
$source =
$args->
getReturn();
$headers =
$response->
getHeaders();
foreach ($headers as $header) { if ($header['name'
] === 'Content-Type' &&
str_starts_with($header['value'
], 'application/javascript'
)) { $source =
str_replace(["\r\n", "\r"
], "\n",
$source);
$expressions =
[ // Remove comments
'#/\*.*?\*/#ms' => '',
'#^\s*//.*$#m' => '',
// '#\n\s+#ms' => '',
'#^\s+#ms' => '',