This commit is contained in:
me
2026-07-23 15:29:13 +07:00
commit 9ec08a3e44
36 changed files with 2790 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Nightmare\Http;
class Http
{
/**
* @param mixed $data
* @param int $status
* @param array $headers
* @return Response
*/
public static function response($data = null, $status = 200, $headers = [])
{
return new Response($data, $status, $headers);
}
/**
* @param string $url
* @param int $status
* @return void
*/
public static function redirect($url, $status = 301)
{
@ob_end_clean();
http_response_code($status);
header('Location: ' . $url);
exit;
}
/**
* @return void
*/
public static function refresh()
{
@ob_end_clean();
header('Refresh: 0');
exit;
}
}