Download the PHP package philharmony/http-message without Composer

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

philharmony/http-message

Validate Analysis Test codecov PHP Version Latest Stable Version Total Downloads License

Strict, type-safe PSR-7 HTTP Message implementation for modern PHP (8.1+). Designed for maximum security, immutability, and seamless integration with modern PHP 8.1+ ecosystems.

πŸ“– Description

philharmony/http-message provides a robust, high-performance implementation of the PSR-7 HTTP Message interfaces. This package serves as the foundational messaging layer for the Philharmony framework, focusing on:

✨ Key Features

πŸ’‘ Why philharmony/http-message?

While many PSR-7 implementations focus on compatibility, philharmony/http-message focuses on:

πŸ“¦ Installation

Install via Composer:

⚑ Quick Start

A minimal example demonstrating the core PSR-7 objects provided by this package.

πŸš€ Usage: URI

Creating a URI

IPv6 and IDN Hosts

The URI implementation supports modern host formats including IPv6 and internationalized domain names.

Immutability in Action

As per PSR-7, Uri objects are immutable. Every modification returns a new instance. If the new value is identical to the current one, the same instance is returned for performance.

Advanced Encoding

The library automatically handles complex paths and query strings, ensuring they are RFC-compliant.

πŸš€ Usage: Stream

The Stream class provides a type-safe wrapper around PHP resources (fopen, php://memory, etc.).

Polymorphic Creation

The static create() method is highly flexible and accepts strings, resources, or existing streams:

Direct File Creation

Use Stream::createFromFile() to create a stream directly from a file path. This method handles file opening and error management automatically:

Key benefits:

Safe Operations

Unlike raw PHP functions, Stream ensures that system errors are handled gracefully:

Predictable Stream Behaviour

The Stream implementation ensures consistent and predictable behavior across different stream types.

These guarantees make the Stream implementation safe to use with memory streams, file streams, and custom PHP resources.

πŸ—οΈ Architecture: Base Message

All HTTP entities inherit from the abstract Message class, providing robust header management:

πŸš€ Usage: HTTP Messages (Request & Response)

Philharmony provides full implementations of PSR-7 HTTP message types:

All messages extend the base Message abstraction and follow a fully immutable design.

Request (Client Request)

The Request class represents an outgoing HTTP request typically used by HTTP clients.

Creating a Request

Smart HTTP Method Helpers

Philharmony provides helper methods powered by the HttpMethod enum.

ServerRequest (Server-Side Request)

ServerRequest extends Request and represents an incoming HTTP request received by the server.

It provides access to additional environment data such as:

Creating a ServerRequest

Parsed Body Helpers

The request body is automatically parsed depending on the Content-Type header.

Raw Body & Input Helpers

Convenience helpers allow retrieving input values from query parameters or parsed body data.

Lookup order:

  1. Query parameters
  2. Parsed request body

Response

The Response class automatically handles Reason Phrases using the Philharmony\Http\Enum\StatusCode.

πŸš€ Usage: Uploaded Files

Handle file uploads with full PSR-7 compatibility and support for modern PHP features like full_path (PHP 8.1+).

Upload Error Handling

Upload errors are represented internally by the UploadError enum.

πŸ” Technical Specifications

Feature Implementation
PHP Version 8.1 / 8.2 / 8.3 / 8.4
PSR Standards PSR-7 (HTTP Message Interfaces)
Static Analysis PHPStan Level 9 (Max Strictness)
Code Quality PSR-12, Strict Types, Clean Code
Dependencies psr/http-message, philharmony/http-enum

πŸ§ͺ Testing

The package is strictly tested with PHPUnit 10 to ensure full compliance with HTTP standards and RFCs.

Run Tests

Code Coverage

πŸ—οΈ Static Analysis & Code Style

Verified with PHPStan Level 9 to ensure total type safety and prevent runtime errors.

Check and fix code style (PSR-12):

πŸ“„ License

This package is open-source and licensed under the MIT License. See the LICENSE file for details.

🀝 Contributing

Contributions, issues, and feature requests are welcome.

If you find a bug or have an idea for improvement, please open an issue or submit a pull request.

⭐ Support

If you find this package useful, please consider giving it a star on GitHub. It helps the project grow and reach more developers.


All versions of http-message with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
philharmony/http-enum Version ^1.3
philharmony/http-psr-extension Version ^1.0
psr/http-message Version ^2.0.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 philharmony/http-message contains the following files

Loading the files please wait ...