Download the PHP package ljhsmileking/laravel-gateway-worker without Composer

On this page you can find all versions of the php package ljhsmileking/laravel-gateway-worker. 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 laravel-gateway-worker

中文

Laravel GatewayWorker

In order to use GatewayWorker more elegantly in Laravel, I developed this extension based on GatewayWorker to make it ready to use.

Installation

Configuration

Laravel

  1. Register the ServiceProvider and Facade in config/app.php (For Laravel 5.5 and above, no manual registration is required)

  2. Publish the configuration file:

  3. Modify the corresponding configurations in config/gateway-worker.php located in the application root directory.

Lumen

Lumen has not been used or tested, the following instructions are based on other extension package development.

  1. In bootstrap/app.php around line 82:

  2. Publish the config/gateway-worker.php configuration file by copying it from vendor/smileymrking/laravel-gateway-worker/config/gateway-worker.php to the project_root/config directory.

The configuration file already has a default websocket service named 'push', you can adjust the relevant configurations accordingly, or directly proceed to the next step to start the service.

Starting the service

Use the following command to start the service: php artisan gateway-worker {serviceName} {action} {--d}

Parameter Description
serviceName Service name, which is the key name in the configuration file.
action Action command, available commands are status, start, stop, restart, reload, connections.
--d Use DAEMON mode.

'push' is the default service name that was created, you can synchronize the configuration file and modify the relevant configurations as needed.

Creating Multiple Services

You can start multiple services simultaneously.

Adding a new service

Directly copy a duplicate of the 'push' configuration file and make the necessary modifications, paying attention to updating the 'worker_name', 'gateway_name', and related port configurations to avoid duplication. The key used in the configuration will be the service name.

After completing the configuration modifications, use the php artisan gateway-worker demo start command to start the service, where 'demo' is the key name you configured.

Custom Event Handler

When 'event_handler' is not configured, it will use the SmileyMrKing\GatewayWorker\GatewayWorker\GatewayWorkerEvents class, which implements the static methods 'onMessage', 'onConnect', and 'onClose'. You can customize the 'event_handler' class by inheriting from SmileyMrKing\GatewayWorker\GatewayWorker\GatewayWorkerEvents and overriding the relevant static methods.

The 'default_service' configuration specifies which service's registration address Gateway::$registerAddress will connect to by default.

Message Pushing

You can directly use the \GatewayWorker\Lib\Gateway class in GatewayWorker. For specific usage, please refer to the GatewayWorker manual.

Viewing Logs

The logs and PID files are located in the vendor/smileymrking/laravel-gateway-worker/src/GatewayWorker/worker directory. You can customize the log and PID paths using the pid_file and log_file settings in the configuration.

References

License

MIT


All versions of laravel-gateway-worker with dependencies

PHP Build Version
Package Version
Requires illuminate/console Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.18|^7.0|^8.0|^9.0|^10.0
illuminate/support Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.18|^7.0|^8.0|^9.0|^10.0
workerman/gateway-worker Version ^3.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 ljhsmileking/laravel-gateway-worker contains the following files

Loading the files please wait ....