src/Eccube/Controller/Admin/Setting/System/SystemController.php line 64

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\Controller\Admin\Setting\System;
  13. use Eccube\Common\Constant;
  14. use Eccube\Service\SystemService;
  15. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  16. use Symfony\Component\HttpFoundation\Request;
  17. use Symfony\Component\HttpFoundation\Response;
  18. use Symfony\Component\Routing\Annotation\Route;
  19. class SystemController
  20. {
  21.     /**
  22.      * @var SystemService
  23.      */
  24.     protected $systemService;
  25.     /**
  26.      * SystemController constructor.
  27.      *
  28.      * @param SystemService $systemService
  29.      */
  30.     public function __construct(SystemService $systemService)
  31.     {
  32.         $this->systemService $systemService;
  33.     }
  34.     /**
  35.      * @Route("/%eccube_admin_route%/setting/system/system", name="admin_setting_system_system", methods={"GET"})
  36.      * @Template("@admin/Setting/System/system.twig")
  37.      */
  38.     public function index(Request $request)
  39.     {
  40.         $info = [];
  41.         $info[] = ['title' => trans('admin.setting.system.system.eccube'), 'value' => Constant::VERSION];
  42.         $info[] = ['title' => trans('admin.setting.system.system.server_os'), 'value' => php_uname()];
  43.         $info[] = ['title' => trans('admin.setting.system.system.database_server'), 'value' => $this->systemService->getDbversion()];
  44.         $info[] = ['title' => trans('admin.setting.system.system.web_server'), 'value' => $request->server->get('SERVER_SOFTWARE')];
  45.         $value phpversion().' ('.implode(', 'get_loaded_extensions()).')';
  46.         $info[] = ['title' => trans('admin.setting.system.system.php'), 'value' => $value];
  47.         $info[] = ['title' => trans('admin.setting.system.system.user_agent'), 'value' => $request->headers->get('User-Agent')];
  48.         return [
  49.             'info' => $info,
  50.         ];
  51.     }
  52.     /**
  53.      * @Route("/%eccube_admin_route%/setting/system/system/phpinfo", name="admin_setting_system_system_phpinfo", methods={"GET"})
  54.      */
  55.     public function phpinfo(Request $request)
  56.     {
  57.         ob_start();
  58.         phpinfo();
  59.         $phpinfo ob_get_contents();
  60.         ob_end_clean();
  61.         return new Response($phpinfo);
  62.     }
  63. }