Download the PHP package anax/request without Composer

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

Anax Request

Latest Stable Version Join the chat at https://gitter.im/mosbth/anax

Build Status CircleCI

Build Status Scrutinizer Code Quality Code Coverage

Maintainability Codacy Badge

Anax Request module for wrapping all request related information.

The module essentially wraps access to $_GET, $_POST, $_SERVER, information send through the HTTP body and calculates url details (current, site, base, route path) from the request uri.

The module provides a framework unified way to access these global variables and it provides a way to inject a certain setup when using the module for unit testing.

Table of content

Class, interface, trait

The following classes, interfaces and traits exists.

Class, interface, trait Description
Anax\Request\Request Wrapper class for request details and related.

Exceptions

Module specific exceptions are thrown through Anax\Request\Exception.

Configuration file

There is no configuration file for this module.

DI service

The module is created as a framework service within $di. You can see the details in the configuration file config/di/request.php.

It can look like this.

  1. The object is created as a shared resource.
  2. The init-method reads information from the environment to find out the url of the request.

The service is lazy loaded and not created until it is used.

General usage within the Anax framework

The request service is a mandatory service within the Anax framework and it is the first service used when handling a request.

Here is the general flow for receiving a request, mapping it to a route and returning a response. This is found in the frontcontroller htdocs/index.php of an Anax installation.

The request is used to get the request method and the route path, these are used by the router service to find a callback for the route. Each callback can then return a response which is sent through the response service.

Access as framework service

You can access the module as a framework service.

Create and init an object

This is how the object can be created. This is usually done within the framework as a sevice in $di.

Extract url and route parts

When the object is initiated you can extract url and route parts from it. This is based on the current url.

Get and set $_SERVER

You can get and set values in the PHP global variable $_SERVER.

You are reading and setting values in a copy of $_SERVER, so you are not actually editing the global variable, just the internal representation within the class.

Get and set $_GET

You can get and set values in the PHP global variable $_GET.

You are reading and setting values in a copy of $_GET, so you are not actually editing the global variable, just the internal representation within the class.

Get and set $_POST

You can get and set values in the PHP global variable $_POST.

You are reading and setting values in a copy of $_POST, so you are not actually editing the global variable, just the internal representation within the class.

Get and set request body

You can get and set the value in the HTTP request body. Sometimes the HTTP request body is used to send parameters to an route.

You are setting values in a copy of the actual body, so you are not actually editing it, just the internal representation within the class.

License

This software carries a MIT license. See LICENSE.txt for details.


All versions of request with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
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 anax/request contains the following files

Loading the files please wait ....