Download the PHP package ruima/microservice-tool without Composer

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

Ruima Microserver Framework base on Lumen

Description

This is a microserver framework that make it easy to build a microserver API server. The gateway will cache the user auth info (base info, roles info, premissions info) in redis.

What did this package do?

Dependencies

Installation via Composer

Or if you prefer, edit composer.json manually:

Starting The Scheduler

You need to add the following Cron entry to your server.

Modify the service environment ( file)

For Microservice:

For Auth Microservice:

You need to add APP_KEY

For Gateway:

Modify the bootstrap flow ( file)

For Microservice:

For Gateway:

Installed routes

For Microservice:

Verb Path Controller Action
GET /health-check \Ruima\MicroserviceTool\Controllers\SalverController healthCheck
GET /heart-beat \Ruima\MicroserviceTool\Controllers\SalverController heartBeat

For Gateway:

Verb Path Controller Action
GET /health-check \Ruima\MicroserviceTool\Controllers\MasterController healthCheck
GET /heart-beat-check \Ruima\MicroserviceTool\Controllers\MasterController heartBeatCheck
GET /registe-microserver \Ruima\MicroserviceTool\Controllers\MasterController healthCheck
POST /distroy-auth \Ruima\MicroserviceTool\Controllers\MasterController registerMicroserver
DELETE /health-check \Ruima\MicroserviceTool\Controllers\MasterController distroyAuthToken
GET {path:.*} \Ruima\MicroserviceTool\Controllers\MasterController distribute
POST {path:.*} \Ruima\MicroserviceTool\Controllers\MasterController distribute
PUT {path:.*} \Ruima\MicroserviceTool\Controllers\MasterController distribute
PATCH {path:.*} \Ruima\MicroserviceTool\Controllers\MasterController distribute
DELETE {path:.*} \Ruima\MicroserviceTool\Controllers\MasterController distribute
OPTIONS {path:.*} \Ruima\MicroserviceTool\Controllers\MasterController distribute

Installed schedules & commandsdules

For Microservice:

Cycle Command Description
5MIN microserver:heart-beat send the microservice info to gateway

For Gateway:

Cycle Command Description
5MIN microserver:heart-beat-check check the info in gateway

Installed methods

For Microservice:

For Gateway:

Destribute request to target microservice

Follow this rule:

.e.g There is a microservice which the MICROSERVICE_NAME in .env is "micro-auth", and it have a route GET/auth-info.When send a request use the following url, gateway will handle this automatically.

Use Authorization In Microservice

In Auth microservice

You need to add a route "GET/auth-info", return a json format user auth info. when other microservice need the auth info, gate way will seed a http request with token in GET method to "/auth-info", then the gateway wiil use the last 64 bits of the token as the key to cache the response in redis. When auth info changed, you need to send a request "POST/distroy-auth" with body { short_token (the last 64 bits of the token) } to gateway. if short_token = "all", the gateway will clear all cache.

In api router:

The suggest user auth info format:

In Other microservice

Use middleware auth in your route

In Route

In Controller

Use middleware permission in your route

When using permission middle, it will use auth middleware automatically. and check the \Array $request->auth['permissions'] have the right permissin or not. In the case of multiple permissions, as long as user have one permission, it will pass the permission check.


All versions of microservice-tool with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
guzzlehttp/guzzle Version ^6.3
illuminate/redis Version ^5.8
laravel/lumen-framework Version ^5.8
predis/predis Version ^1.1
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 ruima/microservice-tool contains the following files

Loading the files please wait ....