Download the PHP package decodelabs/archetype without Composer

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

Archetype

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

Simple named library loader for PHP

Archetype provides a generic frontend to resolving implementation classes for a named interface with an extensible plugin architechture.

Get news and updates on the DecodeLabs blog.


Installation

Install via Composer:

Usage

Importing

Archetype uses Veneer to provide a unified frontage under DecodeLabs\Archetype. You can access all the primary functionality via this static frontage without compromising testing and dependency injection.

Functionality

Use Archetype when designing plugin oriented libraries that need to load arbitrary extension classes based on a naming convention.

By mapping names to classes in an extensible and customisable resolver structure, Archetype allows fast and reliable means to create loosely coupled plugin ecosystems.

Example:

Resolvers

Archetype uses a hierarchy of Resolvers to turn a name into a class. By default, the Handler will fall back on a Resolver\Generic instance that simply locates the named class within the namespace of the associated interface.

In the above example, the implementations of the My\Library\Thing can be found at My\Library\Thing\*.

Custom resolvers

The Resolver\Archetype implementation however will also automatically look for custom Resolver classes in the same location as the target interface, named \<Interface>Archetype.

The following example will replace the default functionality and cause Archetype to look in a different location for the Thing implementations:

Multiple resolvers

Multiple Resolver instances can be stacked against a single interface, called in series based on the priority they request, the first one to return a non-null class name wins.

Alternative Resolvers can be loaded with:

File lookup

Resolvers that also implement the Finder interface can define the means to lookup a file path based on the provided name, against the space defined by the target interface.

This can be useful when the space that is defined by the root interface may contain assets aside from PHP code.

It is down to the implementation to decide how to map names to file paths (there are no pre-built default Finder classes).

Example:

Licensing

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


All versions of archetype with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
decodelabs/exceptional Version ^0.4
decodelabs/glitch-support Version ^0.4
decodelabs/veneer Version ^0.10.10
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/archetype contains the following files

Loading the files please wait ....