Download the PHP package mezon/service without Composer

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

Set of classes for creating microservices

Build Status codecov Scrutinizer Code Quality

Installation

Just type

First step

This is our first service.

Here:

Then you can access your first endpoint in a way like this:

Here is 'ping' is part afer 'action' in the 'actionPing'.

You can create longer endpoints:

And it will be available via this URL:

Introducing logic

In the concept of Mezon framework service class is only a container for logic, model, transport, security providerrs and so on.

So we may want to fetch all logic to the separate class. Then we shall do it in this way:

And then we shall modify service class like this:

But as you see - we have empty service class with only base functionality. So we can completely remove it and change our code:

Multyple logic classes

But you can split your functionality into several classes like in the next example:

Here you just pass several classes when creating service.

Complex routing

You can create more complex routes. To do this you have to setup them in the routes.json config of your service. The content of this file must looks like this:

And we need logic class for this route:

In this example the method userHeadComment handles routing processing. And this method receives array with routes parameters. Something like that:

But you can also store all route configs in PHP files like this:

Authentication

It is quite obvious that not all your endpoints will be public. Some of them should check credentials.

First of all you should understand that framework knows nothing about your registry of users and their permissions and roles. So you have to provide information about that.

Do it by implementing security provider like inthe listing below:

And our code will look like this:

And routes must be described like this:

Custom fields

You can extend your models with fields wich configuration will be defined in the client's code. For example you have entity 'user' with some custom fields. But you don't know what custom fields it will have. You don't know will it have field 'skype', or field 'notes', or field 'gender' etc. List of these fields may vary from project to project.

To work with such fields you can use \Mezon\Service\CustomFieldsModel

Table structure

tba

Methods reference

tba


All versions of service with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
mezon/custom-client Version 1.0.*
mezon/dns-client Version 1.0.*
mezon/fields-set Version 1.0.*
mezon/functional Version 1.1.*
mezon/http-request-params Version 1.0.*
mezon/infrastructure-layer Version >=1.2.6 <1.3.0
mezon/request Version >=1.0.6 <1.1.0
mezon/rest-exception Version 1.0.*
mezon/router Version 1.5.*
mezon/service-logic Version 1.3.*
mezon/service-transport Version 1.6.*
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 mezon/service contains the following files

Loading the files please wait ....