initial 2.0.0-a3 commit

This commit is contained in:
jerry
2020-10-03 23:00:18 +08:00
parent f91d24aaaa
commit da584e0542
28 changed files with 580 additions and 225 deletions

View File

@@ -4,10 +4,9 @@
namespace ZM\Http;
use ZM\Config\ZMConfig;
use ZM\Console\Console;
use Framework\ZMBuf;
use ZM\Utils\HttpUtil;
use ZM\Utils\ZMUtil;
class StaticFileHandler
{
@@ -23,7 +22,7 @@ class StaticFileHandler
} else {
if(is_file($full_path)) {
$exp = strtolower(pathinfo($full_path)['extension'] ?? "unknown");
$response->setHeader("Content-Type", ZMBuf::config("file_header")[$exp] ?? "application/octet-stream");
$response->setHeader("Content-Type", ZMConfig::get("file_header")[$exp] ?? "application/octet-stream");
$response->end(file_get_contents($full_path));
return true;
}