Download the PHP package bfg/puller without Composer

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

Puller (Long Pull)

Total Downloads

Install

composer require bfg/puller

In a nutshell

This package is intended for cases when you need a minimum real time, but to raise the WebSocket too expensive or meaningless. The essence of the package is the simplest Long Pull, which is easy to install and configure. It added control over the user's tabs, which allows us to control the status of all the user tabs and send commands to all the user tabs at all, to all browsers. So, we have an excellent opportunity to follow the online meter and a real-time list of users.

Redis

Be careful, the package uses the default caching system by default, with the driver that is listed there, but if you switch the caching driver to redis, then you will feel a significant increase in speed and get a better and accurate task distribution system and online.

To do this, you should have the extension Redis for php.

Usage

In order to start using, you need to make a couple of simple things:

  1. Make sure that in your public/vendor folder published puller/puller.js. He had to appear immediately after installing the package, as it broads publications in the laravel-assets group. If this did not happen and you did not appear there, publish it manually:

  2. Connect the script in your document:

  3. Prepare your own document event listener:

  4. Submit the Puller command:

Further, in the browser, in the developer console, you will see the reaction.

Advanced puller

If you want the main processing and data from receiving data on the side of the task recipient, you must use that advanced Pullers, since the handle method is always performed on the recipient side.

Generate worker:

After that, you will have a class worker: app/Pulls/MyTestPull.php

What will be described in the Handle method will be performed on the client side when the task is performed. And the fact that this method will return, will be sent as the details of the event. The event name will be generated automatically or you can specify the protected ?string $name = "my_name"; property.

Prepare your own document event listener:

The name of the class-based event will be generated in snake_case, MyTestPull will turn into a my_test_pull.

Submit the Puller worker:

Further, in the browser, in the developer console, you will see the reaction.

Another example with the designer

app/Pulls/SayHelloPull.php

"stream" Dispatch to everyone tabs of selected user

Current authorized user So will always be installed by default, it is simply indicated by an example of a user transmission, you can pass as a model there and the identifier.

"flux" Dispatch to everyone online user

"flow" Dispatch to current tab (if exists)

"totab" Dispatch to selected tab

Create class with dot

Well be generated dark_mode.toggle name

Puller events

UserOnlineEvent

An event that triggers if the user appeared online.

UserOfflineEvent

The event that triggers in the case when the user is lost.

TestListenNewTab

An event that triggers in the case when the user opens a new tab.

Attention! If you reboot a tab, offline and online events will not work, since in fact you stay online if you need an event for each page load, understand that every time you restart the page it is believed that you create a new tab.

TestListenNewTab

The event that triggers in the case when the user closes the tab.

Puller facade

Get current process tab (read from header 'Puller-KeepAlive')

Create new anonymous task

Create new anonymous task with channel

Number of users online

List of users online

Is online user

List of user identifiers online

Short Event listener setters

Model watching

You can use helpers for listeners of model events.

The report will be sent to the user the identifier of which is called in this column that you indicated in the property $owner_field (may be an array with a list of several columns).

Move Zone

The area of liability movement, if the zone will be released inside the zone, the zone will fix it and posts the call to the mass control queue, and the general call may already delegate the type of shipment. Thus, we have mass control over tasks.

JavaScript

You have a globally registered Puller object that is intended for external control.

Messaging

Messages - this is a mechanism for performing tasks in a stream that distributes tasks to the current execution request and on the connections.

In order to use the messaging mechanism you should know the minimum data type specification.

What is a message on backend?

Message is a signed request for an event. What to transmit the names of the events and at the same time not to transmit its full range of names, the system is looking for nesting in any space that is compiled depending on your security guard, the default is web So your nesting prefix will be the next WebMessage And all created and declared Events and will cause them consistently if there will be several events in one name.

Event search occurs on the following pattern:

Send name: my-event or my;

Called Event: *\WebMessage\MyEvent

Send name: actions:my-event or actions:my;

Called Event: *\WebMessageActions\MyEvent

* - Maybe any value.

All events Puller send from such an event will be inserted in response to the request and the task will be distributed to what a service station can be processed now and what needs to be sent to others.

All transmitted values in the message will be added as a form to request.

View all events that can handle a message:

Plugins

Livewire support

https://github.com/bfg-s/puller-livewire

Alpine support

https://github.com/bfg-s/puller-alpine

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


All versions of puller with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
laravel/framework Version ^8.0|^9.0|^10.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 bfg/puller contains the following files

Loading the files please wait ....