GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bakame-php/http-structured-fields: Structured Field Values for HTTP manipulation in PHP

BranchesTags
Open more actions menu

Latest commit

 

History

488 Commits
488 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
src
src
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.php-cs-fixer.php
.php-cs-fixer.php
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 
phpbench.json
phpbench.json
 
 
phpstan.neon
phpstan.neon
 
 
phpunit.xml
phpunit.xml
 
 

Repository files navigation

HTTPsf

HTTP Structured Fields for PHP

Author Software License Build Latest Version Total Downloads Sponsor development of this project

bakame/http-structured-fields is a framework-agnostic PHP library that allows you to parse, serialize, create, update and validate HTTP Structured Fields in PHP according to the RFC9651.

Once installed you will be able to do the following:

use Bakame\Http\StructuredFields\OuterList;

//1 - parsing an Accept Header
$fieldValue = 'text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8';
$container = OuterList::fromRfc9651($fieldValue);
$container[1]->value()->toString(); // returns 'application/xhtml+xml'
$container[1]->parameterByKey(key: 'q', default: 1.0); // returns 1.0 if the parameter is not defined

System Requirements

PHP >= 8.1 is required but the latest stable version of PHP is recommended.

Installation

Use composer:

composer require bakame/http-structured-fields

Documentation

Full documentation can be found at https://bakame-php.github.io/http-structured-fields

Contributing

Contributions are welcome and will be fully credited. Please see CONTRIBUTING and CODE OF CONDUCT for details.

Testing

The library:

  • has a PHPUnit test suite
  • has a coding style compliance test suite using PHP CS Fixer.
  • has a code analysis compliance test suite using PHPStan.
  • is compliant with the language agnostic HTTP Structured Fields Test suite.

To run the tests, run the following command from the project folder.

composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

  • ignace nyamagana butera
  • All Contributors

Attribution

The package internal parser is heavily inspired by previous work done by Gapple on Structured Field Values for PHP.

License

The MIT License (MIT). Please see License File for more information.

About

Structured Field Values for HTTP manipulation in PHP

bakame-php.github.io/http-structured-fields/

Topics

httphttp-headersparse-headersphprfcrfc8941rfc9651structured-fieldsstructured-headersstructured-trailers

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

47 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.