Download the PHP package shrikeh/teapot without Composer

On this page you can find all versions of the php package shrikeh/teapot. 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 teapot

Teapot

latest_stable_version_img license_img twitter_img

This is a very simple library that aims to aid verbosity in any Web-based application by defining clearly the HTTP 1.1 response codes as constants. It includes two main components: an interface, which contains the constants, and an exception specifically for HTTP.

Usage

Using the StatusCodes interface

Assuming for a moment a PHPUnit test on a cURL client response:

This becomes:

While this is a trivial example, the additional verbosity of the code is clearer with other HTTP status codes:

As StatusCode is an interface without any methods, you can directly implement it if you prefer:

This may be beneficial in an abstract class, so that child classes don't need to explicitly use the interface.

There are various "helper" interfaces within the library, such as WebDAV and Http. Additionally, the various status codes are split into the RFCs that defined them: the Http helper interface extends RFCs 2616, 2324, and 2774, for example. This allows you very granular control of what status codes you want to allow within your application.

All constants have doc blocks that use the official W3C and IETF draft specification descriptions of the status code, to aid IDEs and for reference.

Using the HttpException

The HttpException is very straightforward. It simply is a named exception to aid verbosity:

The exception itself uses the StatusCode interface, allowing you to avoid manually and explicitly importing it if you prefer:

Installation

Run the following command.

Coding Standards

The entire library is intended to be PSR-1, PSR-2 and PSR-4 compliant.

Get in touch

If you have any suggestions, feel free to email me at [email protected] or ping me on Twitter with @shrikeh.


All versions of teapot with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
psr/http-message Version ^1.0
teapot/status-code Version ^1.0
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 shrikeh/teapot contains the following files

Loading the files please wait ....