src/Eccube/Log/Processor/SessionProcessor.php line 18

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Eccube\Log\Processor;
  13. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  14. class SessionProcessor
  15. {
  16.     /**
  17.      * @var SessionInterface
  18.      */
  19.     protected $session;
  20.     public function __construct(SessionInterface $session)
  21.     {
  22.         $this->session $session;
  23.     }
  24.     public function __invoke(array $records)
  25.     {
  26.         $records['extra']['session_id'] = 'N/A';
  27.         if (!$this->session->isStarted()) {
  28.             return $records;
  29.         }
  30.         $records['extra']['session_id'] = substr(sha1($this->session->getId()), 08);
  31.         return $records;
  32.     }
  33. }