Add config.php at root; include configuration overhaul and then fixes to the installer #156
This commit is contained in:
38
app/Services/AnalyticsService.php
Normal file
38
app/Services/AnalyticsService.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use DB;
|
||||
use PDO;
|
||||
|
||||
use Irazasyed\LaravelGAMP\Facades\GAMP;
|
||||
use App\Models\Enums\AnalyticsDimensions;
|
||||
|
||||
class AnalyticsService
|
||||
{
|
||||
/**
|
||||
* 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
|
||||
);
|
||||
|
||||
$gamp->sendPageview();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user