Download the PHP package t4web/infrastructure without Composer

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

Infrastructure

Master: Build Status codecov.io Scrutinizer Code Quality SensioLabsInsight Dependency Status

Infrastructure layer for Domain, implementation by t4web\domain-interface

Contents

Installation

Add this project in your composer.json:

Now tell composer to download Domain by running the command:

Quick start

You can use Repository with Domain implementation t4web\domain. This implementation build on Zend\Db and Zend\EventManager

Components

Build criteria from array

You can use CriteriaFactory::build() for building criteria from array (for example: from input filter, post\get request)

$inputData must be structured like this:

where ATTRIBUTE - criteria field, METHOD - one of equalTo, notEqualTo, lessThan, greaterThan, greaterThanOrEqualTo, lessThanOrEqualTo, like, in

for isNull, isNotNull use

where TRUE_EXPRESSION can be any true expression: true, 1, 'a' etc.

for between use array as value

for limit, offset use

for order use SQL-like order expression

Custom criteria - grouping and reusing criteria

Users\User\Criteria\Active - must be invokable class (__invoke(CriteriaInterface $criteria, $value))

Configuring

For configuring Repository you must specify config, and use Config object for parsing config. QueryBuilder use Config for building SQL query.

relations argument order - very important, Task['relations']['User'][0] - must be field from current entity, Task['relations']['User'][1] - must be field from related entity.

For many-to-many relation related entity must contain 3 arguments. For example we have table tasks (see config), table tags with fields id, name and table tasks_tags_link with fields task_id and tag_id. For relation Task <=> Tag we must describe many-to-many relation: Task['relations']['Tag'][0] - link-table name, Task['relations']['Tag'][1] - field PK current entity in link-table and Task['relations']['Tag'][2] - field PK in related entity in link-table.

Events

Repository rise events when entity created or updated.

Where REPOSITORY_IDENTIFIER - depends from entity, builds: EntityName\Infrastructure\Repository
ENTITY_CLASS - get_class() from you $enity object

Now Repository can rise:


All versions of infrastructure with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
zendframework/zend-db Version <2.6 >=2.4
zendframework/zend-eventmanager Version <2.6 >=2.4
t4web/domain-interface Version ~1.1.0
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 t4web/infrastructure contains the following files

Loading the files please wait ....