initphp / http-factory
PSR17 HTTP Factory Library (DEPRECATED — merged into initphp/http:^2.2)
Requires
- php: >=7.4
- initphp/http: ^1.0
- psr/http-factory: ^1.0
README
⚠️ DEPRECATED — Use
initphp/httpinsteadAs part of the InitPHP package consolidation, this package has been merged into
initphp/httpstarting with version 2.2. The consolidated package ships its own PSR-17 factory under\InitPHP\HTTP\Factory\Factory.This repository is kept read-only for historical reference. No further updates will be released.
Why this package no longer works
\InitPHP\HTTPFactory\HTTPFactorywas written againstinitphp/http:^1.x, which used the flat\InitPHP\HTTP\*namespace. Ininitphp/http:^2.0those classes moved to\InitPHP\HTTP\Message\*, so this package'susestatements no longer resolve.Migration
- "initphp/http-factory": "^1.0", - "initphp/http": "^1.0", + "initphp/http": "^2.2"Your existing imports keep working:
initphp/http:^2.2ships aclass_aliasso\InitPHP\HTTPFactory\HTTPFactoryremains resolvable. Composer also declares areplacefor this package, so the two will not be installed side-by-side.When you next touch the code, prefer the canonical class:
// Before use InitPHP\HTTPFactory\HTTPFactory; $factory = new HTTPFactory(); // After use InitPHP\HTTP\Factory\Factory; $factory = new Factory();
PSR-17 HTTP Factory Library
Requirements
- PHP 7.4 or higher
- PSR-17 HTTP Factory Package
- InitPHP HTTP Library
Installation
composer require initphp/http-factory
Usage
require_once "vendor/autoload.php"; use InitPHP\HTTPFactory\HTTPFactory; $http = new HTTPFactory(); $request = $http->createRequest('GET', 'https://www.muhammetsafak.com.tr');
Credits
License
Copyright © 2022 MIT License