Download the PHP package farmatholin/segment-io-bundle without Composer
On this page you can find all versions of the php package farmatholin/segment-io-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download farmatholin/segment-io-bundle
More information about farmatholin/segment-io-bundle
Files in farmatholin/segment-io-bundle
Package segment-io-bundle
Short Description Segment.io php lib
License MIT
Homepage http://github.com/farmatholin/SegmentIoBundle
Informations about the package segment-io-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":"^1.3"
Step 2: Enable the bundle in the kernel (Symfony < 3.4)
<?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:
Symfony 4.X || 5.X || 6.X :
Symfony 2.X || 3.X
Data Residency
Segment allows the usage of regional infrastructure. If your
Segment plan supports this, you can set the data_residency
option to either Oregon
, Dublin
, Singapore
or
Sydney
. If you set the option.host
value, the data_residency
setting is ignored and the host
option is used.
Usage
Get segment_io.analytics
service from the service container and start using it:
Or using Annotations (Page and Track)
User for annotations is getting from TokenStorage.
If user doesn't exit, id set to guest
or from configuration 'guest_id'
Or using dependency injection:
Refer to Segment.io analytics-php library.
All versions of segment-io-bundle with dependencies
segmentio/analytics-php Version ^3.5
psr/log Version ^1.0
symfony/config Version >= 2.7
symfony/dependency-injection Version >= 2.7
symfony/http-kernel Version >= 2.7
symfony/security-core Version >= 2.7