Download the PHP package conceptsandtraining/ente without Composer

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

Build Status

ente.php

An entity component framework for ILIAS.

Contact: Richard Klees

Model

Entity component model or system is an architectural pattern developed for and mostly used in games. Still, the problems solved with that pattern are discovered in other situations, i.e. the development of interconnected functionality in ILIAS.

The general problem that is solved could be described as such: One has a system with some (or often a lot of) entities in it. An entity can be understood as an object that has an identity and exhibits some continuity over time and space. Within the system, there are a lot of subsystems that act upon these entities.

Example: In a real time strategy game, entities would be units of the armies in the game as well as objects in the landscape and maybe other things. Systems acting upon these objects would be e.g. a physics system, a path finding system, a sound system, ...

Example: In ILIAS an entity could basically be identified with all descendants of ilObject although there are possibly more things that could be called entities, e.g. questions in the test. Systems acting upon these entities would then e.g. be the RBAC system, the Learning Progress System, the Tree/Repository, ...

Implementing that kind of system with inheritance could lead to some problems that could also be observed in ILIAS:

Entity component model solves these problems by employing the principle to "favour composition over inheritance". The entities on their own are understood to just supply the required identity and continuity, i.e. each entity is basically an id. Components that serve the needs of different subsystems can then be attached to the entity to make them take part in that system.

Example: A entity in the RTS game could be extended with a "physics" component that knows a location and other physical metrics of the entity to make it appear on the playground.

Example: The implementation of the learning progress in ILIAS actually follows that model. Instead of providing some interface that all ilObjects with learning progress need to implement, one needs to build a separate object that takes care of the learning progress of the original ilObject.

This pattern for solving the described problem has some virtues over the naive inheritance based approach:

There are definetly also disadvantages in using the entity component model. For the sake of the argument they are not written down here. Finding them is left as an exercise to the reader.

Implementation

This implementation is meant to work in the context of ILIAS, where Plugins should be able to define components for ilObjects. This library therefore knows four kinds of objects, where the according interfaces could be found in the base directory of the lib:

A simple implementation (without ILIAS) can be found in src/Simple. It defines two Components AttachInt and AttachString that both have one *Memory implementation.

An ILIAS based implementation can be found in src/ILIAS. It contains two more noteworthy objects, that act as a plumbing between the simple model presented above and the factual ILIAS world.

The usage of both facilities is showcased in two examples.

Example

The example folder contains two plugins, one that provides a component, one that uses handles the provided component. Note that both plugins do not know each other. Their common denominator is this library and the AttachString component they both use. Both plugins try to showcase this framework only and are no good showcases for general plugin development!

The AttachString component is a very dumb component that allows to attach a string to an entity. We most probably won't use such a simple component in a real world problem.

To check out what the plugins are doing, copy both of them to the directory for RepositoryPlugins in an ilias installation, composer install them and activate them within ILIAS. You should be provided with two new types of repo objects: Component Handler Example and Component Provider Example. Create a course and an object for each plugin within the course.

First open the Provider-object. You should get a simple form where you can add multiple strings the object will provide via the AttachString component. Do that now (and don't forget to save the form). Then open the Handler-object. You should see a simple listing of all strings you added to the provider. You can also add some more providers to the course. The handler will collect the strings from all providers. You could of course also add some more handlers, but they won't differ from your first one.

Now have a look at how the provider object is implemented. One thing the plugin needs to implement is an instance of UnboundProvider. This can be found in example/ComponentProviderExample/classes/UnboundProvider.php. This class needs to tell which components it intents to provide via componentTypes and needs to present a way how instance of these components can be created via buildComponentsOf.

The UnboundProvider has an owner-ilObject, which is used to get the provided strings from the ILIAS-database. The component interface AttachString is used for the declaration in componentTypes, but buildComponentOf uses the in-memory implementation AttachStringMemory to create the actual components.

The provider object needs to define when an UnboundProvider is actually created and the object starts to provide components for some other object. This is done on creation of the object in example/ComponentProviderExample/classes/class.ilObjComponentProviderExample.php. The trait ilProviderObjectHelper helps to easily implement that creation. The object needs to provide a DIC via getDIC and then may createUnboundProvider whenever it needs to. To do that, it needs to tell for which objects on its path it wants to provide components for (crs in the example), what the name of the UnboundProvider is and where the according implementation can be found. The object also needs to take care that the UnboundProviders it created gets destroyed afterwards, which is done via deleteUnboundProviders on object deletion.

The handler object is even simple. In example/ComponentHandlerExample/classes/class.ilObjComponentHandlerExample.php you can see the according implementation for the handler. It uses the ilHandlerObjectHelper trait and also needs to provide a DIC via getDIC. It also needs to provide the ref_id of an object it intends to handle components for. We just use the parent in the example. It then can use getComponentsOfType to get all components provided for its object and do further processing on them.


All versions of ente with dependencies

PHP Build Version
Package Version
No informations.
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 conceptsandtraining/ente contains the following files

Loading the files please wait ....