PHPackages                             raulpmk-post-hawk/hawk-api-bundle - 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. raulpmk-post-hawk/hawk-api-bundle

ActiveSymfony-bundle[API Development](/categories/api)

raulpmk-post-hawk/hawk-api-bundle
=================================

Bundle for symfony based on post hawk api

1.0.3(9y ago)010MITJavaScriptPHP ~5.5|~7.0

Since May 11Pushed 6y agoCompare

[ Source](https://github.com/RAULpmk/HawkApiBundle)[ Packagist](https://packagist.org/packages/raulpmk-post-hawk/hawk-api-bundle)[ Docs](https://github.com/postHawk/HawkApiBundle)[ RSS](/packages/raulpmk-post-hawk-hawk-api-bundle/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

HawkApiBundle
=============

[](#hawkapibundle)

bundle for symfony based on post hawk api

\###Установка:

```
composer require post-hawk/hawk-api-bundle dev-master
```

Для windows:

```
cd path/to/project
mklink /J web\bundles\hawkapi vendor\post-hawk\hawk-api\Resources\public\
```

Для unix:

```
cd path/to/project
ln -s web\bundles\hawkapi vendor\post-hawk\hawk-api\Resources\public\
```

\###Кофигурация:

```
//app/AppKernel.php
$bundles = array(
	...
    new Hawk\ApiBundle\HawkApiBundle(),
);
```

```
#app/config/config.yml
hawk_api:
    client:
        host: client_addres #ip или домен
        port: 7777 #порт, который слушает клиент
        key: 'ваш апи ключ'
```

```
#app/config/routing.yml
hawk:
    resource: '@HawkApiBundle/Controller/'
    prefix:   /hawk
```

```

```

\###Использование

```
$api = $this->get('hawk_api.api')->getApi();
$api
    ->registerUser($id)
    ->getToken($id, $this->getApi()->getSalt())
    ->execute()
    ->getResult('getToken')
;
```

или так:

```
$msg = new Message();
$msg
	->setFrom('mail_demon')
	->setTo($this->getUser())
	->setText(['msg' => 'test'])
	->setEvent('new_push')
;

$gMessage = new GroupMessage();
$gMessage
	->setFrom('mail_demon')
	->setGroups(['groups'])
	->setText(['msg' => 'test'])
	->setEvent('event')
;

$this
	->container
	->get('event_dispatcher')
	->dispatch(Message::NEW_MESSAGE, $msg)
	->getResult() //HawkApi
	->getResult('sendMessage')
;

$this
	->container
	->get('event_dispatcher')
	->dispatch(GroupMessage::NEW_MESSAGE, $gMessage)
	->getResult() //HawkApi
	->getResult('sendGroupMessage')
;
```

```
$.post(Routing.generate('hawk_token'), {}, function (data) {
    if(data.errors === false)
    {
        HAWK_API.init({
            user_id: data.result.id,
            token: data.result.token,
            url: data.result.ws,
            debug: true
        });

        HAWK_API.unbind_handler('new_push');
        HAWK_API.bind_handler('new_push', function(e, msg){
            if(msg.from === 'hawk_client')
            {
                return;
            }

            //делаем что-нибудь
        });
    }
    else
    {
        if(data.errors !== 'no_user')
        {
            console.error(data.errors);
        }
    }
});
```

Про методы, доступные для использования вы можете прочесть в [документации](https://github.com/postHawk/hawk_api/wiki)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 94.1% 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.

###  Release Activity

Cadence

Every ~25 days

Total

4

Last Release

3577d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/799cca29783d02c59b4a4c08dec08bbc94d855173dc7ff46bf4f456a27c91acb?d=identicon)[RAULpmk](/maintainers/RAULpmk)

---

Top Contributors

[![postHawk](https://avatars.githubusercontent.com/u/18420226?v=4)](https://github.com/postHawk "postHawk (32 commits)")[![RAULpmk](https://avatars.githubusercontent.com/u/1812857?v=4)](https://github.com/RAULpmk "RAULpmk (2 commits)")

---

Tags

apipost hawk

### Embed Badge

![Health badge](/badges/raulpmk-post-hawk-hawk-api-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/raulpmk-post-hawk-hawk-api-bundle/health.svg)](https://phpackages.com/packages/raulpmk-post-hawk-hawk-api-bundle)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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