Download the PHP package pushinbr/pam-http without Composer

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

# PAM HTTP > **Mandatory build hygiene:** every local, CI, benchmark, and release build > must remove project-scoped regenerable outputs after success or failure. > Source, Composer dependencies, and declared evidence are retained. Native > consumers inherit PAM's Gradle/Xcode/Rust cleanup contract; this package never > deletes another package's artifacts or requires PAM Native. **Express-like routing. Laravel-like structure. PAM-native execution.** A typed HTTP application layer with routing, middleware, dependency injection, validation, resources, streaming, OpenAPI, and production lifecycle controls. [![Release](https://img.shields.io/github/v/release/push-in/pam-http?style=flat-square&label=stable)](https://github.com/push-in/pam-http/releases) [![CI](https://img.shields.io/github/actions/workflow/status/push-in/pam-http/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/push-in/pam-http/actions) ![PHP](https://img.shields.io/badge/PHP-8.5-777BB4?style=flat-square&logo=php&logoColor=white) ![License](https://img.shields.io/github/license/push-in/pam-http?style=flat-square) **[Documentation](https://push-in.github.io/pam-docs/packages/http/) · [Why this exists](#why-this-exists) · [What you can build](#what-you-can-build) · [Quick start](#quick-start) · [Issues](https://github.com/push-in/pam-http/issues)** [Performance contract](docs/PERFORMANCE.md): compiled hot paths and enforced throughput, tail-latency, startup, and memory budgets.

Why this exists

A typed HTTP application layer with routing, middleware, dependency injection, validation, resources, streaming, OpenAPI, and production lifecycle controls.

Role HTTP framework
Execution path Persistent PHP · PAM transport
This repository owns HTTP routing and application structure
Boundary PAM owns the runtime; databases and framework integrations stay optional

What you can build

Quick start

The PAM documentation covers prerequisites, production setup, and the complete workflow. PAM projects keep normal manifests and lockfiles; product features stay in the package that owns them.

Express-like routing. Laravel-like application structure. PAM-native execution.

Official documentation · PAM introduction · Changelog · Architecture · Report an issue

See it in action

Eloquent ORM (optional)

PAM HTTP keeps its kernel independent from any database. Install Eloquent only when the application needs the legacy built-in integration:

The integration keeps a separate connection manager per request Fiber, so connections, transactions and mutable database state cannot leak between persistent-worker requests.

Configure DB_CONNECTION (pgsql, mysql, sqlite or sqlsrv) and the usual DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD variables. PostgreSQL is the production default; SQLite is convenient for tests. Models are ordinary Illuminate\Database\Eloquent\Model classes.

Resolve EloquentManager when a service needs an explicit connection, schema builder or transaction. Request cleanup automatically rolls back unfinished transactions and disconnects every configured connection. Register DatabaseHealthCheck in a HealthRegistry for readiness checks; its result reports latency and failure class without exposing credentials.

Laravel-compatible anonymous-class migrations work through MigrationManager::migrate() and rollback(). The manager creates the migration repository on first use and supports dry-run execution, named connections and bounded step rollbacks.

Use QueryBudgetMiddleware during development and in performance-sensitive routes to cap query count, accumulated database time and repeated SQL patterns:

Budgets are Fiber-local. Violations use the sequential integer-backed QueryBudgetViolation enum, making them stable for CI reports and telemetry.

Tenant-owned models can be protected once during application boot:

The guard adds an Eloquent global scope and assigns the tenant key on create. It fails closed when no request-scoped TenantContext exists and rejects a model explicitly assigned to another tenant. Use an unguarded administrative model only for deliberate cross-tenant operations.

Route groups

Global, group and route middleware use the same PAM middleware contract.

head() and options() are available on both App and RouteRegistrar. When no explicit OPTIONS route exists, PAM returns 204 with a deterministic Allow header; every GET route automatically advertises and matches HEAD. PAM suppresses the final HEAD body after middleware and error handling while preserving its status and headers. An explicit OPTIONS or HEAD handler always takes precedence.

Router configuration is bounded before the application freezes: 10,000 routes by default (configurable up to 100,000), 2 KiB paths, 128 segments, 32 route parameters and 512-byte custom constraints. Compiled patterns carry PCRE match and depth budgets, and oversized untrusted request paths bypass PCRE entirely.

Container lifetimes

scoped values are created once per request and discarded even when the handler throws. This boundary is essential for PAM's persistent workers.

Typed configuration

Define configuration once and fail during boot when required environment is missing or malformed:

Supported types are represented by the sequential integer-backed ConfigType enum. Diagnostics should use $config->redacted(), which deterministically masks sensitive values. Validation errors name the variable and expected type without including its supplied value.

Validation and resources

Return a JsonResource from a handler to receive a consistent data envelope. Validation failures use Problem Details with stable sequential integer codes.

Problem Details

Routing failures, HttpException instances and unexpected exceptions use one safe Problem Details envelope with application/problem+json:

Exception details may add domain fields but cannot replace type, title, status or code. Unexpected exception messages are logged and never returned to the client. 405 responses retain their deterministic Allow header and use the sequential MethodNotAllowed=9 problem code.

Quality gate

The verification gate runs PHPStan at level 9 and the PHPUnit suite on every supported PHP version. It also compares all public classes, interfaces, enums, methods, parameters, properties and constants against api-surface.json:

