PHPackages                             ligboy/gcmhttp - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ligboy/gcmhttp

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ligboy/gcmhttp
==============

the GCM HTTP connection server library with PHP

010PHP

Since Jun 26Pushed 12y ago1 watchersCompare

[ Source](https://github.com/ligboy/GcmHttp-php)[ Packagist](https://packagist.org/packages/ligboy/gcmhttp)[ RSS](/packages/ligboy-gcmhttp/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

GcmHttp-php
===========

[](#gcmhttp-php)

其实已经有很多gcm php的库了，之所以重复造轮子，只是为了更好的适应国内gfw的屏蔽，方便添加代理。另外大家可以把GcmHttp::SEND改为我自己的一个反向代理（加州sf机房）: `http://gcm.ligboy.org/gcm/send` ,这样可以不用代理发送消息。当然我不敢完全保证100%可用性。

在发送消息上可以处理发送超过1000 registration\_ids的消息，最大的限制，嘿嘿，需要你世界测试了。原理是先将registration\_ids分割为不超过1000的二维数组，再使用curl\_multi发送请求，最后在合并结果。

当消息接受registration\_ids不超过1000时是使用curl发送。

### Usage:

[](#usage)

```
$api_key = 'AIzaSyDak0uMFHzLPhzkSiqVGRZ_U0vi62-RoAQ';
//$proxy = 'www.proxy.com:1080';
$proxy = null;

$gcm = new GcmHttp($api_key, $proxy);
$registration_ids = array('APA91bHddL9SxCzfVB6KFaWcXdvBEncgaplqZfgfTzneOEX0gLmyAtwAlHaw8hWqKNxO8Fx0d10DMNlu0VbV4r2eSk9kEzQxeYiLy1N2iIgEG1jtEN-gx0CDNt4N4bMaH8J0aHcz8TSycnqjMmUiDw757FpGmNvx43taXt7o3gei1p_o');
$data = array(
    'test' => 'dfsdfasdf',
    'name' => 'dfsdfsdfsdfsdfsdf',
    't' => time()
);
$result = $gcm->send($registration_ids, $data);
```

#### LICENSE

[](#license)

The MIT License (MIT)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

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://avatars.githubusercontent.com/u/2030499?v=4)[Ligboy](/maintainers/ligboy)[@ligboy](https://github.com/ligboy)

---

Top Contributors

[![ligboy](https://avatars.githubusercontent.com/u/2030499?v=4)](https://github.com/ligboy "ligboy (10 commits)")

### Embed Badge

![Health badge](/badges/ligboy-gcmhttp/health.svg)

```
[![Health](https://phpackages.com/badges/ligboy-gcmhttp/health.svg)](https://phpackages.com/packages/ligboy-gcmhttp)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M90](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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