Download the PHP package jacksonsr451/php-easy-http without Composer

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

PHP Easy HTTP

Modern PSR-7/PSR-15 inspired toolkit for building lightweight HTTP services and FastAPI-like microservices in PHP. Ships with strict-typed message objects, a declarative router, middleware pipeline, and an ergonomic Application class for rapid development.


Requirements

Installation

The package exposes all classes under the PhpEasyHttp\Http namespace through PSR-4 autoloading.

Key Features

Project Structure

Quick Start

Visit http://localhost:8000/ping to receive a JSON payload.

Declarative Routing

FastAPI-Style Declarative Routes

Skip the manual route table by annotating controller methods with PHPDoc comments or native PHP attributes. Any public method that declares a route directive/attribute is automatically registered when you call registerControllers().

Using PHPDoc

Using Native PHP Attributes

API Gateway Style Dynamic Routes

The jacksonsr45/api-gateway package ships with a thin layer on top of Application that mimics APISIX-style route management. Routes can be loaded from JSON/YAML files, database records, or an admin API (via custom GatewayRouteSource implementations). Each GatewayRoute entry accepts:

Field Type Description
id string Unique identifier, becomes the route name.
methods string[] List of HTTP verbs (GET, POST, ...).
path string Same placeholder syntax as regular routes (/users/{id}).
handler string Optional local handler reference (Class@method or invokable class).
proxy.handler string Optional class implementing InternalProxyInterface for internal proxying.
middleware string[] Middleware names already registered in the Application.
summary/tags string / string[] Metadata for documentation.

Exactly one of handler or proxy must be provided. Proxy handlers receive the current ServerRequestInterface (with route params stored as request attributes) and return a PSR-7 response. Unlike APISIX, proxying is fully in-process (no external HTTP hop) so you can encapsulate orchestration logic inside PHP classes.

Loading Routes from a File

gateway.yaml (JSON works the same):

Create additional GatewayRouteSource implementations (database, HTTP admin API, etc.) and feed them to Gateway::addSource() to merge multiple configuration backends. Because the router builds on top of the existing Application, you can reuse FastAPI-style handlers, middleware, and dependency injection with zero duplication.

Handler Parameter Binding

Handlers can type-hint any of the following and the application resolves them automatically:

Parameter type Injection source
ServerRequestInterface Full PSR-7 request instance
Scalar/int/float/bool Route parameter with implicit casting
array $body Parsed JSON or form body
array $query Query parameters
Any class name Service container entry or auto-instantiated class
ResponseFactory Convenience factory for JSON/text helpers

If a parameter cannot be resolved and lacks a default value, an exception is thrown to highlight configuration issues early.

Dependency Injection

Middleware

Implement MiddlewareInterface (PSR-15 style) or reuse existing classes.

Response Handling

Your handler may return:

You can create responses manually with ResponseFactory:

Working with Requests

Running & Emitting Responses

$app->run() returns the generated response by default and also emits it (headers + body). To take control of the emission (useful in testing pipelines) set emit: false:

Testing

Create ServerRequest instances manually and pass them to run():

Roadmap

Contributing

  1. Fork the repository and create a topic branch.
  2. Run composer install followed by composer test (when available).
  3. Submit a pull request with a concise description of your changes and any relevant tests.

Please open an issue if you encounter bugs or have feature requests.


All versions of php-easy-http with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 jacksonsr451/php-easy-http contains the following files

Loading the files please wait ...