PHPackages                             camcima/pubnub-php-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. camcima/pubnub-php-api

Abandoned → [pubnub/pubnub](/?search=pubnub%2Fpubnub)Library[API Development](/categories/api)

camcima/pubnub-php-api
======================

Composer port of PubNub PHP API

210.0k1PHP

Since Nov 4Pushed 9y ago3 watchersCompare

[ Source](https://github.com/camcima/pubnub-php-api)[ Packagist](https://packagist.org/packages/camcima/pubnub-php-api)[ RSS](/packages/camcima-pubnub-php-api/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Deprecated. Please use
======================================================

[](#deprecated-please-use-httpsgithubcompubnubphp)

\###YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API. ###

PubNub 3.3 Real-time Cloud Push API - PHP
-----------------------------------------

[](#pubnub-33-real-time-cloud-push-api---php)

[www.pubnub.com](http://www.pubnub.com) - PubNub Real-time Push Service in the Cloud.

### PubNub is a Massively Scalable Real-time Service for Web and Mobile Games.

[](#pubnub-is-a-massively-scalable-real-time-service-for-web-and-mobile-games)

### This is a cloud-based service for broadcasting Real-time messages

[](#this-is-a-cloud-based-service-for-broadcasting-real-time-messages)

### to thousands of web and mobile clients simultaneously.

[](#to-thousands-of-web-and-mobile-clients-simultaneously)

PHP Push API
------------

[](#php-push-api)

```
$pubnub = new Pubnub(
    "demo",  ## PUBLISH_KEY
    "demo",  ## SUBSCRIBE_KEY
    "",      ## SECRET_KEY
    false    ## SSL_ON?
);
```

Send Message (PUBLISH)
----------------------

[](#send-message-publish)

```
$info = $pubnub->publish(array(
    'channel' => 'hello_world', ## REQUIRED Channel to Send
    'message' => 'Hey World!'   ## REQUIRED Message String/Array
));
print_r($info);
```

Request Messages (HISTORY, deprecated, use detailedHistory() below)
-------------------------------------------------------------------

[](#request-messages-history-deprecated-use-detailedhistory-below)

```
$messages = $pubnub->history(array(
    'channel' => 'hello_world',  ## REQUIRED Channel to Send
    'limit'   => 100             ## OPTIONAL Limit Number of Messages
));
print_r($messages);             ## Prints array of messages.
```

Request Server Time (TIME)
--------------------------

[](#request-server-time-time)

```
$timestamp = $pubnub->time();
var_dump($timestamp);            ## Prints integer timestamp.
```

Receive Message (SUBSCRIBE) PHP 5.2.0
-------------------------------------

[](#receive-message-subscribe-php-520)

```
$pubnub->subscribe(array(
    'channel'  => 'hello_world',        ## REQUIRED Channel to Listen
    'callback' => create_function(      ## REQUIRED PHP 5.2.0 Method
        '$message',
        'var_dump($message); return true;'
    )
));
```

Receive Message (SUBSCRIBE) PHP 5.3.0
-------------------------------------

[](#receive-message-subscribe-php-530)

```
$pubnub->subscribe(array(
    'channel'  => 'hello_world',        ## REQUIRED Channel to Listen
    'callback' => function($message) {  ## REQUIRED Callback With Response
        var_dump($message);  ## Print Message
        return true;         ## Keep listening (return false to stop)
    }
));
```

Realtime Join/Leave Events (Presence)
-------------------------------------

[](#realtime-joinleave-events-presence)

```
$pubnub->presence(array(
    'channel'  => $channel,
    'callback' => function($message) {
        print_r($message);
		echo "\r\n";
        return true;
    }
));
```

On-demand Occupancy Status (here\_now)
--------------------------------------

[](#on-demand-occupancy-status-here_now)

```
$here_now = $pubnub->here_now(array(
    'channel' => $channel
));
```

Detailed History (detailedHistory())
------------------------------------

[](#detailed-history-detailedhistory)

```
$history = $pubnub->detailedHistory(array(
    'channel' => $channel,
    'count'   => 10,
    'end'   => "13466530169226760"
));
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2eaa5b60f348374bc31196550d67414883a51bbc097af538716eb2471a9ce49?d=identicon)[camcima](/maintainers/camcima)

---

Top Contributors

[![camcima](https://avatars.githubusercontent.com/u/1918601?v=4)](https://github.com/camcima "camcima (2 commits)")

### Embed Badge

![Health badge](/badges/camcima-pubnub-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/camcima-pubnub-php-api/health.svg)](https://phpackages.com/packages/camcima-pubnub-php-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k13](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
