[17325] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * This file is part of EC-CUBE |
---|
| 4 | * |
---|
[21867] | 5 | * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved. |
---|
[17325] | 6 | * |
---|
| 7 | * http://www.lockon.co.jp/ |
---|
| 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or |
---|
| 10 | * modify it under the terms of the GNU General Public License |
---|
| 11 | * as published by the Free Software Foundation; either version 2 |
---|
| 12 | * of the License, or (at your option) any later version. |
---|
| 13 | * |
---|
| 14 | * This program is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this program; if not, write to the Free Software |
---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | // {{{ requires |
---|
[20534] | 25 | require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php'; |
---|
[17325] | 26 | |
---|
| 27 | /** |
---|
| 28 | * システム情報 のページクラス. |
---|
| 29 | * |
---|
| 30 | * @package Page |
---|
| 31 | * @author LOCKON CO.,LTD. |
---|
| 32 | * @version $Id$ |
---|
| 33 | */ |
---|
[20345] | 34 | class LC_Page_Admin_System_System extends LC_Page_Admin_Ex { |
---|
[17325] | 35 | |
---|
| 36 | // }}} |
---|
| 37 | // {{{ functions |
---|
| 38 | |
---|
| 39 | /** |
---|
| 40 | * Page を初期化する. |
---|
| 41 | * |
---|
| 42 | * @return void |
---|
| 43 | */ |
---|
| 44 | function init() { |
---|
| 45 | parent::init(); |
---|
| 46 | $this->tpl_mainpage = 'system/system.tpl'; |
---|
| 47 | $this->tpl_subno = 'system'; |
---|
| 48 | $this->tpl_mainno = 'system'; |
---|
[22100] | 49 | $this->tpl_maintitle = t('TPL_MAINTITLE_009'); |
---|
[22429] | 50 | $this->tpl_subtitle = t('c_System information_01'); |
---|
[17325] | 51 | } |
---|
| 52 | |
---|
| 53 | /** |
---|
| 54 | * Page のプロセス. |
---|
| 55 | * |
---|
| 56 | * @return void |
---|
| 57 | */ |
---|
| 58 | function process() { |
---|
[19661] | 59 | $this->action(); |
---|
| 60 | $this->sendResponse(); |
---|
| 61 | } |
---|
[17325] | 62 | |
---|
[19661] | 63 | /** |
---|
| 64 | * Page のアクション. |
---|
| 65 | * |
---|
| 66 | * @return void |
---|
| 67 | */ |
---|
| 68 | function action() { |
---|
[20355] | 69 | |
---|
[20501] | 70 | $objFormParam = new SC_FormParam_Ex(); |
---|
[20355] | 71 | |
---|
| 72 | $this->initForm($objFormParam, $_GET); |
---|
[21441] | 73 | switch ($this->getMode()) { |
---|
[17325] | 74 | |
---|
[21526] | 75 | // PHP INFOを表示 |
---|
| 76 | case 'info': |
---|
| 77 | phpinfo(); |
---|
[21743] | 78 | SC_Response_Ex::actionExit(); |
---|
[21526] | 79 | break; |
---|
[17325] | 80 | |
---|
[21526] | 81 | default: |
---|
| 82 | break; |
---|
[17325] | 83 | } |
---|
| 84 | |
---|
[17573] | 85 | $this->arrSystemInfo = $this->getSystemInfo(); |
---|
[21591] | 86 | |
---|
[17325] | 87 | } |
---|
| 88 | |
---|
| 89 | /** |
---|
| 90 | * デストラクタ. |
---|
| 91 | * |
---|
| 92 | * @return void |
---|
| 93 | */ |
---|
| 94 | function destroy() { |
---|
| 95 | parent::destroy(); |
---|
| 96 | } |
---|
[17573] | 97 | |
---|
| 98 | /** |
---|
[20970] | 99 | * フォームパラメーター初期化. |
---|
[20264] | 100 | * |
---|
[20365] | 101 | * @param object $objFormParam |
---|
| 102 | * @param array $arrParams $_GET値 |
---|
[20264] | 103 | * @return void |
---|
| 104 | */ |
---|
[20355] | 105 | function initForm(&$objFormParam, &$arrParams) { |
---|
[22100] | 106 | $objFormParam->addParam(t('PARAM_LABEL_MODE_ALP'), 'mode', INT_LEN, '', array('ALPHA_CHECK', 'MAX_LENGTH_CHECK')); |
---|
[20365] | 107 | $objFormParam->setParam($arrParams); |
---|
[20264] | 108 | } |
---|
| 109 | |
---|
| 110 | /** |
---|
[20263] | 111 | * システム情報を取得する. |
---|
[17573] | 112 | * |
---|
[20263] | 113 | * @return array システム情報 |
---|
[17573] | 114 | */ |
---|
| 115 | function getSystemInfo() { |
---|
[17576] | 116 | $objDB = SC_DB_DBFactory_Ex::getInstance(); |
---|
[17573] | 117 | |
---|
| 118 | $arrSystemInfo = array( |
---|
[22429] | 119 | array('title' => t('c_EC-CUBE_01'), 'value' => ECCUBE_VERSION), |
---|
| 120 | array('title' => t('c_Server OS_01'), 'value' => php_uname()), |
---|
| 121 | array('title' => t('c_DB server_01'), 'value' => $objDB->sfGetDBVersion()), |
---|
| 122 | array('title' => t('c_WEB server_01'), 'value' => $_SERVER['SERVER_SOFTWARE']), |
---|
[17573] | 123 | ); |
---|
| 124 | |
---|
[20827] | 125 | $value = phpversion() . ' (' . implode(', ', get_loaded_extensions()) . ')'; |
---|
| 126 | $arrSystemInfo[] = array('title' => 'PHP', 'value' => $value); |
---|
| 127 | |
---|
[20879] | 128 | if (extension_loaded('GD') || extension_loaded('gd')) { |
---|
[20827] | 129 | $arrValue = array(); |
---|
| 130 | foreach (gd_info() as $key => $val) { |
---|
| 131 | $arrValue[] = "$key => $val"; |
---|
| 132 | } |
---|
[22429] | 133 | $value = t('c_Enabled_01') . ' (' . implode(', ', $arrValue) . ')'; |
---|
[20827] | 134 | } else { |
---|
[22429] | 135 | $value = t('c_Inactive_01'); |
---|
[20827] | 136 | } |
---|
[22429] | 137 | $arrSystemInfo[] = array('title' => t('c_GD_01'), 'value' => $value); |
---|
| 138 | $arrSystemInfo[] = array('title' => t('c_HTTP user agent_01'), 'value' => $_SERVER['HTTP_USER_AGENT']); |
---|
[20827] | 139 | |
---|
[17573] | 140 | return $arrSystemInfo; |
---|
| 141 | } |
---|
[17325] | 142 | } |
---|