This commit is contained in:
Graham Campbell
2015-07-05 15:40:48 +01:00
parent 78567f865a
commit f74f44048d
5 changed files with 75 additions and 91 deletions

View File

@@ -10,7 +10,6 @@
*/
use CachetHQ\Cachet\Facades\Setting;
use CachetHQ\Segment\Facades\Segment;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Request;
use Jenssegers\Date\Date;
@@ -49,7 +48,7 @@ if (!function_exists('segment_identify')) {
if (Config::get('segment.write_key')) {
try {
if (Setting::get('app_track')) {
return Segment::identify([
return app('segment')->identify([
'anonymousId' => Config::get('app.key'),
'context' => [
'locale' => Config::get('app.locale'),
@@ -83,7 +82,7 @@ if (!function_exists('segment_track')) {
if (Config::get('segment.write_key')) {
try {
if (Setting::get('app_track')) {
return Segment::track([
return app('segment')->track([
'anonymousId' => Config::get('app.key'),
'event' => $event,
'properties' => $properties,
@@ -118,7 +117,7 @@ if (!function_exists('segment_page')) {
if (Config::get('segment.write_key')) {
try {
if (Setting::get('app_track')) {
return Segment::page([
return app('segment')->page([
'anonymousId' => Config::get('app.key'),
'name' => $page,
'context' => [

View File

@@ -20,8 +20,9 @@
],
"require": {
"php": "^5.5.9",
"laravel/framework": "~5.1.5",
"cachethq/segment": "^2.1",
"laravel/framework": "~5.1.6",
"alt-three/segment": "^1.0",
"barryvdh/laravel-cors": "^0.5",
"doctrine/dbal": "^2.5",
"fideloper/proxy": "^3.0",
"graham-campbell/binput": "^3.2",
@@ -33,8 +34,7 @@
"mccool/laravel-auto-presenter": "^3.1",
"pragmarx/google2fa": "^0.5",
"roumen/feed": "^2.9",
"watson/validating": "^1.0",
"barryvdh/laravel-cors": "^0.5"
"watson/validating": "^1.0"
},
"require-dev": {
"fzaninotto/faker": "^1.5",

133
composer.lock generated
View File

@@ -4,8 +4,72 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "3af6d8565449cdbb5163ebd1b19d867e",
"hash": "cdcde2f28caf5069f680a5e91360d069",
"packages": [
{
"name": "alt-three/segment",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/AltThree/Segment.git",
"reference": "f9a027dfc7c533982852e57eacf26d5267927006"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/AltThree/Segment/zipball/f9a027dfc7c533982852e57eacf26d5267927006",
"reference": "f9a027dfc7c533982852e57eacf26d5267927006",
"shasum": ""
},
"require": {
"illuminate/config": "5.1.*",
"illuminate/support": "5.1.*",
"php": ">=5.5.9",
"segmentio/analytics-php": "1.1.*"
},
"require-dev": {
"graham-campbell/testbench": "~3.0",
"phpunit/phpunit": "^4.7.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"AltThree\\Segment\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "James Brooks",
"email": "james@alt-three.com"
},
{
"name": "Graham Campbell",
"email": "graham@alt-three.com"
},
{
"name": "Joseph Cohen",
"email": "joe@alt-three.com"
}
],
"description": "A Segment Bridge For Laravel 5",
"keywords": [
"Alt Three",
"Bridge",
"api",
"segment",
"segment.com",
"segment.io"
],
"time": "2015-06-26 18:45:09"
},
{
"name": "asm89/stack-cors",
"version": "0.2.1",
@@ -98,73 +162,6 @@
],
"time": "2015-05-25 13:45:30"
},
{
"name": "cachethq/segment",
"version": "2.1.2",
"source": {
"type": "git",
"url": "https://github.com/cachethq/Laravel-Segment.git",
"reference": "d2643d346f2dca470de9dccd90d178215203067b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cachethq/Laravel-Segment/zipball/d2643d346f2dca470de9dccd90d178215203067b",
"reference": "d2643d346f2dca470de9dccd90d178215203067b",
"shasum": ""
},
"require": {
"illuminate/config": "5.0.*|5.1.*",
"illuminate/support": "5.0.*|5.1.*",
"php": ">=5.5.9",
"segmentio/analytics-php": "1.1.*"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"autoload": {
"psr-4": {
"CachetHQ\\Segment\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "James Brooks",
"email": "james@alt-three.com"
},
{
"name": "Graham Campbell",
"email": "graham@alt-three.com"
},
{
"name": "Joseph Cohen",
"email": "joe@alt-three.com"
}
],
"description": "Segment.com wrapper written for Laravel",
"keywords": [
"Cachet HQ",
"CachetHQ",
"Laravel Segment",
"api",
"cachet",
"framework",
"laravel",
"segment",
"segment.com",
"segment.io"
],
"time": "2015-06-27 13:39:51"
},
{
"name": "classpreloader/classpreloader",
"version": "2.0.0",

View File

@@ -149,6 +149,8 @@ return [
/*
* Packages Service Providers...
*/
'AltThree\Segment\SegmentServiceProvider',
'Barryvdh\Cors\CorsServiceProvider',
'Fideloper\Proxy\TrustedProxyServiceProvider',
'GrahamCampbell\Binput\BinputServiceProvider',
'GrahamCampbell\Exceptions\ExceptionsServiceProvider',
@@ -171,7 +173,6 @@ return [
'CachetHQ\Cachet\Providers\EventServiceProvider',
'CachetHQ\Cachet\Providers\RouteServiceProvider',
'CachetHQ\Cachet\Providers\SegmentServiceProvider',
'CachetHQ\Segment\SegmentServiceProvider',
],

View File

@@ -11,19 +11,6 @@
return [
/*
|--------------------------------------------------------------------------
| Enable Laravel Segment
|--------------------------------------------------------------------------
|
| This option specifies if Segment tracking is enabled.
|
| Default: true
|
*/
'enabled' => true,
/*
|--------------------------------------------------------------------------
| Segment Write Key
@@ -31,7 +18,7 @@ return [
|
| This option specifies key which enables you to write to Segment's API.
|
| Default: true
| Default: ''
|
*/