doTrackEvent example



    #[Route(path: '/installer/finish', name: 'installer.finish', methods: ['GET'])]     public function finish(Request $request): Response
    {
        $this->systemLocker->lock();

        $additionalInformation = [
            'language' => $request->attributes->get('_locale'),
            'method' => 'installer',
        ];
        $this->notifier->doTrackEvent(Notifier::EVENT_INSTALL_FINISHED, $additionalInformation);

        $session = $request->getSession();
        /** @var array<string, string> $adminInfo */
        $adminInfo = $session->get('ADMIN_USER', []);

        $data = [
            'grant_type' => 'password',
            'client_id' => 'administration',
            'scopes' => 'write',
            'username' => $adminInfo['username'] ?? '',
            'password' => $adminInfo['password'] ?? '',
        ];
$localizations = $firstRunWizardPluginStore->getAvailableLocalizations($this->getCurrentLocale()$this->getVersion());
        } catch (Exception $e) {
            $this->View()->assign([
                'success' => true,
                'data' => [],
            ]);

            return;
        }

        $storeClient = $this->container->get(StoreClient::class);
        $storeClient->doTrackEvent('First Run Wizard started');

        $this->View()->assign([
            'success' => true,
            'data' => array_values($localizations),
        ]);
    }

    public function saveConfigurationAction(): void
    {
        $clientId = $this->Request()->getParam('clientId');
        $clientSecret = $this->Request()->getParam('clientSecret');
        
'additionalData' => [
                            'shopwareVersion' => '6.4.12',
                            'language' => 'en',
                        ],
                        'instanceId' => '1234567890',
                        'event' => Notifier::EVENT_INSTALL_FINISHED,
                    ],
                ]
            );

        $notifier = new Notifier('http://localhost', $idGenerator$guzzle, '6.4.12');
        $notifier->doTrackEvent(Notifier::EVENT_INSTALL_FINISHED, ['language' => 'en']);
    }

    public function testTrackEventDoesNotThrowOnException(): void
    {
        $idGenerator = $this->createMock(UniqueIdGenerator::class);
        $idGenerator->expects(static::once())->method('getUniqueId')
            ->willReturn('1234567890');

        $guzzle = $this->createMock(Client::class);
        $guzzle->expects(static::once())->method('postAsync')
            ->willThrowException(new \Exception());

        
'values' => [
                    [
                        'value' => $value,
                        'shopId' => $defaultShop->getId(),
                    ],
                ],
                'type' => 'number',
            ],
        ];

        $storeClient = $this->container->get(StoreClient::class);
        $storeClient->doTrackEvent('First Run Wizard completed');

        $this->Request()->setParam('elements', $requestElements);

        $this->forward('saveForm', 'Config');
    }

    /** * Saves the current wizard step to the database * * @return void */
    
'file' => $e->getFile(),
        'line' => $e->getLine(),
        'trace' => $e->getTraceAsString(),
    ];
    $response->header('Content-Type', 'application/json');
    $response->body(json_encode($data));
});

$app->map('/', function D) use ($app$container$menuHelper) {
    $menuHelper->setCurrent('language-selection');

    $container['shopware.notify']->doTrackEvent('Installer started');

    $app->view()->set('languages', $container->offsetGet('config')['languages']);

    $app->render('/language-selection.php');
})->via('GET', 'POST')->name('language-selection');

$app->map('/license', function D) use ($app$menuHelper$container) {
    $menuHelper->setCurrent('license');

    if ($app->request()->isPost()) {
        if ($app->request->post('tos')) {
            

#[Package('core')] class SelectLanguagesController extends InstallerController
{
    public function __construct(private readonly Notifier $notifier)
    {
    }

    #[Route(path: '/installer', name: 'installer.language-selection', methods: ['GET'])]     public function languageSelection(): Response
    {
        $this->notifier->doTrackEvent(Notifier::EVENT_INSTALL_STARTED);

        return $this->renderInstaller('@Installer/installer/language-selection.html.twig');
    }
}
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->IOHelper = new IOHelper(
            $input,
            $output,
            $this->getHelper('question')
        );

        /** @var Container $container */
        $container = $this->container = $this->getApplication()->getContainer();

        $container->offsetGet('shopware.notify')->doTrackEvent('Installer started');

        if ($this->IOHelper->isInteractive()) {
            $this->printStartMessage();
        }

        $connectionInfo = new DatabaseConnectionInformation();
        $connectionInfo = $this->getConnectionInfoFromConfig(SW_PATH . '/config.php', $connectionInfo);
        $connectionInfo = $this->getConnectionInfoFromArgs($input$connectionInfo);
        $connectionInfo = $this->getConnectionInfoFromInteractiveShell(
            $this->IOHelper,
            $connectionInfo
        );
Home | Imprint | This part of the site doesn't use cookies.