コード例 #1
0
ファイル: StoreTest.php プロジェクト: spryker/Kernel
 /**
  * @return void
  */
 public function testSetCurrentLocale()
 {
     $locale = $this->Store->getCurrentLocale();
     $this->assertSame('de_DE', $locale);
     $newLocale = 'en_US';
     $this->Store->setCurrentLocale($newLocale);
     $locale = $this->Store->getCurrentLocale();
     $this->assertSame($newLocale, $locale);
 }
コード例 #2
0
 /**
  * @param \Symfony\Component\HttpKernel\Event\FilterControllerEvent $event
  *
  * @return void
  */
 public function onKernelController(FilterControllerEvent $event)
 {
     if (!$event->isMasterRequest()) {
         return;
     }
     $request = $event->getRequest();
     $transactionName = $this->getTransactionName($request);
     $requestUri = $request->server->get('REQUEST_URI', 'n/a');
     $host = $request->server->get('COMPUTERNAME', $this->system->getHostname());
     $this->newRelicApi->setNameOfTransaction($transactionName);
     $this->newRelicApi->addCustomParameter('request_uri', $requestUri);
     $this->newRelicApi->addCustomParameter('host', $host);
     $this->newRelicApi->addCustomParameter('store', $this->store->getStoreName());
     $this->newRelicApi->addCustomParameter('locale', $this->store->getCurrentLocale());
     if ($this->ignoreTransaction($transactionName)) {
         $this->newRelicApi->markIgnoreTransaction();
     }
 }