Download the PHP package quillstack/parameter-bag without Composer

On this page you can find all versions of the php package quillstack/parameter-bag. 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 parameter-bag

Quillstack Parameter Bag

Tests Latest Version Downloads PHP Version StyleCI CodeFactor Quality Gate Coverage Maintainability Reliability Security Maintainability License

Simple key-value storage. Full documentation: https://quillstack.org/parameter-bag

The bag the rest of the stack keeps things in: query parameters, cookies, server variables, a parsed body. A missing key answers with the default rather than a warning, which is what reading from a request needs.

Why this exists

A request arrives carrying five bags of values — the server parameters, the query string, the cookies, the uploaded files, the parsed body — and every one of them is a place where reading a key that is not there should give you what you asked for rather than a notice and a null.

That is all this is: a read-only bag with a default. It is separate from the request because the request is not the only thing that has one, and because a class that holds values should not need a PSR-7 message around it to be tested.

Requirements

Installation

Usage

set() hands the bag back, so several can be written in one go:

Where it is used

quillstack/server-request keeps every part of a request in one: $_SERVER, $_COOKIE, $_GET, $_FILES and the parsed body are each a bag, so reading a key that was not sent is an answer rather than a notice.

Technical documentation

Method Does
__construct(array $parameters = []) starts with what it is given
get(string $name, mixed $default = null): mixed the value, or the default
set(string $name, mixed $value): self writes one, and hands the bag back
has(string $name): bool whether there is one under that name
remove(string $name): bool takes one out; false where there was none
all(): array everything in it

This is a mutable bag on purpose: a request is built up before it is handled, and copying it for every parameter would cost more than it is worth. The PSR-7 objects around it are the ones which are immutable.

Benchmark

Measured with quillstack/benchmark on a thousand bags of five values, each built and read twice — once for a key that is there and once for a key that is not. Runs are interleaved and unconcurrent, each figure is the median of five, and PHP is 8.5.7.

Version
quillstack/parameter-bag 0.6.0
symfony/http-foundation v7.4.17
Per bag Relative
quillstack/parameter-bag 0.19 µs —
symfony/http-foundation 0.26 µs 1.4×

Seventy nanoseconds is not a result. Both are an array with a get() in front of it, and a request builds five of them — a third of a microsecond, once. This table exists because the standard for these READMEs asks for one, and the honest thing it has to say is that there is nothing here to choose on.

Symfony's bag does more: it filters values, counts, iterates, and has typed getters that throw on the wrong shape. It also arrives inside symfony/http-foundation, which is 768 kB. This is one class.

Tests

The rest of Quillstack

This is one component of Quillstack, a PHP framework which is as simple to use as it is strict about what it does.

License

MIT. See LICENSE.


All versions of parameter-bag with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 quillstack/parameter-bag contains the following files

Loading the files please wait ...