Download the PHP package alexanderpas/http-enum without Composer

On this page you can find all versions of the php package alexanderpas/http-enum. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package http-enum

HTTP Enums For PHP 8.1 and above

PHP Version Require Latest Stable Version Latest Unstable Version License

This package provides HTTP Methods, Status Codes and Reason Phrases as PHP 8.1+ enums

All IANA registered HTTP Status codes and corresponding Reason Phrases as of the latest update on 2018-09-21 are supported.

This includes the HTTP Methods defined in RFC 5789 and RFC 7231, as well as all Status Codes and Reason Phrases as defined in HTTP/1.1 (RFC 7231, RFC 7232, RFC 7233, RFC 7235) and HTTP/2 (RFC 7540) as well as other RFC's defining HTTP status codes such as WebDAV (RFC 2518, RFC 4918, RFC 5842, RFC 8144) and more (RFC 8297, RFC 3229, RFC 7538, RFC 7694, RFC 6585, RFC 7725, RFC 2295, RFC 2774)

Requirements

Installation

Composer:

composer require alexanderpas/http-enum

Manually (Without Composer):

include the src/Method.php file in order to use the HTTP methods enum.

include both the src/ReasonPhrase.php file as well as the src/StatusCode.php file in order to use the HTTP Status Code enum or the HTTP Reason Phrase enum.

Available Enums and Enum methods

All available Enums live in the \Alexanderpas\Common\HTTP namespace.

In addition to the Enum methods available by default on Backed Enums, the following Enum methods are available.

All of the above methods also have a try variant (such as Method::tryFromName(?string $name): ?Method), which returns null if an invalid value of the correct type has been given instead of thowing an exception.

Additionally, you can change between Status Code enums and Reason Phrase enums using the following methods:

These methods do not have a try variant.

You can get the respective string or integer representation as usual by reading the value attribute on the enum.

License

Copyright Alexander Pas 2021. Distributed under the Boost Software License, Version 1.0. (See accompanying file https://www.boost.org/LICENSE_1_0.txt)

Notes


All versions of http-enum with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alexanderpas/http-enum contains the following files

Loading the files please wait ....