Download the PHP package quillstack/config without Composer

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

Quillstack Config

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

The package to organise a configuration in your application. Full documentation: https://quillstack.org/config

Configuration is written as classes rather than arrays in files, so a value has a place it is declared, a type, and something to jump to. Reading one is a single string: aws.token.current names the class first and the key inside it after.

Why this exists

Configuration in most PHP applications is arrays in files, read by string keys that nothing checks. A typo in config/aws.php is found when something is null at three in the morning.

Here a group of settings is a class, so the file is a class file, static analysis sees the array, and a rename is a rename rather than a silent miss. The provider says which classes exist and the reader walks into them by key. What is not there is the default you asked for, because configuration is read in places that have something better to do than catch.

Requirements

Installation

Usage

A configuration class

Extend Config and say what it holds:

Saying which classes there are

Reading

The first part names the class the provider listed; the rest walks into it, however deep it goes. Nothing found is the default rather than a failure, because configuration is read in places which have something better to do than catch.

Technical documentation

Class What it is
Config what a configuration class extends; holds protected array $config
Configuration reads a value out of whichever class the key names
ConfigInterface get(string $key, mixed $default = null): mixed
ConfigProviderInterface load(): array — the classes, keyed by the name they are addressed as

Config::DELIMITER is the dot. Config::get() is final: a configuration class says what it holds, not how it is read.

The classes are built through the container, so a configuration which needs something — an environment reader, a secret store — asks for it in the usual way.

Benchmark

Measured with quillstack/benchmark on two thousand reads — one key three levels deep and one that is not there — from the same settings. Runs are interleaved and unconcurrent, each figure is the median of five, and PHP is 8.5.7.

Version
quillstack/config 0.6.0
hassankhan/config 3.2.0
Per read Relative
hassankhan/config 0.11 µs 0.32×
quillstack/config 0.35 µs —

This one is three times slower and the reason is the design. hassankhan/config flattens everything into one array when it loads, so a read is a single lookup. This asks the container for the class named by the first part of the key and walks into it — which is what makes a group of settings a class that static analysis can see, and what costs the other quarter of a microsecond.

symfony/config is not in the table. It is a different tool: a builder for validating the shape of configuration, with a tree definition and a processor, rather than something you read a key out of at runtime. Comparing them on get() would be comparing two things that do not do the same job.

At a third of a microsecond, an application reading two hundred settings during a request spends seventy microseconds on it.

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 config with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
quillstack/di Version ^0.6
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/config contains the following files

Loading the files please wait ...