Download the PHP package gino-pane/nano-http-status without Composer

On this page you can find all versions of the php package gino-pane/nano-http-status. 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 nano-http-status

PHP Nano Http Status

Latest Stable Version Build Status Maintainability Test Coverage Scrutinizer Code Quality License Total Downloads

Truly minimalistic and self-contained package to handle HTTP statuses and relevant description messages. Such packages as Teapot or Httpstatus are nice and famous, but still either too heavy and over-complicated or simply does not fit to Gino Pane's high code quality standards.

Requirements

Features

Installation

composer require gino-pane/nano-http-status

Basic Usage

Check existence of the code (using numeric codes or nice readable constants):

(new NanoHttpStatus())->statusExists(200); //true
(new NanoHttpStatus())->statusExists(400); //true
(new NanoHttpStatus())->statusExists(451); //true
(new NanoHttpStatus())->statusExists(511); //true
(new NanoHttpStatus())->statusExists(522); //false

Detect the class of the code using code numbers:

(new NanoHttpStatus())->isInformational(NanoHttpStatus::HTTP_OK); //false
(new NanoHttpStatus())->isSuccess(202);         //true
(new NanoHttpStatus())->isRedirection(301);     //true
(new NanoHttpStatus())->isClientError(404);     //true
(new NanoHttpStatus())->isServerError(NanoHttpStatus::HTTP_BAD_REQUEST); //false

Get status message by status code:

(new NanoHttpStatus())->getMessage(200); //OK
(new NanoHttpStatus())->getMessage(451); //Unavailable For Legal Reasons
(new NanoHttpStatus())->getMessage(452); //Undefined Status

Set localization mapping and get custom status messages:

$status = new NanoHttpStatus([
    NanoHttpStatus::HTTP_BAD_REQUEST => 'Very bad request',
    NanoHttpStatus::HTTP_BAD_GATEWAY => 'Not so bad gateway'
]);

$status->getMessage(400); //'Very bad request'
$status->getMessage(502); //'Not so bad gateway'

Please note, that itself does not throw any exceptions for invalid statuses.

Useful Tools

Running Tests:

php vendor/bin/phpunit

or

composer test

Code Sniffer Tool:

php vendor/bin/phpcs --standard=PSR2 src/

or

composer psr2check

Code Auto-fixer:

php vendor/bin/phpcbf --standard=PSR2 src/ 

or

composer psr2autofix

Building Docs:

php vendor/bin/phpdoc -d "src" -t "docs"

or

composer docs

Changelog

To keep track, please refer to CHANGELOG.md.

Contributing

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Make your changes.
  4. Run the tests, adding new ones for your own code if necessary (phpunit).
  5. Commit your changes (git commit -am 'Added some feature').
  6. Push to the branch (git push origin my-new-feature).
  7. Create new pull request.

Also please refer to CONTRIBUTION.md.

License

Please refer to LICENSE.

Notes

Powered by composer-package-template


All versions of nano-http-status with dependencies

PHP Build Version
Package Version
Requires php Version ^7.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 gino-pane/nano-http-status contains the following files

Loading the files please wait ....