Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: pH-7/php-http-header-response

v1.0.4 Release - (Oct 21st 2024)

21 Oct 08:25
@pH-7 pH-7
04f84cf
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading
Assets 2
Loading

v1.0.3 Release - (August 12th 2023)

12 Aug 05:13
@pH-7 pH-7
3d00922
This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
GPG key ID: 4AEE18F83AFDEB23
Expired
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading

👀 Overview

  • Just a minor maintenance release 😊

💡 Changelog - What's New?

Full Changelog: v1.0.2...v1.0.3

Loading

v1.0.2 released! - (June 10th 2023)

09 Jun 07:43
@pH-7 pH-7
Compare
Choose a tag to compare
Loading
  • Fixing syntax error (missing , comma) mistakenly added in composer.json
Loading

v1.0.1 Released - (June 9th 2023)

09 Jun 04:54
@pH-7 pH-7
945afed
This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
GPG key ID: 4AEE18F83AFDEB23
Expired
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading
  • Just some minor cleanups and enhancements.
Loading

v1.0.0 Released!

09 Jun 04:35
@pH-7 pH-7
Compare
Choose a tag to compare
Loading

The first stable version of the PHP HTTP Header Response 🎉

How to use this new library

Send Header By HTTP Code

use PH7\PhpHttpResponseHeader\Header;
// Sends "200 OK" header to the browser
Http::setHeadersByCode(200);
// ...
// Send "201 Created" header
Http::setHeadersByCode(201);
// ...
// Sends "404 Not Found" to the browser
Http::setHeadersByCode(404);
// ...
// Sends "400 Bad Request" header to the browser
Http::setHeadersByCode(400);
// and so on ...

But, the library has many more handy methods such as below:

Maintenance Code

use PH7\PhpHttpResponseHeader\Header;
// Send 503, Service Temporarily Unavailable to the browser mentioning that you are doing a maintenance (good practice!)
Http::setMaintenanceCode($maintenanceTimeSeconds: 360);

Get HTTP Protocol

use PH7\PhpHttpResponseHeader\Header;
// The HTTP server protocol
Http::getProtocol()

Set Content Type

use PH7\PhpHttpResponseHeader\Header;
// Send "Content-Type: application/json" header to the browser
Http::setContentType("application/json");
// Send "Content-type: text/xml" to the browser
Http::setContentType("text/xml");

Enjoy! 🎉

Loading
pH-7 reacted with rocket emoji
1 person reacted

AltStyle によって変換されたページ (->オリジナル) /