Download the PHP package phptars/tars-server without Composer

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

Tars-server documentation

Package name: phptars / tar server

Tars is the underlying dependency of PHP server.

How to use

Tars-server uses composer for package management. Developers only need to install composer according to the corresponding version.

For specific usage, please refer to HTTP server, timer server and TCP server under the corresponding PHP / examples.

Frame description

Tars-server is based on the bottom layer of the swoole network transceiver. The framework mainly includes the following directories:

CMD layer

For the CMD layer, it now contains the following files:

  1. Command.php:

Responsible for specifying the configuration file and start command when the service starts

  1. CommandBase

It specifies the implementation necessary for a command. All such as start are subclasses of commandbase. Getprocess method is provided to get the currently started service process.

  1. Restart

Restart the command, only call the start after the call stops

  1. Start

When you start the command, you will first parse the configuration issued by the platform, and then import the services.php file necessary for the business.

Next, monitor whether the process has been started to avoid repeated start-up;

Finally, the configured and predefined swooletable will be passed to the server for service initialization and startup.

  1. Stop

The current service stop mode is violent. It will pull out all processes according to the service name, and then kill them. In the future, reload will be introduced to reload the service code.

Core layer

The core layer is mainly composed of event, server, request and response.

  1. Server.php

Be responsible for the initialization of services before startup, including:

After starting the service, you will first enter onmaster start:

onManagerStart:

Next is onworkerstart:

Ontask: submit the appName servername servantname of the service.

You need to pay attention to onReceive and onrequest callbacks respectively.

For the server of TCP, pay attention to onReceive:

For HTTP servers, focus on onrequest:

  1. Event.php

OnReceive method:

Onrequest method:

  1. Request.php

Store some necessary request data;

Set and remove global variables

  1. Response.php

Responsible for some work of returning package

Service startup process

The start of the whole service is initiated by start under CMD,

After that, we call the creation of the Server object.

Then, initialize swoole in turn,

After starting the service, you only need to process the onReceive or onrequest listening

Framework dependency

The framework relies on the following packages:

Changelog

v0.7.0(2021-03-17)

v0.6.0(2020-07-07)

v0.5.0(2020-09-08)

v0.4.0(2019-07-16)

-Support for protobuf

v0.3.1(2019-06-21)

-Support for multiple servants

-Using swoole addListener as the underlying support

-Support one service to deploy multiple objs, using the tars or HTTP protocol respectively

-Adjust the format of services.php to return a two-dimensional array with objname as the key.

-Protocolname, servertype, istimer are not read from the private template, they need to be specified in services.php

-Fix support for websocket by multi servant

v0.2.4(2019-03-20)

-Format code according to PSR rules

-Fix bugs in code

-Support custom master cache

-Open access to swoole objects


All versions of tars-server with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
phptars/tars-utils Version ~0.3
phptars/tars-client Version ~0.2
phptars/tars-report Version ~0.1
phptars/tars-config Version ~0.1
phptars/tars-monitor Version ~0.2
phptars/tars-log Version ~0.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 phptars/tars-server contains the following files

Loading the files please wait ....