Download the PHP package milpa/http without Composer

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

Milpa

# Milpa HTTP > **PSR-15-native routing contracts** for the Milpa PHP framework, built on **`milpa/core`**. One immutable `Route` that is both the `#[Route]` attribute and the matched value; a router that turns a PSR-7 request into a typed `RouteResult` (matched / not-found / method-not-allowed) and never throws for a miss; and typed seams onto PSR-15 handlers and middleware. [![CI](https://github.com/getmilpa/http/actions/workflows/ci.yml/badge.svg)](https://github.com/getmilpa/http/actions/workflows/ci.yml) [![Packagist](https://img.shields.io/packagist/v/milpa/http.svg)](https://packagist.org/packages/milpa/http) [![PHP](https://img.shields.io/badge/php-%E2%89%A5%208.3-777bb4.svg)](https://www.php.net/) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) [![Docs](https://img.shields.io/badge/docs-API%20reference-blue.svg)](https://getmilpa.github.io/http/) `milpa/http` carries the contracts for Milpa's web tier — routing and its integration with PSR-15 middleware, and nothing else. It sits one layer above `milpa/core` and speaks the PHP-FIG standards directly: PSR-7 for the request, PSR-15 for handlers and middleware. **No kernel, no concrete router, no middleware runner** — just the typed seams everything binds to. ## Install ## What it is Milpa splits its surface into small, dependency-light contract packages. `milpa/core` holds the framework-agnostic heart; `milpa/http` adds the **web tier** on top. It is deliberately minimal: - **`HttpMethod`** — a typed verb enum (`isSafe()`, `isIdempotent()`). No `'GET|POST'` strings. - **`Route`** — one immutable value that is *also* the `#[Route]` attribute you put on a handler. Path, verbs, name, host, priority, defaults, and per-route middleware — the single source of truth used by both the declaration and the match. - **`RouterInterface`** — `match(ServerRequestInterface): RouteResult`. A pure function: it never throws for a miss and never builds a response. A 404 or 405 is an expected result. - **`RouteResult`** — the typed, never-null outcome (`MATCHED` / `NOT_FOUND` / `METHOD_NOT_ALLOWED`), built through named constructors so illegal states can't exist. - **`HandlerResolverInterface`** & **`MiddlewareResolverInterface`** — the two seams onto PSR-15: turn a matched route's `HandlerReference` into a live `RequestHandlerInterface`, and its per-route middleware `class-string`s into live `MiddlewareInterface`s. - **`UrlGeneratorInterface`** — reverse routing (name → URL) with a typed `UrlReferenceType`. **Be honest about scope:** this package ships the **contracts only**. It does not match requests, dispatch middleware, or boot a server by itself — it defines the seams a concrete web runtime implements. Templating and lifecycle events are *not* here: routing is a PSR-15 middleware pipeline, and the view layer is a separate tier. ## The shape Declare a route with the `#[Route]` attribute — it *is* a `Route`, repeatable on one method: A provider that declares a table by hand says each verb once, names the handler the way a controller is named, and declares its door once for the group — the constructor stays the canon and these produce the very same `Route` values: `HandlerReference::of()` accepts `[Controller::class, 'method']` and refuses anything else by shape, naming what it received. Only `get` and `post` exist, and only the pair is accepted: the other verbs and a bare `Controller::class` arrive with their first consumer. Match a PSR-7 request and branch on the typed status — no nulls, no exceptions for a miss: ## What's inside | Namespace | What it provides | |-----------|------------------| | `Milpa\Http` | `HttpMethod` — the typed HTTP-verb vocabulary | | `Milpa\Http\Routing` | `Route` (+ `#[Route]` attribute), `RouteResult`, `MatchStatus`, `HandlerReference`, `RouterInterface`, `HandlerResolverInterface`, `MiddlewareResolverInterface`, `UrlGeneratorInterface`, `UrlReferenceType` | | `Milpa\Http\Exceptions` | `RoutingExceptionInterface` (marker) + `RouteNotFoundException`, `MissingRouteParametersException` (reverse-routing only) | Every public symbol carries a DocBlock. A match miss is never an exception — it is `RouteResult::notFound()`; the exceptions are raised only by URL generation, where an unknown route name or a missing parameter is a bug in the caller. ## Requirements - PHP **≥ 8.3** - [`milpa/core`](https://packagist.org/packages/milpa/core) **^0.6** - [`psr/http-message`](https://packagist.org/packages/psr/http-message) **^2.0**, [`psr/http-server-handler`](https://packagist.org/packages/psr/http-server-handler) **^1.0**, [`psr/http-server-middleware`](https://packagist.org/packages/psr/http-server-middleware) **^1.0** ## Documentation **Full API reference: [getmilpa.github.io/http](https://getmilpa.github.io/http/)** — generated straight from the source DocBlocks and dressed with the Milpa design system. ## Contributing Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Please report security issues via [SECURITY.md](SECURITY.md), and note that this project follows a [Code of Conduct](CODE_OF_CONDUCT.md). ## License [Apache-2.0](LICENSE) © Rodrigo Vicente - TeamX Agency. --- Milpa is designed, built, and maintained by **[Rodrigo Vicente - TeamX Agency](https://teamx.agency/?utm_source=github&utm_medium=readme&utm_campaign=milpa&utm_content=http)**.

All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
milpa/core Version >=0.6.2 <1.0
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware 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 milpa/http contains the following files

Loading the files please wait ...