Download the PHP package centrifugal/phpcent without Composer

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

phpcent

Build Status Latest Version

PHP library to communicate with Centrifugo v5 HTTP API (for Centrifugo v4 use phpcent v5.x, for Centrifugo v3 use phpcent v4.x).

Library is published on the Composer: https://packagist.org/packages/centrifugal/phpcent

See Centrifugo server API documentation.

Basic Usage:

You can use phpcent to create connection token (JWT):

Connection token that will be valid for 5 minutes:

It's also possible to generate channel subscription token:

It's also possible to generate channel subscription token with expiration time, for example token for 30 mins:

Also API key and secret can be set in constructor:

Timeouts:

All available API methods:

To use assoc option while decoding JSON in response:

SSL

In case if your Centrifugo server has invalid SSL certificate, you can use:

You can also use self signed certificate in safe manner:

Note: Certificate must match with host name in Client address (localhost in example above).

DNS Resolution

This error may indicate your system is having trouble resolving IPv6 addresses:

By default, both IPv4 and IPv6 addresses will attempt to be resolved. You can force it to only resolve IPv4 addresses with:

Testing

Requirements:

The provided PHPUnit tests assume that a local Centrifugo server is running and available at port 8000. This can be accomplished using Docker and the official Centrifugo image.

Authors


All versions of phpcent with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
ext-json Version *
ext-curl 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 centrifugal/phpcent contains the following files

Loading the files please wait ....