Download the PHP package archict/brick without Composer

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

Archict/Brick

Tests

To build something, you need bricks

Base library of Archict framework

What is a Brick?

A Brick is the base component of Archict. It consists on a collection of Services which can have a Event.

How to create a Brick?

In technical terms, a Brick is a composer package with the archict-brick type. The easiest way to create your own Brick is to use our template.

If you bring a look at the composer.json content, you can see this line:

This line is super mega important, it's the one telling to Archict that your package is a Brick. Without it, your Services will never be loaded.

You also need to depend on this package to have all the necessary classes to create your Brick.

Services

Creating a Service is pretty straight forward, just put the attribute Service on your class:

One of the feature you can have with Services, is dependencies injection. Your Service can depend on some other Services (from other Bricks for example). For that, just add them in your constructor and Archict will inject them just for you.

Services configuration

Sometimes, you need your Service to be configurable by another developer. For that you can give them configuration file. For that you need to do several things.

First you need to create a data class which store the configuration variables:

Please note that only public members will be considered as part of the configuration.

Then specify to your Service it can use this class as configuration (instance of your configuration can also be injected in the Service constructor):

Finally, provide a default config file (in YAML format) in the config folder at the root of your package. This file will be used as default config unless another config file is provided to Archict. By default, the file is named with your Service class name lowercased (myservice.yml), you can change this behavior by specifying the filename:

Events

To bring some life to your Services, they can listen to Events and even dispatch some.

Listening to an Event is pretty easy, just add the ListeningEvent attribute to a public method of your Service. Archict will know which Event you are listening by getting the argument type of the method (so you can name your method as you want):

Dispatching an Event need some steps. First you need to have an Event class:

Then add the package archict/core to your dependencies. It contains the Service EventDispatcher which is necessary to dispatch an Event. You can now use it in your Service to dispatch your Event.

How to use Bricks?

For that, let's go see Archict/core.


All versions of brick with dependencies

PHP Build Version
Package Version
Requires php Version >= 8.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 archict/brick contains the following files

Loading the files please wait ....