|
@@ -11,6 +11,7 @@
|
|
|
private $code = 200;
|
|
|
public $headers = [];
|
|
|
protected $open = true;
|
|
|
+ protected $shutdown = false;
|
|
|
public function __construct(){}
|
|
|
public function __toString(){
|
|
|
return $this->body;
|
|
@@ -112,6 +113,7 @@
|
|
|
return $this;
|
|
|
}
|
|
|
public function shutdown(){
|
|
|
+ $this->shutdown = true;
|
|
|
$this->fire('beforeshutdown');
|
|
|
if($this->open){
|
|
|
$this->end();
|
|
@@ -125,6 +127,12 @@
|
|
|
flush();
|
|
|
$this->fire('aftershutdown');
|
|
|
}
|
|
|
+ public function open(){
|
|
|
+ if(!$this->shutdown){
|
|
|
+ $this->open = true;
|
|
|
+ }
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
public static function locale(string $locale, string $domain, string $folder, string $codeset = 'UTF-8'){
|
|
|
$path = realpath($folder);
|
|
|
if($path !== false){
|