Download the PHP package decodelabs/kingdom without Composer

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

Kingdom

PHP from Packagist Latest Version Total Downloads GitHub Workflow Status PHPStan License

Service container management system

Kingdom provides a set of simple but powerful interfaces for building structures that can contain your whole application logic and services.


Installation

This package requires PHP 8.4 or higher.

Install via Composer:

Usage

Kingdom works in tandem with Monarch to give developers an easy way to manage dependency injection, application containment, service access and more.

An implementation of the Kingdom interface can be considered the root of your application in which all other services are contained. A project can have multiple Kingdom instances which are in turn controlled by the static Monarch class. Only one Kingdom instance can be considered active at a time.

You can think of Monarch and Kingdom in a similar way to how you would think of a monarch and a kingdom in real life - the monarch rules over the kingdom and the kingdom has a boundary around it, isolating it from the outside world.

You shouldn't need to interact with the monarch for many things as the kingdom should be able to provide most of the resources that are needed; only bother the monarch when you have to!

Container

The heart of a Kingdom is its container. Instead of dealing directly with PSR-11 containers which only provide a rudimentary access scheme, Kingdom uses an adapter system that allows implementations to create a richer and more powerful service access mechanism.

Pandora implements both the PSR-11 interface and Kingdom's ContainerAdapter interface, allowing it to function directly as a service container for Kingdom without any additional configuration.

If you are building your application on top of Fabric, a Kingdom implementation is provided for you using Pandora as the container by default.

See the ContainerAdapter interface for more information on the methods available.

Services

Items held within the container can implement the Service interface to set them apart from other items in the container. The interface requires the implementation of a method to provide an instance of the service based on the contents on the container. A default implementation is provided in the ServiceTrait trait.

Services can be accessed in a Kingdom instance using the getService method.

However, because a Kingdom is intended to be isolated and managed by the Monarch package, it is recommended to use the Monarch::getService method instead, which will delegate to the active Kingdom instance.

The active Kingdom instance should be registered with Monarch during your bootstrap process. If you use Genesis for your bootstrapping, this will be taken care of for you, otherwise:

Runtime

Once a Kingdom has been initialized, it's main purpose is to run the application. This is determined by an instance of the Runtime interface, which acts like a kernel for your application.

There are default implementations of HTTP and CLI runtimes provided by Harvest and Clip respectively.

Once bootstrapped, run your application:

Past this point, the container and service structure should be used to auto-wire the loading process with automatic dependency injection when constructing objects and services.

This can generally be handled in your own libraries by using Slingshot, or in a pinch, using Monarch::getService().

Fabric

When using Kingdom in a Fabric application, you can use your Kingdom implementation as the place to set up your application's container and services.

Licensing

Kingdom is licensed under the MIT License. See LICENSE for the full license text.


All versions of kingdom with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
psr/container Version ^2.0.2
decodelabs/exceptional Version ^0.6.3
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 decodelabs/kingdom contains the following files

Loading the files please wait ...