<?php
namespace Engine\Logger\Context; abstract class GeneralAbstract { protected $value = null; public function __construct($value) { $this->value = $value; } public function getValue() { return $this->value; } abstract public function render($logRow=null, $key=null); protected function isBinary($value) { return !mb_check_encoding($value, 'UTF-8'); } protected function generateDownloadLink($content, $fileName, $fileExtension) { if (strlen($content)>(4*1024*1024)) { $content = gzencode($content, 9); $fileExtension = $fileExtension.'.gz'; } $downloadName = basename($fileName) . '.' . $fileExtension; return '<a href="data:application/octet-stream;base64,' . base64_encode($content) . '" download="' . $downloadName . '" title="' . $downloadName . '">⬇️ download ' . $downloadName . '</a>'; } } 