The gate rejects unreviewed additions as baseline drift and rejects removed symbols/members, signature changes, new interface methods, newly abstract/final contracts and enum changes as incompatibilities. Run bin/api-compat update after approving a compatible public addition. A breaking baseline update is reserved for an intentional major version whose migration guide and changelog are ready.

The same reviewed baseline generates the complete public API reference. composer verify rejects stale reference output; regenerate it only after explicitly accepting compatible API additions:

See the PAM API 2 design and delivery contract for the complete 15-track implementation plan and current delivery status.

Distributed rate limiting

RateLimitMiddleware uses a bounded in-memory token bucket by default and accepts any RateLimitStore for process-wide or distributed enforcement:

The middleware emits limit/remaining/retry headers and a Problem Details 429 response. Applications behind proxies must supply a key resolver that trusts only their explicitly configured proxy boundary.

Signed bearer tokens

HmacTokenCodec provides a strict HS256 access-token foundation with bounded token/payload sizes, constant-time signature and issuer/audience checks, iat/nbf/exp validation, unique token IDs and abilities:

Set keyIdentifier on the active signing key and pass at most four retiring keys through verificationKeys for bounded zero-downtime rotation. Unknown kid values fail closed before claims are trusted. BearerTokenAuthenticator also accepts a TokenRevocationStore; MemoryTokenRevocationStore is bounded and intended for development/tests, while clustered applications should back the contract with an atomic shared store.

Signing secrets must contain at least 32 bytes and must not be stored in source control. Access tokens are capped at 24 hours. Refresh-token rotation, OAuth/OIDC authorization-server duties belong to the application or a dedicated identity provider; they must not be simulated with long-lived access tokens.

Production building blocks

PAM API exposes small, replaceable contracts instead of choosing application infrastructure:

Shared production state belongs in atomic Redis/database/broker adapters. The included memory stores are bounded and intended for development and tests.

JobQueue defines reservation leases, acknowledgement, delayed release and dead-letter transitions for durable adapters. The bounded memory implementation and JobWorker exercise the same at-least-once lifecycle in tests:

Attempts increment when a lease is reserved. Expired leases can be reclaimed; exceptions and explicit retry outcomes release the job with a bounded delay, and exhausted jobs enter the dead-letter set. Only failure class names are retained, never exception messages that may contain application data.

Cross-process adapters should encode only SerializableJob implementations through JobCodec. The codec uses an explicit name-to-class allowlist, a versioned JSON envelope, a 64 KiB size limit and a depth limit. It never accepts PHP serialized objects or client-supplied class names.

Request lifecycle observers

Register a RequestLifecycleObserver with $app->observe() to build profilers, traces and leak diagnostics around the complete request pipeline. Observers start in registration order and finish in reverse order, receive the handled failure when one occurred, and execute before the request scope is destroyed. An observer cleanup failure is logged and cannot prevent later observers or container cleanup from running.

MemoryProfiler is the bounded first PAM Lens collector. Enable it explicitly with ProfilerMode::Development or ProfilerMode::Testing and register it as an observer. It emits X-Debug-Token and stores only method, path, status, duration, memory delta and failure class; request/response bodies and headers are never retained. Disabled mode is the default and emits nothing.

OpenAPI and generated clients

CompatibilityChecker reports breaking path and operation removals using sequential integer codes.

In-memory testing

Use assertJson() for an exact payload, assertJsonPath() for a focused value, and assertStatus() when the endpoint intentionally returns a specific code.

Run composer benchmark for the standalone router benchmark. Its schema 1 JSON reports warmed static and constrained-dynamic throughput, p50/p95/p99 latency, peak memory and the exact regression budget. composer verify runs benchmark:check with intentionally conservative ceilings to catch severe regressions while avoiding hardware-specific marketing claims.

License

Free and open-source under the Apache License 2.0. You may use, modify, and distribute this package for any purpose, including commercially.

See SECURITY.md for private vulnerability reporting.

Recommended PAM workflow

Start new applications with pam init my-api --template api. In an existing PAM project, install the higher-level router with pam composer require pushinbr/pam-http; PAM runs Composer inside its private Embed SAPI.

Run pam doctor after dependency changes and before creating a release. The project remains a normal Composer project with a standard manifest, lockfile, PSR-4 autoloading, and vendor/autoload.php.

API guide

Surface Use it for
App Register routes, middleware, providers, error boundaries, and the listener.
Router Compile and match method/path routes with typed results.
Pipeline Execute middleware and the destination handler in order.
CorsMiddleware Apply explicit origin, method, and header policy.
RateLimitMiddleware Apply bounded per-key request limits.
SecurityHeadersMiddleware Set conservative browser security headers.

Route parameters are available through $request->route(). A path that exists for another method produces 405 behavior; an unknown path produces 404 behavior. Register error handling with onError() and keep transport-level timeouts and request limits in the PAM listener options.

Production checklist

Troubleshooting

Documentation and support

Report security vulnerabilities through GitHub private vulnerability reporting or the PAM security policy, not a public issue.


All versions of pam-http with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
pushinbr/pam-contracts Version ^1.1
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 pushinbr/pam-http contains the following files

Loading the files please wait ...