PHPackages                             stanislav-web/sonar - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. stanislav-web/sonar

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

stanislav-web/sonar
===================

Sonar is the site visitors monitor. Build in Phalcon &amp; MongoDb. Conducts monitoring of visitors, using the WebSockets connection. Great for sites built on REST technology. You can easily integrate this package to track detailed information about your visitors. Check the time on each page of the site, determine device, geo location.

v1.2.2-alpha(10y ago)917MITPHPPHP &gt;=5.5.0

Since Sep 20Pushed 10y ago3 watchersCompare

[ Source](https://github.com/stanislav-web/PhalconSonar)[ Packagist](https://packagist.org/packages/stanislav-web/sonar)[ Docs](https://github.com/stanislav-web/sonar)[ RSS](/packages/stanislav-web-sonar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (7)Used By (0)

Sonar v1.2.2-alpha
==================

[](#sonar-v122-alpha)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5753713eeb3ebdc806d4dd472741928e0e004e99f22d2595c4a8c89a4179c4c1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7374616e69736c61762d7765622f5068616c636f6e536f6e61722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/stanislav-web/PhalconSonar/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/481b3b99f1b545feb43f132635c591373d7e32f572dbe80a01e0e8a77442df44/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7374616e69736c61762d7765622f5068616c636f6e536f6e61722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/stanislav-web/PhalconSonar/?branch=master) [![Build Status](https://camo.githubusercontent.com/82c82ee0f90f89a35b716d5990a74ceecbce4f65a1243f87fb4dacbb81b89b77/68747470733a2f2f7472617669732d63692e6f72672f7374616e69736c61762d7765622f5068616c636f6e536f6e61722e737667)](https://travis-ci.org/stanislav-web/PhalconSonar)

[![Latest Stable Version](https://camo.githubusercontent.com/7ec13cd00f0ef70c465412972ba74cd1f2d9b4ada4a202446d7588b17e070ee9/68747470733a2f2f706f7365722e707567782e6f72672f7374616e69736c61762d7765622f736f6e61722f762f737461626c65)](https://packagist.org/packages/stanislav-web/sonar) [![Total Downloads](https://camo.githubusercontent.com/acb0f618f45a38e9b7836d80fd04fe4de654dece7b1b371209ffac219fdeed9c/68747470733a2f2f706f7365722e707567782e6f72672f7374616e69736c61762d7765622f736f6e61722f646f776e6c6f616473)](https://packagist.org/packages/stanislav-web/sonar) [![Latest Unstable Version](https://camo.githubusercontent.com/04b5d666dd657a6f76e59eac724fb036daa2f5b1eec7a986d9d27688c891e7cb/68747470733a2f2f706f7365722e707567782e6f72672f7374616e69736c61762d7765622f736f6e61722f762f756e737461626c65)](https://packagist.org/packages/stanislav-web/sonar) [![License](https://camo.githubusercontent.com/f0d06aa456b559497eed0a01c41c30b8fa2b175931b1b4973546e96b32b440e5/68747470733a2f2f706f7365722e707567782e6f72672f7374616e69736c61762d7765622f736f6e61722f6c6963656e7365)](https://packagist.org/packages/stanislav-web/sonar)

Sonar is the site visitors monitor. Build in Phalcon &amp; MongoDb. Conducts monitoring of visitors, using the WebSockets connection. Great for sites built on REST technology. You can easily integrate this package to track detailed information about your visitors. Check the time on each page of the site, determine device, geo location.

ChangeLog
---------

[](#changelog)

#### \[v1.2.2-alpha\] 2015-09-27

[](#v122-alpha-2015-09-27)

```
- add debugger (show verbose in config)
- change cache session (to shared memory)

```

#### \[v1.2-alpha\] 2015-09-22

[](#v12-alpha-2015-09-22)

```
- configurable error log
- add cache session (memcache)
- silent error logger (warnings & noticies)

```

#### \[v1.1-alpha\] 2015-09-21

[](#v11-alpha-2015-09-21)

```
- implementing geo location detector

```

#### \[v1.0-alpha\] 2015-09-20

[](#v10-alpha-2015-09-20)

```
- the first version of package
- socket application named as "Sonar"
- implemented:
    - tracking user's page position
    - tracking user's page timing activity
    - tracking user's device (phone, table, pc)
    - tracking the time of each page

```

Compatible
----------

[](#compatible)

- PSR-1, PSR-2, PSR-4 Standards

System requirements
-------------------

[](#system-requirements)

- PHP 5.5 or higher
- Phalcon PHP extension 1.3.4 (support 2.x)
- PHP MongoDb client extension
- Beanstalk queue server

Installation
------------

[](#installation)

First update your dependencies through composer. Add to your composer.json:

```
"require": {
    "stanislav-web/sonar": "dev-master",
}
```

Then run to update dependency and autoloader

```
php composer.phar update
php composer.phar install
```

or just

```
php composer.phar require stanislav-web/sonar dev-master

```

*(Do not forget to include the composer autoloader)*

Configuration
-------------

[](#configuration)

This package have a variety of settings, both mandatory and optional.

1. You can select them in the global app configuration file of your Phalcon project if you will be making their to global application config. See example:

```
    // CLI task's configuration (required)

    'cli' => [

        // Sonar task configuration
        'sonar' =>  [
            'debug'     =>   true,  // verbose mode
            'errors'    =>   true,  // add errors to logfile
            'cache'     =>   true,  // enable cache
            'errorLog'  =>   APP_PATH.'/../logs/sonar-error.log',

            // queue client configurations
            'beanstalk'        =>  [
                'host'  =>  '127.0.0.1',
                'port'  =>  11300,
            ],

            // webscoket server configuration
            'socket'        =>  [
                'host'  =>  '127.0.0.1',
                'port'  =>  9003,
            ],

            // db storage configuration (Mongo)
            'storage'       =>  [
                'host'      =>  '127.0.0.1',
                'port'      =>  27017,
                'user'      =>  'root',
                'password'  =>  'root',
                'dbname'    =>  'sonar',
            ]
        ]
    ];
```

2. Register task in your Phalcon CLI autoloader:

```
    $loader = new \Phalcon\Loader();
    $loader->registerDirs([
        ...
        DOCUMENT_ROOT.'vendor/stanislav-web/sonar/src/Sonar/System/Tasks'
        ...
    ]);
```

3. Running socket server using CLI from your project. And tracking user thought web interface *(not yet implemented)*:

```
php public/cli.php sonar

```

*(examples of client connect you can see [here](https://github.com/stanislav-web/PhalconSonar/tree/master/examples))*

Unit Test
---------

[](#unit-test)

Also available in /phpunit directory. Run command to start

```
// Create mongo user
mongo

use sonar_test

db.createUser({
        user: "test_user",
        pwd: "test_password",
        roles: [ { role: "userAdmin", db: "sonar_test" } ]
    }
)
```

```
phpunit --configuration phpunit.xml.dist --coverage-text

or from your project root:

phpunit --configuration ./vendor/stanislav-web/sonar/phpunit.xml.dist --coverage-text
```

In Future
---------

[](#in-future)

- More examples
- Output working

Documents
---------

[](#documents)

- [Phalcon Queueing](http://docs.phalconphp.com/ru/latest/index.html)
- [PHP MongoDb client](http://php.net/manual/ru/mongo.core.php)
- [Asynchronous WebSocket server](http://socketo.me/)
- [Mobile Detect](http://mobiledetect.net/)

\##[Issues](https://github.com/stanislav-web/PhalconSonar "Issues")

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Every ~2 days

Total

4

Last Release

3887d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4e51c2294dda0762398bb53f1ec5525fc38b08a6eb03f149448b5eea501d0fd?d=identicon)[stanislav-web](/maintainers/stanislav-web)

---

Top Contributors

[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")

---

Tags

site visitorsite visitor grabberusers monitorphalcon mongomongo visitors grabbersite visitor monitorphalcon monitorphalcon statistics

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stanislav-web-sonar/health.svg)

```
[![Health](https://phpackages.com/badges/stanislav-web-sonar/health.svg)](https://phpackages.com/packages/stanislav-web-sonar)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[open-telemetry/api

API for OpenTelemetry PHP.

1933.0M214](/packages/open-telemetry-api)

PHPackages © 2026

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