20231010#6
This commit is contained in:
15
src/App.php
15
src/App.php
@@ -61,9 +61,7 @@ class App extends Main {
|
|||||||
$log = "Method ".$appHandler->className."/".$appHandler->methodName;
|
$log = "Method ".$appHandler->className."/".$appHandler->methodName;
|
||||||
}
|
}
|
||||||
$this->syslogger()->log("handlers", "OK - ".$log);
|
$this->syslogger()->log("handlers", "OK - ".$log);
|
||||||
/**
|
|
||||||
* 1. Если на этапе итерации уже получен ответ ResponseInterface - досрочно отдаем результат в эмиттер
|
|
||||||
*/
|
|
||||||
if($response instanceof ResponseInterface) {
|
if($response instanceof ResponseInterface) {
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
@@ -71,14 +69,7 @@ class App extends Main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 2. Если итерации закончились и задан обьект Content им создаем результат для эмиттера
|
* Отдаем пустой результат
|
||||||
*/
|
|
||||||
if($this->template() && !empty($this->template()->getResponse())){
|
|
||||||
$this->globals()->response()->getBody()->write($this->template()->getResponse());
|
|
||||||
return$this->globals()->response();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 3. Отдаем пустой результат если не определен шаблонизатор
|
|
||||||
*/
|
*/
|
||||||
return $this->defaultPage(404);
|
return $this->defaultPage(404);
|
||||||
}
|
}
|
||||||
@@ -99,7 +90,7 @@ class App extends Main {
|
|||||||
$this->syslogger()->error("Error: ".$error->getMessage()." : ".$error->getFile()." : ".$error->getLine());
|
$this->syslogger()->error("Error: ".$error->getMessage()." : ".$error->getFile()." : ".$error->getLine());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 4. Отдаем ошибку без шаблона
|
* Отдаем после ошибки
|
||||||
*/
|
*/
|
||||||
return $this->defaultPage(501);
|
return $this->defaultPage(501);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user