Download the PHP package inpassor/realplexor without Composer

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

Realplexor PHP API

Latest Stable Version Total Downloads License

Author: Inpassor [email protected]

GitHub repository: https://github.com/Inpassor/realplexor

This library implements Dklab_Realplexor PHP API.

Dklab_Realplexor is comet server which handles 1000000+ parallel browser connections.

Installation

Usage

Create some class which uses the trait RealplexorAPI:

Create the instance of this class (which uses the trait RealplexorAPI):

Then use it:

Public Properties

Property Type Description
host string The server host. Default: '127.0.0.1'
port integer The connection port. Default: 10010
namespace string Namespace to use. Default: ''
login string Login for connection (if the server need it). Default: ''
password string Password for connection (if the server need it). Default: ''
timeout integer The connection timeout, in seconds. Default: 5
charset integer Charset used in Content-Type for JSON and other responses. Default: 'UTF-8'
lastError string Last error message, if error occured.

Public methods

Method Description
send() Send data to Realplexor.
cmdOnlineWithCounters() Return list of online IDs (keys) and number of online browsers for each ID ("online" means "connected just now", it is very approximate).
cmdOnline() Return list of online IDs.
cmdWatch() Return all Realplexor events (e.g. ID offline/offline changes) happened after $fromPos cursor.

Protected methods

Method Description
_addNamespace() Add the namespace to ID prefixes.
_cutNamespace() Cut off the namespace from ID.
_sendCmd() Send IN command.
_send() Send specified data to IN channel. Return response data.

Method Details

public function send($idsAndCursors, $data, $showOnlyForIds = null)

Send data to Realplexor.

Parameter Type Description
$idsAndCursors mixed Target IDs in form of: [id1 => cursor1, id2 => cursor2, ...] or [id1, id2, id3, ...]. If sending to a single ID, you may pass it as a plain string, not array.
$data mixed Data to be sent (any format, e.g. nested arrays are OK).
$showOnlyForIds array Send this message to only those who also listen any of these IDs. This parameter may be used to limit the visibility to a closed number of cliens: give each client an unique ID and enumerate client IDs in $showOnlyForIds to not to send messages to others.
return boolean True on success, false on fail. Check $this->lastError for error message if false returned.

public function cmdOnlineWithCounters($idPrefixes = [])

Return list of online IDs (keys) and number of online browsers for each ID ("online" means "connected just now", it is very approximate).

Parameter Type Description
$idPrefixes string|array If set, only online IDs with these prefixes are returned.
return array List of matched online IDs (keys) and online counters (values). Check $this->lastError for error message if empty array returned.

public function cmdOnline($idPrefixes = [])

Return list of online IDs.

Parameter Type Description
$idPrefixes string|array If set, only online IDs with these prefixes are returned.
return array List of matched online IDs. Check $this->lastError for error message if empty array returned.

public function cmdWatch($fromPos, $idPrefixes = [])

Return all Realplexor events (e.g. ID offline/offline changes) happened after $fromPos cursor.

Parameter Type Description
$fromPos string Start watching from this cursor.
$idPrefixes string|array Watch only changes of IDs with these prefixes.
return array List of ["event" => ..., "cursor" => ..., "id" => ...]. Check $this->lastError for error message if empty array returned.

protected function _addNamespace($idPrefixes)

Add the namespace to ID prefixes.

Parameter Type Description
$idPrefixes string|array ID prefixes without namespace.
return string ID prefixes with namespace.

protected function _cutNamespace($id)

Cut off the namespace from ID.

Parameter Type Description
$id string ID with namespace.
return string ID without namespace.

protected function _sendCmd($cmd)

Send IN command.

Parameter Type Description
$cmd string Command to send.
return string|null Server IN response. Check $this->lastError for error message if null returned.

protected function _send($identifier, $body)

Send specified data to IN channel. Return response data.

Parameter Type Description
$identifier string If set, pass this identifier string.
$body string Data to be sent.
return string|null Response from IN line. Check $this->lastError for error message if null returned.

Client-side

To implement Realplexor client-side feel free to use bower package inpassor-jquery-realplexor


All versions of realplexor with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 inpassor/realplexor contains the following files

Loading the files please wait ....