phpvms/app/Services/AnalyticsService.php
Nabeel S aedb1f22b6
Don't allow cancels from certain states (#396)
* Don't allow cancels from certain states

* Unused imports

* Don't reset the state doubly

* Move SetUserActive into listener; code cleanup

* Unused imports

* Add missing files into htaccess

* Move Command contract to correct folder
2019-09-16 13:08:26 -04:00

43 lines
1.0 KiB
PHP

<?php
namespace App\Services;
use App\Contracts\Service;
use App\Models\Enums\AnalyticsDimensions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Irazasyed\LaravelGAMP\Facades\GAMP;
use PDO;
class AnalyticsService extends Service
{
/**
* Send out some stats about the install
*/
public function sendInstall()
{
if (config('app.analytics') === false) {
return;
}
// some analytics
$gamp = GAMP::setClientId(uniqid('', true));
$gamp->setDocumentPath('/install');
$gamp->setCustomDimension(PHP_VERSION, AnalyticsDimensions::PHP_VERSION);
// figure out database version
$pdo = DB::connection()->getPdo();
$gamp->setCustomDimension(
strtolower($pdo->getAttribute(PDO::ATTR_SERVER_VERSION)),
AnalyticsDimensions::DATABASE_VERSION
);
try {
$gamp->sendPageview();
} catch (\Exception $e) {
Log::error($e->getMessage());
}
}
}