Download the PHP package zeus/pusher without Composer

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

Socket Channels

This is a socket library, it is an advanced library, the purpose of which is to subscribe to channels on the socket and send messages to channels, as well as leaving channels...

for install

Socket Server Management

We manage the entire socket server with an object inherited from the AbstractSocketClientHandler object... In the example below, it is the ClientHandler object, but this is entirely up to your wishes. Let's, For example, let's send the message to everyone.

server.php

Run in the Terminal

js websocket code

Works with the wildcard

You can use wildcard in channel management. Here, the join method is subscribing to the channel, at the same time, you can use the leave method to cancel the subscription to the channel, you can subscribe to the channels and receive notifications, in fact, the main logic is like a real scenario and if we want to give up notifications to the channels, we use the leave method, that's all.

Additionally, there are more methods besides methods such as hasJoin, join and leave,this is purely for managing channels well...

In the example below, we subscribe to it.backend and it.frontend channels and the beginning is it. We send notifications to all channels that start, the purpose here is to group the channels.

First of all, we use the $this->getClient() method to get the connected client...

Clients of a channel

You can get all the clients subscribed to a channel for example by default, all clients are subscribed to the channel named public.

You can receive all channels in the system and attract clients connected to these channels and perform transactions.

Some methods for the channel, but don't forget there are more

note: leave method does not support wildcard for now. it will not working,I thought this was not appropriate due to its completely irreversible effects

Works with the json

Let's subscribe to the channels with the json coming from the frontend and send messages to the channels. js code

This example subscribes to the channel according to the json data coming from the clients and sends the message to the subscribed channel.

In the frontend

In the Backend

The client

The php client does not listen to the socket, so what is the purpose?

It allows sending messages to connected connections. You can even make this client compatible with the API and send messages to language-independent sockets.

This code forwards the message to the connected server and closes the connection. In this way, it provides incredible flexibility, you can even create an API socket server, yes, it sounds nice, doesn't it?

Send a custom message

You can send a message to a special client, for example, let's send a message only to the currently connected client.

Send a message by socket id

The socket ID can be used to send a custom message. Below is an example of sending a message to a specific socket ID. A feature designed especially for sending personal messages.

Websocket routes

You can create a namespace using js websocket and route path, below are examples of js and php codes.

javascript websocket

is Route and hasRoute methods

  1. hasRoute: Is there any client connecting via /chat route?.

  2. isRoute: Is the current client connected via the /chat route?.

The host address of the client

Let's disconnect the socket connection of an ip address
You can get the host or IP address of the connected client. In this way, you can deny an IP address, for example, let's disconnect a client whose IP value is x.x.x.x.

Get the status of the client

You can get any client status

For more information

Now, if you want to add Channel Broadcast and Send classes, there is a way to do this. For example, let's create a method for Send and use it.

If you pay attention, the 'test' and 'empty' methods do not actually exist, we simulated them as if they existed.

to be continued...
[|||||||||||||||]


All versions of pusher with dependencies

PHP Build Version
Package Version
Requires ext-sockets Version *
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 zeus/pusher contains the following files

Loading the files please wait ....