1 | <?php |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. |
---|
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 |
---|
25 | require_once(CLASS_PATH . "pages/LC_Page.php"); |
---|
26 | |
---|
27 | /** |
---|
28 | * システム情報 のページクラス. |
---|
29 | * |
---|
30 | * @package Page |
---|
31 | * @author LOCKON CO.,LTD. |
---|
32 | * @version $Id: LC_Page_Admin_System_System.php 18701 2010-06-14 08:30:18Z nanasess $ |
---|
33 | */ |
---|
34 | class LC_Page_Admin_System_Plugin extends LC_Page { |
---|
35 | |
---|
36 | // }}} |
---|
37 | // {{{ functions |
---|
38 | |
---|
39 | /** |
---|
40 | * Page を初期化する. |
---|
41 | * |
---|
42 | * @return void |
---|
43 | */ |
---|
44 | function init() { |
---|
45 | parent::init(); |
---|
46 | $this->tpl_mainpage = 'system/plugin.tpl'; |
---|
47 | $this->tpl_subnavi = 'system/subnavi.tpl'; |
---|
48 | $this->tpl_subno = 'plugin'; |
---|
49 | $this->tpl_mainno = 'system'; |
---|
50 | $this->tpl_subtitle = 'プラグイン管理'; |
---|
51 | } |
---|
52 | |
---|
53 | /** |
---|
54 | * フォームパラメータ初期化 |
---|
55 | * |
---|
56 | * @return void |
---|
57 | */ |
---|
58 | function initForm() { |
---|
59 | $objForm = new SC_FormParam(); |
---|
60 | $objForm->addParam('mode', 'mode', INT_LEN, '', array('ALPHA_CHECK', 'MAX_LENGTH_CHECK')); |
---|
61 | $objForm->setParam($_GET); |
---|
62 | $this->objForm = $objForm; |
---|
63 | } |
---|
64 | |
---|
65 | |
---|
66 | /** |
---|
67 | * Page のプロセス. |
---|
68 | * |
---|
69 | * @return void |
---|
70 | */ |
---|
71 | function process() { |
---|
72 | SC_Utils_Ex::sfIsSuccess(new SC_Session); |
---|
73 | $objView = new SC_AdminView(); |
---|
74 | $this->initForm(); |
---|
75 | switch($this->objForm->getValue('mode')) { |
---|
76 | // PHP INFOを表示 |
---|
77 | case 'install': |
---|
78 | |
---|
79 | break; |
---|
80 | case 'uninstall': |
---|
81 | |
---|
82 | break; |
---|
83 | case 'enable': |
---|
84 | |
---|
85 | break; |
---|
86 | case 'disable': |
---|
87 | |
---|
88 | break; |
---|
89 | default: |
---|
90 | $plugins = SC_Helper_Plugin_Ex::getAllPlugin(); |
---|
91 | $this->getPluginOnFilesystem($plugins); |
---|
92 | var_dump($plugins); |
---|
93 | break; |
---|
94 | } |
---|
95 | |
---|
96 | $this->arrSystemInfo = $this->getSystemInfo(); |
---|
97 | |
---|
98 | $objView->assignobj($this); |
---|
99 | $objView->display(MAIN_FRAME); |
---|
100 | } |
---|
101 | |
---|
102 | /* |
---|
103 | CREATE TABLE dtb_plugin ( |
---|
104 | plugin_id INT NOT NULL, |
---|
105 | plugin_name VARCHAR(255) NOT NULL DEFAULT "", |
---|
106 | enable INT NOT NULL DEFAULT 0, |
---|
107 | del_flg INT NOT NULL DEFAULT 0, |
---|
108 | class_name VARCHAR(255) NOT NULL DEFAULT NULL, |
---|
109 | create_date DATETIME NOT NULL, |
---|
110 | update_date DATETIME NOT NULL, |
---|
111 | PRIMARY KEY (plugin_id) |
---|
112 | ) TYPE=InnoDB; |
---|
113 | */ |
---|
114 | |
---|
115 | function getPluginOnFilesystem($existsPlugins){ |
---|
116 | |
---|
117 | $dir = DATA_PATH."plugin/"; |
---|
118 | $arrPlugins = array(); |
---|
119 | if($dh = opendir($dir)){ |
---|
120 | while(($file = readdir($dh)) !== false){ |
---|
121 | if($file !='.' && $file !='..' && filetype($dir.$file) == 'dir'){ |
---|
122 | $arrPlugins[] = $file; |
---|
123 | } |
---|
124 | } |
---|
125 | } |
---|
126 | var_dump($arrPlugins); |
---|
127 | echo "\n\n<br/>#######--------- line is ".__LINE__." on ".__FILE__."--------########<br/>\n\n"; |
---|
128 | |
---|
129 | |
---|
130 | } |
---|
131 | |
---|
132 | /** |
---|
133 | * デストラクタ. |
---|
134 | * |
---|
135 | * @return void |
---|
136 | */ |
---|
137 | function destroy() { |
---|
138 | parent::destroy(); |
---|
139 | } |
---|
140 | |
---|
141 | /** |
---|
142 | * システム情報を取得する |
---|
143 | * |
---|
144 | * @return array |
---|
145 | */ |
---|
146 | function getSystemInfo() { |
---|
147 | $objDB = SC_DB_DBFactory_Ex::getInstance(); |
---|
148 | |
---|
149 | $arrSystemInfo = array( |
---|
150 | array('title' => 'EC-CUBE', 'value' => ECCUBE_VERSION), |
---|
151 | array('title' => 'OS', 'value' => php_uname()), |
---|
152 | array('title' => 'DBサーバ', 'value' => $objDB->sfGetDBVersion()), |
---|
153 | array('title' => 'WEBサーバ', 'value' => $_SERVER['SERVER_SOFTWARE']), |
---|
154 | array('title' => 'PHP', 'value' => phpversion()), |
---|
155 | array('title' => 'GD', 'value' => extension_loaded('GD') ? 'Loaded' : '--'), |
---|
156 | ); |
---|
157 | |
---|
158 | return $arrSystemInfo; |
---|
159 | } |
---|
160 | } |
---|