add mysql/db version to posted analytics

This commit is contained in:
Nabeel Shahzad 2018-01-18 22:59:09 -05:00
parent 7e09cf6c28
commit 6e12c00725
2 changed files with 14 additions and 2 deletions

View File

@ -9,6 +9,6 @@ namespace App\Models\Enums;
class AnalyticsDimensions
{
const PHP_VERSION = 1;
const MYSQL_VERSION = 2;
const DATABASE_VERSION = 2;
const PHPVMS_VERSION = 3;
}

View File

@ -2,8 +2,9 @@
namespace Modules\Installer\Http\Controllers;
use App\Models\Enums\AnalyticsDimensions;
use DB;
use Log;
use PDO;
use Irazasyed\LaravelGAMP\Facades\GAMP;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
@ -11,6 +12,7 @@ use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Validator;
use App\Models\User;
use App\Models\Enums\AnalyticsDimensions;
use App\Repositories\AirlineRepository;
use App\Facades\Utils;
use App\Services\UserService;
@ -269,9 +271,19 @@ class InstallerController extends Controller
# Set the intial admin e-mail address
setting('general.admin_email', $user->email);
# 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();
# If analytics are disabled