Автозамены регионов

This commit is contained in:
Konstantin
2026-05-30 17:43:37 +03:00
parent df8cf22112
commit 6c8a012702
16 changed files with 317 additions and 18 deletions
+7 -1
View File
@@ -14,6 +14,7 @@ class Response {
private $headers = array();
private $level = 0;
private $output;
private $replacements = array();
/**
* Constructor
@@ -63,6 +64,10 @@ class Response {
public function setOutput($output) {
$this->output = $output;
}
public function setReplacements($replacements) {
$this->replacements = is_array($replacements) ? $replacements : array();
}
/**
*
@@ -107,7 +112,8 @@ class Response {
*/
public function output() {
if ($this->output) {
$output = $this->level ? $this->compress($this->output, $this->level) : $this->output;
$output = $this->replacements ? strtr($this->output, $this->replacements) : $this->output;
$output = $this->level ? $this->compress($output, $this->level) : $output;
if (!headers_sent()) {
foreach ($this->headers as $header) {