first commit

This commit is contained in:
2023-04-15 23:29:27 +08:00
commit 2d9ac93a7a
71 changed files with 4592 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Kiri\Router;
class ChunkResponse extends Response
{
public int $limit;
/**
* @param object $response
* @return void
*/
public function write(object $response): void
{
$body = $this->getBody();
$total = ceil($this->limit / $body->getSize());
for ($i = 0; $i < $total; $i++) {
$body->seek($i);
$response->write($body->read($this->limit));
}
$response->end();
}
}