Developed with love by KnpLabs Hire us for your project!
0

SegmentIoBundle

by farmatholin

segment io integration bundle

Segment Io Bundle

Bundle include segment.io library for analytics

include segmentio/analytics-php

Documentation

The bulk of the documentation is stored in the Resources/doc folder in this bundle

Installation

Installing the bundle via packagist is the quickest and simplest method of installing the bundle. Here are the steps:

Step 1: Composer require

$ php composer.phar require "farmatholin/segment-io-bundle":"dev-master"

Step 2: Enable the bundle in the kernel

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Farmatholin\SegmentIoBundle\SegmentIoBundle(),
        // ...
    );
}

That's it! You are ready to use Segment.io with symfony2.

Configuration

Required segment write key:
```yml

SegmentIoBundle Configuration

app/config/config.yml

    segment_io:
        write_key: "%your_key%" #add your key
        env: prod #default prod. Can be prod (sending to segment) and dev (not sending)
        options:
            consumer: socket #default
            debug: false #default
            ssl: false #default
            max_queue_size: 10000 #default
            batch_size: 100 #default
            timeout: 0.5 #default
            filename: null #default

## Usage
Get `segment_io.analytics` service from the service container and start using it:

```php
$analytics = $this->get('segment_io.analytics');
$analytics->page()

Refer to Segment.io analytics-php library.

The MIT License (MIT)

Copyright (c) 2015 debesha

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
segment_io:
write_key: ~ # Required
env: prod
options:
consumer: socket
debug: false
ssl: false
max_queue_size: 10000
batch_size: 100
timeout: 0.5
filename: ~