Download the PHP package decodelabs/monarch without Composer

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

Monarch

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

A single shared source of truth for your PHP apps

Monarch provides a single shared source of truth for your PHP applications. It allow commonly referenced paths and items to be centralised into a predictable location, making it easier to manage accessing that data from code that needs to maintain minimal coupling to the rest of the application.

It acts as the top level oversight for your entire application space and acts as an orchestrator for your application's container and services within.

Monarch works in tandem with Kingdom - it manages the active Kingdom instance that in turn contains all of your application's services.


Installation

This package requires PHP 8.4 or higher.

Install via Composer:

Usage

Monarch should be populated in your bootstrap otherwise it will use reasonable defaults where possible. If you use Genesis to bootstrap your application, Monarch will be automatically populated for you.

For example:

Path aliasing

Monarch allows you to define aliases for commonly used paths. This is useful for avoiding hardcoded paths in your codebase. @root and @run are automatically defined for you, but you can define your own aliases as needed.

You can then use these aliases in your code:

Services

Monarch provides a simple way to access Kingdomservices from your application. Services must implement the Kingdom Service interface and may provide the ability to self-instantiate.

This method is a simple wrapper around the getService() method of the active Kingdom instance. It will only work if you supply an instance of the Kingdom interface in your bootstrap.

While this method is useful for quick access to services, it is not recommended for regular use as it is essentially an implementation of the Service Locator pattern. It works, but is inflexible and can lead to tight coupling between your code and the container.

Instead, the Kingdom instance provided to Monarch is also made available to Slingshot which can then be used to automatically inject services into your code.

Many common DecodeLabs libraries use Slingshot in their architecture and allow arbitrary constructor parameters to be handled seamlessly.

Licensing

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


All versions of monarch with dependencies

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

Loading the files please wait ...