source: branches/mobile/html/install/index.php @ 11457

Revision 11457, 27.8 KB checked in by rebelt, 16 years ago (diff)

修正です。

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2/*
3 * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7require_once("../require.php");
8$INSTALL_DIR = realpath(dirname( __FILE__));
9require_once("../../data/module/Request.php");
10
11define("INSTALL_LOG", "./temp/install.log");
12
13class LC_Page {
14    function LC_Page() {
15        $this->arrDB_TYPE = array(
16            'pgsql' => 'PostgreSQL',
17            'mysql' => 'MySQL' 
18        );
19        $this->arrDB_PORT = array(
20            'pgsql' => '',
21            'mysql' => ''   
22        );
23    }
24}
25
26$objPage = new LC_Page();
27
28// ¥Æ¥ó¥×¥ì¡¼¥È¥³¥ó¥Ñ¥¤¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Î½ñ¹þ¤ß¸¢¸Â¥Á¥§¥Ã¥¯
29$temp_dir = $INSTALL_DIR . '/temp';
30$mode = lfGetFileMode($temp_dir);
31
32if($mode != '777') {
33    sfErrorHeader($temp_dir . "¤Ë¥æ¡¼¥¶½ñ¹þ¤ß¸¢¸Â(777)¤òÉÕÍ¿¤·¤Æ²¼¤µ¤¤¡£", true);
34    exit;
35}
36
37$objView = new SC_InstallView($INSTALL_DIR . '/templates', $INSTALL_DIR . '/temp');
38
39// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
40$objWebParam = new SC_FormParam();
41$objDBParam = new SC_FormParam();
42// ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
43$objWebParam = lfInitWebParam($objWebParam);
44$objDBParam = lfInitDBParam($objDBParam);
45
46//¥Õ¥©¡¼¥àÇÛÎó¤Î¼èÆÀ
47$objWebParam->setParam($_POST);
48$objDBParam->setParam($_POST);
49
50switch($_POST['mode']) {
51// ¤è¤¦¤³¤½
52case 'welcome':
53    $objPage = lfDispStep0($objPage);
54    break;
55// ¥¢¥¯¥»¥¹¸¢¸Â¤Î¥Á¥§¥Ã¥¯
56case 'step0':
57    $objPage = lfDispStep0_1($objPage);
58    break; 
59// ¥Õ¥¡¥¤¥ë¤Î¥³¥Ô¡¼
60case 'step0_1':
61    $objPage = lfDispStep1($objPage);
62    break; 
63// WEB¥µ¥¤¥È¤ÎÀßÄê
64case 'step1':
65    //ÆþÎÏÃͤΥ¨¥é¡¼¥Á¥§¥Ã¥¯
66    $objPage->arrErr = lfCheckWEBError($objWebParam);
67    if(count($objPage->arrErr) == 0) {
68        $objPage = lfDispStep2($objPage);
69    } else {
70        $objPage = lfDispStep1($objPage);
71    }
72    break;
73// ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀßÄê
74case 'step2':
75    //ÆþÎÏÃͤΥ¨¥é¡¼¥Á¥§¥Ã¥¯
76    $objPage->arrErr = lfCheckDBError($objDBParam);
77    if(count($objPage->arrErr) == 0) {
78        $objPage = lfDispStep3($objPage);
79    } else {
80        $objPage = lfDispStep2($objPage);
81    }
82    break;
83// ¥Æ¡¼¥Ö¥ë¤ÎºîÀ®
84case 'step3':
85    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
86    $arrRet =  $objDBParam->getHashArray();
87    $dsn = $arrRet['db_type']."://".$arrRet['db_user'].":".$arrRet['db_password']."@".$arrRet['db_server'].":".$arrRet['db_port']."/".$arrRet['db_name'];
88   
89    /*
90        lfAddTable¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó¥¢¥Ã¥×Åù¤ÇÄɲåơ¼¥Ö¥ë¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¼Â¹Ô¤¹¤ë¡£
91        ¡Ê£Ä£Â¹½À®¤Î²¼°Ì¸ß´¹¤Î¤¿¤á¥¹¥­¥Ã¥×»þ¤â¶¯À©¡Ë
92    */
93    // ¥Æ¡¼¥Ö¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤ËÄɲ䵤ì¤ë¡£
94    $objPage->arrErr = lfAddTable("dtb_session", $dsn); // ¥»¥Ã¥·¥ç¥ó´ÉÍý¥Æ¡¼¥Ö¥ë
95    // ¥Æ¡¼¥Ö¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤ËÄɲ䵤ì¤ë¡£
96    $objPage->arrErr = lfAddTable("dtb_module", $dsn);  // ¥»¥Ã¥·¥ç¥ó´ÉÍý¥Æ¡¼¥Ö¥ë
97    // ¥Æ¡¼¥Ö¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤ËÄɲ䵤ì¤ë¡£
98    $objPage->arrErr = lfAddTable("dtb_mobile_kara_mail", $dsn);    // ¶õ¥á¡¼¥ë´ÉÍý¥Æ¡¼¥Ö¥ë
99    // ¥Æ¡¼¥Ö¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤ËÄɲ䵤ì¤ë¡£
100    $objPage->arrErr = lfAddTable("dtb_mobile_ext_session_id", $dsn);   // ¥»¥Ã¥·¥ç¥óID´ÉÍý¥Æ¡¼¥Ö¥ë
101   
102    // ¥«¥é¥à¤òÄɲÃ
103    lfAddColumn($dsn);
104
105    if(count($objPage->arrErr) == 0) {
106        // ¥¹¥­¥Ã¥×¤¹¤ë¾ì¹ç¤Ë¤Ï¼¡²èÌ̤ØÁ«°Ü
107        $skip = $_POST["db_skip"];
108        if ($skip == "on") {
109            // ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÀ¸À®
110            lfMakeConfigFile();
111            //$objPage = lfDispComplete($objPage);
112            $objPage = lfDispStep4($objPage);
113            break;
114        }
115    }
116   
117    // ¥Æ¡¼¥Ö¥ë¤ÎºîÀ®
118    $objPage->arrErr = lfExecuteSQL("./sql/create_table_".$arrRet['db_type'].".sql", $dsn);
119    if(count($objPage->arrErr) == 0) {
120        $objPage->tpl_message.="¡û¡§¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£<br>";
121    } else {
122        $objPage->tpl_message.="¡ß¡§¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£<br>";       
123    }
124
125    // ¥Ó¥å¡¼¤ÎºîÀ®
126    if(count($objPage->arrErr) == 0 and $arrRet['db_type'] == 'pgsql') {
127        // ¥Ó¥å¡¼¤ÎºîÀ®
128        $objPage->arrErr = lfExecuteSQL("./sql/create_view.sql", $dsn);
129        if(count($objPage->arrErr) == 0) {
130            $objPage->tpl_message.="¡û¡§¥Ó¥å¡¼¤ÎºîÀ®¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£<br>";
131        } else {
132            $objPage->tpl_message.="¡ß¡§¥Ó¥å¡¼¤ÎºîÀ®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£<br>";     
133        }
134    }   
135   
136    // ½é´ü¥Ç¡¼¥¿¤ÎºîÀ®
137    if(count($objPage->arrErr) == 0) {
138        $objPage->arrErr = lfExecuteSQL("./sql/insert_data.sql", $dsn);
139       
140        if(count($objPage->arrErr) == 0) {
141            $objPage->tpl_message.="¡û¡§½é´ü¥Ç¡¼¥¿¤ÎºîÀ®¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£<br>";
142        } else {
143            $objPage->tpl_message.="¡ß¡§½é´ü¥Ç¡¼¥¿¤ÎºîÀ®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£<br>";     
144        }
145    }   
146   
147    // ¥«¥é¥à¥³¥á¥ó¥È¤Î½ñ¹þ¤ß
148    if(count($objPage->arrErr) == 0) {
149        $objPage->arrErr = lfExecuteSQL("./sql/column_comment.sql", $dsn);
150        if(count($objPage->arrErr) == 0) {
151            $objPage->tpl_message.="¡û¡§¥«¥é¥à¥³¥á¥ó¥È¤Î½ñ¹þ¤ß¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£<br>";
152        } else {
153            $objPage->tpl_message.="¡ß¡§¥«¥é¥à¥³¥á¥ó¥È¤Î½ñ¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£<br>";       
154        }
155    }   
156   
157    // ¥Æ¡¼¥Ö¥ë¥³¥á¥ó¥È¤Î½ñ¹þ¤ß
158    if(count($objPage->arrErr) == 0) {
159        $objPage->arrErr = lfExecuteSQL("./sql/table_comment.sql", $dsn);
160        if(count($objPage->arrErr) == 0) {
161            $objPage->tpl_message.="¡û¡§¥Æ¡¼¥Ö¥ë¥³¥á¥ó¥È¤Î½ñ¹þ¤ß¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£<br>";
162        } else {
163            $objPage->tpl_message.="¡ß¡§¥Æ¡¼¥Ö¥ë¥³¥á¥ó¥È¤Î½ñ¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£<br>";     
164        }
165    }
166
167    if(count($objPage->arrErr) == 0) {
168        // ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÀ¸À®
169        lfMakeConfigFile();
170        $objPage = lfDispStep3($objPage);
171        $objPage->tpl_mode = 'step4';
172    } else {
173        $objPage = lfDispStep3($objPage);
174    }
175    break;
176case 'step4':
177    $objPage = lfDispStep4($objPage);
178    break;
179   
180// ¥Æ¡¼¥Ö¥ëÎàºï½ü
181case 'drop':
182    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
183    $arrRet =  $objDBParam->getHashArray();
184    $dsn = $arrRet['db_type']."://".$arrRet['db_user'].":".$arrRet['db_password']."@".$arrRet['db_server'].":".$arrRet['db_port']."/".$arrRet['db_name'];
185   
186    // Äɲåơ¼¥Ö¥ë¤¬¤¢¤ì¤Ðºï½ü¤¹¤ë¡£
187    lfDropTable("dtb_module", $dsn);
188    lfDropTable("dtb_session", $dsn);
189       
190    if ($arrRet['db_type'] == 'pgsql'){
191        // ¥Ó¥å¡¼¤Îºï½ü
192        $objPage->arrErr = lfExecuteSQL("./sql/drop_view.sql", $dsn, false);
193        if(count($objPage->arrErr) == 0) {
194            $objPage->tpl_message.="¡û¡§¥Ó¥å¡¼¤Îºï½ü¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£<br>";
195        } else {
196            $objPage->tpl_message.="¡ß¡§¥Ó¥å¡¼¤Îºï½ü¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£<br>";     
197        }
198    }
199
200    // ¥Æ¡¼¥Ö¥ë¤Îºï½ü
201    if(count($objPage->arrErr) == 0) {
202        $objPage->arrErr = lfExecuteSQL("./sql/drop_table.sql", $dsn, false);
203        if(count($objPage->arrErr) == 0) {
204            $objPage->tpl_message.="¡û¡§¥Æ¡¼¥Ö¥ë¤Îºï½ü¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£<br>";
205        } else {
206            $objPage->tpl_message.="¡ß¡§¥Æ¡¼¥Ö¥ë¤Îºï½ü¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£<br>";       
207        }
208    }
209    $objPage = lfDispStep3($objPage);
210    break;
211// ´°Î»²èÌÌ
212case 'complete':
213    // ¥·¥ç¥Ã¥×¥Þ¥¹¥¿¾ðÊó¤Î½ñ¤­¹þ¤ß
214    $arrRet =  $objDBParam->getHashArray();
215   
216    $dsn = $arrRet['db_type']."://".$arrRet['db_user'].":".$arrRet['db_password']."@".$arrRet['db_server'].":".$arrRet['db_port']."/".$arrRet['db_name'];
217    $sqlval['shop_name'] = $objWebParam->getValue('shop_name');
218    $sqlval['email01'] = $objWebParam->getValue('admin_mail');
219    $sqlval['email02'] = $objWebParam->getValue('admin_mail');
220    $sqlval['email03'] = $objWebParam->getValue('admin_mail');
221    $sqlval['email04'] = $objWebParam->getValue('admin_mail');
222    $sqlval['email05'] = $objWebParam->getValue('admin_mail');
223    $sqlval['top_tpl'] = "default1";
224    $sqlval['product_tpl'] = "default1";
225    $sqlval['detail_tpl'] = "default1";
226    $sqlval['mypage_tpl'] = "default1";
227    $objQuery = new SC_Query($dsn);
228    $cnt = $objQuery->count("dtb_baseinfo");
229    if($cnt > 0) {
230        $objQuery->update("dtb_baseinfo", $sqlval);
231    } else {       
232        $objQuery->insert("dtb_baseinfo", $sqlval);     
233    }
234
235    // ´ÉÍý¼ÔÅÐÏ¿
236    $login_id = $objWebParam->getValue('login_id');
237    $login_pass = sha1($objWebParam->getValue('login_pass') . ":" . AUTH_MAGIC);
238   
239    $sql = "DELETE FROM dtb_member WHERE login_id = ?";
240    $objQuery->query($sql, array($login_id));   
241
242    $sql = "INSERT INTO dtb_member (name, login_id, password, creator_id, authority, work, del_flg, rank, create_date, update_date)
243            VALUES ('´ÉÍý¼Ô',?,?,0,0,1,0,1, now(), now());";
244   
245    $objQuery->query($sql, array($login_id, $login_pass));     
246   
247    global $GLOBAL_ERR;
248    $GLOBAL_ERR = "";
249    $objPage = lfDispComplete($objPage);
250   
251    // ¥µ¥¤¥È¾ðÊó¤òÁ÷¿®¤·¤Æ¤âÎɤ¤¾ì¹ç¤Ë¤ÏÁ÷¤ë
252    if($_POST['send_info'] == "true"){
253        $req = new HTTP_Request("http://www.ec-cube.net/mall/use_site.php");
254        $req->setMethod(HTTP_REQUEST_METHOD_POST);
255       
256        $arrSendData = array();
257        foreach($_POST as $key => $val){
258            if (ereg("^senddata_*", $key)){
259                $arrSendDataTmp = array(str_replace("senddata_", "", $key) => $val);
260                $arrSendData = array_merge($arrSendData, $arrSendDataTmp);
261            }
262        }
263       
264        $req->addPostDataArray($arrSendData);
265       
266        if (!PEAR::isError($req->sendRequest())) {
267            $response1 = $req->getResponseBody();
268        } else {
269            $response1 = "";
270        }
271        $req->clearPostData();
272    }
273   
274    break;
275case 'return_step0':
276    $objPage = lfDispStep0($objPage);
277    break; 
278case 'return_step1':
279    $objPage = lfDispStep1($objPage);
280    break;
281case 'return_step2':
282    $objPage = lfDispStep2($objPage);
283    break;
284case 'return_step3':
285    $objPage = lfDispStep3($objPage);
286    break;
287case 'return_welcome':
288default:
289    $objPage = lfDispWelcome($objPage);
290    break;
291}
292
293//¥Õ¥©¡¼¥àÍѤΥѥé¥á¡¼¥¿¤òÊÖ¤¹
294$objPage->arrForm = $objWebParam->getFormParamList();
295$objPage->arrForm = array_merge($objPage->arrForm, $objDBParam->getFormParamList());
296
297// SiteInfo¤òÆÉ¤ß¹þ¤Þ¤Ê¤¤
298$objView->assignobj($objPage);
299$objView->display('install_frame.tpl');
300//-----------------------------------------------------------------------------------------------------------------------------------
301// ¤è¤¦¤³¤½²èÌ̤Îɽ¼¨
302function lfDispWelcome($objPage) {
303    global $objWebParam;
304    global $objDBParam;
305    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
306    $objPage->arrHidden = $objWebParam->getHashArray();
307    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
308    $objPage->arrHidden = array_merge($objPage->arrHidden, $objDBParam->getHashArray());
309    $objPage->arrHidden['db_skip'] = $_POST['db_skip'];
310    $objPage->tpl_mainpage = 'welcome.tpl';
311    $objPage->tpl_mode = 'welcome';
312    return $objPage;
313}
314
315// STEP0²èÌ̤Îɽ¼¨(¥Õ¥¡¥¤¥ë¸¢¸Â¥Á¥§¥Ã¥¯)
316function lfDispStep0($objPage) {
317    global $objWebParam;
318    global $objDBParam;
319    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
320    $objPage->arrHidden = $objWebParam->getHashArray();
321    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
322    $objPage->arrHidden = array_merge($objPage->arrHidden, $objDBParam->getHashArray());
323    $objPage->arrHidden['db_skip'] = $_POST['db_skip'];
324    $objPage->tpl_mainpage = 'step0.tpl';
325    $objPage->tpl_mode = 'step0';
326   
327    // ¥×¥í¥°¥é¥à¤Ç½ñ¹þ¤ß¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê
328    $arrWriteFile = array(
329        "../../data/install.inc",
330        "../../data/install_mobile.inc",
331        "../user_data",
332        "../upload",
333        "../mobile/converted_images",
334        "../../data/Smarty/templates_c",
335        "../../data/downloads",
336        "../../data/logs"
337    );
338   
339    $mess = "";
340    $err_file = false;
341    foreach($arrWriteFile as $val) {
342        if(file_exists($val)) {
343            $mode = lfGetFileMode($val);
344            $real_path = realpath($val);
345                       
346            // ¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç
347            if(is_dir($val)) {
348                if($mode == "777") {
349                    $mess.= ">> ¡û¡§$real_path($mode) <br>¥¢¥¯¥»¥¹¸¢¸Â¤ÏÀµ¾ï¤Ç¤¹¡£<br>";                   
350                } else {
351                    $mess.= ">> ¡ß¡§$real_path($mode) <br>¥æ¡¼¥¶½ñ¹þ¤ß¸¢¸Â(777)¤òÉÕÍ¿¤·¤Æ²¼¤µ¤¤¡£<br>";
352                    $err_file = true;                                       
353                }
354            } else {
355                if($mode == "666") {
356                    $mess.= ">> ¡û¡§$real_path($mode) <br>¥¢¥¯¥»¥¹¸¢¸Â¤ÏÀµ¾ï¤Ç¤¹¡£<br>";                   
357                } else {
358                    $mess.= ">> ¡ß¡§$real_path($mode) <br>¥æ¡¼¥¶½ñ¹þ¤ß¸¢¸Â(666)¤òÉÕÍ¿¤·¤Æ²¼¤µ¤¤¡£<br>";
359                    $err_file = true;                           
360                }
361            }           
362        } else {
363            $mess.= ">> ¡ß¡§$val ¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£<br>";
364            $err_file = true;
365        }
366    }
367   
368    // ¸¢¸Â¥¨¥é¡¼Åù¤¬È¯À¸¤·¤Æ¤¤¤Ê¤¤¾ì¹ç
369    if(!$err_file) {
370        $path = "../../data/Smarty/templates_c/admin";
371        if(!file_exists($path)) {
372            mkdir($path);
373        }
374        $path = "../upload/save_image";
375        if(!file_exists($path)) {
376            mkdir($path);
377        }
378        $path = "../upload/temp_image";
379        if(!file_exists($path)) {
380            mkdir($path);
381        }
382        $path = "../upload/graph_image";
383        if(!file_exists($path)) {
384            mkdir($path);
385        }
386        $path = "../upload/csv";
387        if(!file_exists($path)) {
388            mkdir($path);
389        }
390        $path = "../../data/downloads/module";
391        if(!file_exists($path)) {
392            mkdir($path);
393        }
394        $path = "../../data/downloads/update";
395        if(!file_exists($path)) {
396            mkdir($path);
397        }       
398    }
399   
400    $objPage->mess = $mess;
401    $objPage->err_file = $err_file;
402
403    return $objPage;
404}
405
406
407// STEP0_1²èÌ̤Îɽ¼¨(¥Õ¥¡¥¤¥ë¤Î¥³¥Ô¡¼)
408function lfDispStep0_1($objPage) {
409    global $objWebParam;
410    global $objDBParam;
411    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
412    $objPage->arrHidden = $objWebParam->getHashArray();
413    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
414    $objPage->arrHidden = array_merge($objPage->arrHidden, $objDBParam->getHashArray());
415    $objPage->arrHidden['db_skip'] = $_POST['db_skip'];
416    $objPage->tpl_mainpage = 'step0_1.tpl';
417    $objPage->tpl_mode = 'step0_1';
418    // ¥Õ¥¡¥¤¥ë¥³¥Ô¡¼
419    $objPage->copy_mess = sfCopyDir("./user_data/", "../user_data/", $objPage->copy_mess);
420    $objPage->copy_mess = sfCopyDir("./save_image/", "../upload/save_image/", $objPage->copy_mess);
421    return $objPage;
422}
423
424function lfGetFileMode($path) {
425    $mode = substr(sprintf('%o', fileperms($path)), -3);
426    return $mode;
427}
428
429// STEP1²èÌ̤Îɽ¼¨
430function lfDispStep1($objPage) {
431    global $objDBParam;
432    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
433    $objPage->arrHidden = $objDBParam->getHashArray();
434    $objPage->arrHidden['db_skip'] = $_POST['db_skip'];
435    $objPage->tpl_mainpage = 'step1.tpl';
436    $objPage->tpl_mode = 'step1';
437    return $objPage;
438}
439
440// STEP2²èÌ̤Îɽ¼¨
441function lfDispStep2($objPage) {
442    global $objWebParam;
443    global $objDBParam;
444    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
445    $objPage->arrHidden = $objWebParam->getHashArray();
446    $objPage->arrHidden['db_skip'] = $_POST['db_skip'];
447    $objPage->tpl_mainpage = 'step2.tpl';
448    $objPage->tpl_mode = 'step2';
449    return $objPage;
450}
451
452// STEP3²èÌ̤Îɽ¼¨
453function lfDispStep3($objPage) {
454    global $objWebParam;
455    global $objDBParam;
456    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
457    $objPage->arrHidden = $objWebParam->getHashArray();
458    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
459    $objPage->arrHidden = array_merge($objPage->arrHidden, $objDBParam->getHashArray());
460    $objPage->tpl_db_skip = $_POST['db_skip'];
461    $objPage->tpl_mainpage = 'step3.tpl';
462    $objPage->tpl_mode = 'step3';
463    return $objPage;
464}
465
466// STEP4²èÌ̤Îɽ¼¨
467function lfDispStep4($objPage) {
468    global $objWebParam;
469    global $objDBParam;
470    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
471    $objPage->arrHidden = $objWebParam->getHashArray();
472    $objPage->arrHidden = array_merge($objPage->arrHidden, $objDBParam->getHashArray());
473    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
474
475    $normal_url = $objWebParam->getValue('normal_url');
476    // ¸ìÈø¤Ë'/'¤ò¤Ä¤±¤ë
477    if (!ereg("/$", $normal_url)) $normal_url = $normal_url . "/";
478
479    $arrDbParam = $objDBParam->getHashArray();
480    $dsn = $arrDbParam['db_type']."://".$arrDbParam['db_user'].":".$arrDbParam['db_password']."@".$arrDbParam['db_server'].":".$arrDbParam['db_port']."/".$arrDbParam['db_name'];
481
482    $objPage->tpl_site_url = $normal_url;
483    $objPage->tpl_shop_name = $objWebParam->getValue('shop_name');
484    $objPage->tpl_cube_ver = ECCUBE_VERSION;
485    $objPage->tpl_php_ver = phpversion();
486    $objPage->tpl_db_ver = sfGetDBVersion($dsn);
487    $objPage->tpl_db_skip = $_POST['db_skip'];
488    $objPage->tpl_mainpage = 'step4.tpl';
489    $objPage->tpl_mode = 'complete';
490    return $objPage;
491}
492
493// ´°Î»²èÌ̤Îɽ¼¨
494function lfDispComplete($objPage) {
495    global $objWebParam;
496    global $objDBParam;
497    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
498    $objPage->arrHidden = $objWebParam->getHashArray();
499    // hidden¤ËÆþÎÏÃͤòÊÝ»ý
500    $objPage->arrHidden = array_merge($objPage->arrHidden, $objDBParam->getHashArray());
501    $objPage->arrHidden['db_skip'] = $_POST['db_skip'];
502    $objPage->tpl_mainpage = 'complete.tpl';
503    $objPage->tpl_mode = 'complete';
504   
505    $secure_url = $objWebParam->getValue('secure_url');
506    // ¸ìÈø¤Ë'/'¤ò¤Ä¤±¤ë
507    if (!ereg("/$", $secure_url)) {
508        $secure_url = $secure_url . "/";
509    }
510    $objPage->tpl_sslurl = $secure_url;     
511    return $objPage;
512}
513
514// WEB¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
515function lfInitWebParam($objWebParam) {
516   
517    if(defined('HTML_PATH')) {
518        $install_dir = HTML_PATH;
519    } else {
520        $install_dir = realpath(dirname( __FILE__) . "/../") . "/";
521    }
522   
523    if(defined('SITE_URL')) {
524        $normal_url = SITE_URL;
525    } else {
526        $dir = ereg_replace("install/.*$", "", $_SERVER['REQUEST_URI']);
527        $normal_url = "http://" . $_SERVER['HTTP_HOST'] . $dir;
528    }
529   
530    if(defined('SSL_URL')) {
531        $secure_url = SSL_URL;
532    } else {
533        $dir = ereg_replace("install/.*$", "", $_SERVER['REQUEST_URI']);
534        $secure_url = "http://" . $_SERVER['HTTP_HOST'] . $dir;
535    }
536
537    // Ź̾¡¢´ÉÍý¼Ô¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò¼èÆÀ¤¹¤ë¡£(ºÆ¥¤¥ó¥¹¥È¡¼¥ë»þ)
538    if(defined('DEFAULT_DSN')) {
539        $ret = sfTabaleExists("dtb_baseinfo", DEFAULT_DSN);
540        if($ret) {
541            $objQuery = new SC_Query();
542            $arrRet = $objQuery->select("shop_name, email01", "dtb_baseinfo");
543            $shop_name = $arrRet[0]['shop_name'];
544            $admin_mail = $arrRet[0]['email01'];
545        }
546    }
547
548    $objWebParam->addParam("Ź̾", "shop_name", MTEXT_LEN, "", array("EXIST_CHECK","MAX_LENGTH_CHECK"), $shop_name);
549    $objWebParam->addParam("´ÉÍý¼Ô¡§¥á¡¼¥ë¥¢¥É¥ì¥¹", "admin_mail", MTEXT_LEN, "", array("EXIST_CHECK","EMAIL_CHECK","EMAIL_CHAR_CHECK","MAX_LENGTH_CHECK"), $admin_mail);
550    $objWebParam->addParam("´ÉÍý¼Ô¡§¥í¥°¥¤¥óID", "login_id", MTEXT_LEN, "", array("EXIST_CHECK","EXIST_CHECK", "ALNUM_CHECK"));
551    $objWebParam->addParam("´ÉÍý¼Ô¡§¥Ñ¥¹¥ï¡¼¥É", "login_pass", MTEXT_LEN, "", array("EXIST_CHECK","EXIST_CHECK", "ALNUM_CHECK"));
552    $objWebParam->addParam("¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê", "install_dir", MTEXT_LEN, "", array("EXIST_CHECK","MAX_LENGTH_CHECK"), $install_dir);
553    $objWebParam->addParam("URL(Ä̾ï)", "normal_url", MTEXT_LEN, "", array("EXIST_CHECK","URL_CHECK","MAX_LENGTH_CHECK"), $normal_url);
554    $objWebParam->addParam("URL(¥»¥­¥å¥¢)", "secure_url", MTEXT_LEN, "", array("EXIST_CHECK","URL_CHECK","MAX_LENGTH_CHECK"), $secure_url);
555    $objWebParam->addParam("¥É¥á¥¤¥ó", "domain", MTEXT_LEN, "", array("MAX_LENGTH_CHECK"));
556   
557    return $objWebParam;
558}
559
560// DB¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
561function lfInitDBParam($objDBParam) {
562       
563    if(defined('DB_SERVER')) {
564        $db_server = DB_SERVER;
565    } else {
566        $db_server = "127.0.0.1";
567    }
568   
569    if(defined('DB_TYPE')) {
570        $db_type = DB_TYPE;
571    } else {
572        $db_type = "";
573    }
574   
575    if(defined('DB_PORT')) {
576        $db_port = DB_PORT;
577    } else {
578        $db_port = "";
579    }
580       
581    if(defined('DB_NAME')) {
582        $db_name = DB_NAME;
583    } else {
584        $db_name = "eccube_db";
585    }
586       
587    if(defined('DB_USER')) {
588        $db_user = DB_USER;
589    } else {
590        $db_user = "eccube_db_user";               
591    }
592           
593    $objDBParam->addParam("DB¤Î¼ïÎà", "db_type", INT_LEN, "", array("EXIST_CHECK","MAX_LENGTH_CHECK"), $db_type);
594    $objDBParam->addParam("DB¥µ¡¼¥Ð", "db_server", MTEXT_LEN, "", array("EXIST_CHECK","MAX_LENGTH_CHECK"), $db_server);
595    $objDBParam->addParam("DB¥Ý¡¼¥È", "db_port", INT_LEN, "", array("MAX_LENGTH_CHECK"), $db_port);
596    $objDBParam->addParam("DB̾", "db_name", MTEXT_LEN, "", array("EXIST_CHECK","MAX_LENGTH_CHECK"), $db_name);
597    $objDBParam->addParam("DB¥æ¡¼¥¶", "db_user", MTEXT_LEN, "", array("EXIST_CHECK","MAX_LENGTH_CHECK"), $db_user);
598    $objDBParam->addParam("DB¥Ñ¥¹¥ï¡¼¥É", "db_password", MTEXT_LEN, "", array("EXIST_CHECK","MAX_LENGTH_CHECK"));   
599       
600    return $objDBParam;
601}
602
603// ÆþÎÏÆâÍÆ¤Î¥Á¥§¥Ã¥¯
604function lfCheckWebError($objFormParam) {
605    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
606    $arrRet =  $objFormParam->getHashArray();
607    $objErr = new SC_CheckError($arrRet);
608    $objErr->arrErr = $objFormParam->checkError();
609   
610    // ¥Ç¥£¥ì¥¯¥È¥ê̾¤Î¤ß¼èÆÀ¤¹¤ë
611    $normal_dir = ereg_replace("^https?://[a-zA-Z0-9_~=&\?\.\-]+", "", $arrRet['normal_url']);
612    $secure_dir = ereg_replace("^https?://[a-zA-Z0-9_~=&\?\.\-]+", "", $arrRet['secure_url']);
613   
614    if($normal_dir != $secure_dir) {
615        $objErr->arrErr['normal_url'] = "URL¤Ë°Û¤Ê¤ë³¬Áؤò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£";
616        $objErr->arrErr['secure_url'] = "URL¤Ë°Û¤Ê¤ë³¬Áؤò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£";     
617    }
618   
619    // ¥í¥°¥¤¥óID¥Á¥§¥Ã¥¯
620    $objErr->doFunc(array("´ÉÍý¼Ô¡§¥í¥°¥¤¥óID",'login_id',ID_MIN_LEN , ID_MAX_LEN) ,array("NUM_RANGE_CHECK"));
621   
622    // ¥Ñ¥¹¥ï¡¼¥É¤Î¥Á¥§¥Ã¥¯
623    $objErr->doFunc( array("´ÉÍý¼Ô¡§¥Ñ¥¹¥ï¡¼¥É",'login_pass',4 ,15 ) ,array( "NUM_RANGE_CHECK" ) );
624   
625    return $objErr->arrErr;
626}
627
628// ÆþÎÏÆâÍÆ¤Î¥Á¥§¥Ã¥¯
629function lfCheckDBError($objFormParam) {
630    global $objPage;
631   
632    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
633    $arrRet =  $objFormParam->getHashArray();
634   
635    $objErr = new SC_CheckError($arrRet);
636    $objErr->arrErr = $objFormParam->checkError();
637   
638    if(count($objErr->arrErr) == 0) {
639        // Àܳ³Îǧ
640        $dsn = $arrRet['db_type']."://".$arrRet['db_user'].":".$arrRet['db_password']."@".$arrRet['db_server'].":".$arrRet['db_port']."/".$arrRet['db_name'];
641        // Debug¥â¡¼¥É»ØÄê
642        $options['debug'] = PEAR_DB_DEBUG;
643        $objDB = DB::connect($dsn, $options);
644        // ÀܳÀ®¸ù
645        if(!PEAR::isError($objDB)) {
646            // ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤Î¼èÆÀ
647            $objPage->tpl_db_version = sfGetDBVersion($dsn);           
648        } else {
649            $objErr->arrErr['all'] = ">> " . $objDB->message . "<br>";
650            // ¥¨¥é¡¼Ê¸¤ò¼èÆÀ¤¹¤ë
651            ereg("\[(.*)\]", $objDB->userinfo, $arrKey);
652            $objErr->arrErr['all'].= $arrKey[0] . "<br>";
653            gfPrintLog($objDB->userinfo, INSTALL_LOG);
654        }
655    }
656    return $objErr->arrErr;
657}
658
659// SQLʸ¤Î¼Â¹Ô
660function lfExecuteSQL($filepath, $dsn, $disp_err = true) {
661    $arrErr = array();
662   
663    if(!file_exists($filepath)) {
664        $arrErr['all'] = ">> ¥¹¥¯¥ê¥×¥È¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó";
665    } else {
666        if($fp = fopen($filepath,"r")) {
667            $sql = fread($fp, filesize($filepath));
668            fclose($fp);
669        }
670        // Debug¥â¡¼¥É»ØÄê
671        $options['debug'] = PEAR_DB_DEBUG;
672        $objDB = DB::connect($dsn, $options);
673        // Àܳ¥¨¥é¡¼
674        if(!PEAR::isError($objDB)) {
675            // ²þ¹Ô¡¢¥¿¥Ö¤ò1¥¹¥Ú¡¼¥¹¤ËÊÑ´¹
676            $sql = preg_replace("/[\r\n\t]/"," ",$sql);
677            $sql_split = split(";",$sql);
678            foreach($sql_split as $key => $val){
679                if (trim($val) != "") {
680                    $ret = $objDB->query($val);
681                    if(PEAR::isError($ret) && $disp_err) {
682                        $arrErr['all'] = ">> " . $ret->message . "<br>";
683                        // ¥¨¥é¡¼Ê¸¤ò¼èÆÀ¤¹¤ë
684                        ereg("\[(.*)\]", $ret->userinfo, $arrKey);
685                        $arrErr['all'].= $arrKey[0] . "<br>";
686                        $objPage->update_mess.=">> ¥Æ¡¼¥Ö¥ë¹½À®¤ÎÊѹ¹¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£<br>";
687                        gfPrintLog($ret->userinfo, INSTALL_LOG);
688                    }
689                }
690            }           
691        } else {
692            $arrErr['all'] = ">> " . $objDB->message;
693            gfPrintLog($objDB->userinfo, INSTALL_LOG);
694        }
695    }
696    return $arrErr;
697}
698
699// ÀßÄê¥Õ¥¡¥¤¥ë¤ÎºîÀ®
700function lfMakeConfigFile() {
701    global $objWebParam;
702    global $objDBParam;
703   
704    $root_dir = $objWebParam->getValue('install_dir');
705    // ¸ìÈø¤Ë'/'¤ò¤Ä¤±¤ë
706    if (!ereg("/$", $root_dir)) {
707        $root_dir = $root_dir . "/";
708    }
709   
710    $normal_url = $objWebParam->getValue('normal_url');
711    // ¸ìÈø¤Ë'/'¤ò¤Ä¤±¤ë
712    if (!ereg("/$", $normal_url)) {
713        $normal_url = $normal_url . "/";
714    }
715   
716    $secure_url = $objWebParam->getValue('secure_url');
717    // ¸ìÈø¤Ë'/'¤ò¤Ä¤±¤ë
718    if (!ereg("/$", $secure_url)) {
719        $secure_url = $secure_url . "/";
720    }
721   
722    // ¥Ç¥£¥ì¥¯¥È¥ê¤Î¼èÆÀ
723    $url_dir = ereg_replace("^https?://[a-zA-Z0-9_~=&\?\.\-]+", "", $normal_url);
724   
725    $data_path = $root_dir . "../data/";
726    $filepath = $data_path . "install.inc";
727   
728    $config_data =
729    "<?php\n".
730    "    define ('ECCUBE_INSTALL', 'ON');\n" .
731    "    define ('HTML_PATH', '" . $root_dir . "');\n" .     
732    "    define ('SITE_URL', '" . $normal_url . "');\n" .
733    "    define ('SSL_URL', '" . $secure_url . "');\n" .
734    "    define ('URL_DIR', '" . $url_dir . "');\n" .   
735    "    define ('DOMAIN_NAME', '" . $objWebParam->getValue('domain') . "');\n" .
736    "    define ('DB_TYPE', '" . $objDBParam->getValue('db_type') . "');\n" .
737    "    define ('DB_USER', '" . $objDBParam->getValue('db_user') . "');\n" .
738    "    define ('DB_PASSWORD', '" . $objDBParam->getValue('db_password') . "');\n" .
739    "    define ('DB_SERVER', '" . $objDBParam->getValue('db_server') . "');\n" .
740    "    define ('DB_NAME', '" . $objDBParam->getValue('db_name') . "');\n" .
741    "    define ('DB_PORT', '" . $objDBParam->getValue('db_port') .  "');\n" .
742    "    define ('DATA_PATH', '".$data_path."');\n" .
743    "?>";
744   
745    if($fp = fopen($filepath,"w")) {
746        fwrite($fp, $config_data);
747        fclose($fp);
748    }
749
750    // ¥â¥Ð¥¤¥ëÈǤÎÀßÄê¥Õ¥¡¥¤¥ë install_mobile.inc ¤òºîÀ®¤¹¤ë¡£
751    $filepath = $data_path . "install_mobile.inc";
752   
753    $config_data =
754    "<?php\n".
755    "    define ('ECCUBE_INSTALL', 'ON');\n" .
756    "    define ('HTML_PATH', '" . $root_dir . "mobile/');\n" . 
757    "    define ('PC_HTML_PATH', '" . $root_dir . "');\n" . 
758    "    define ('SITE_URL', '" . $normal_url . "mobile/');\n" .
759    "    define ('PC_SITE_URL', '" . $normal_url . "');\n" .
760    "    define ('SSL_URL', '" . $secure_url . "mobile/');\n" .
761    "    define ('PC_SSL_URL', '" . $secure_url . "');\n" .
762    "    define ('URL_DIR', '" . $url_dir . "mobile/');\n" .   
763    "    define ('PC_URL_DIR', '" . $url_dir . "');\n" .   
764    "    define ('DOMAIN_NAME', '" . $objWebParam->getValue('domain') . "');\n" .
765    "    define ('DB_TYPE', '" . $objDBParam->getValue('db_type') . "');\n" .
766    "    define ('DB_USER', '" . $objDBParam->getValue('db_user') . "');\n" .
767    "    define ('DB_PASSWORD', '" . $objDBParam->getValue('db_password') . "');\n" .
768    "    define ('DB_SERVER', '" . $objDBParam->getValue('db_server') . "');\n" .
769    "    define ('DB_NAME', '" . $objDBParam->getValue('db_name') . "');\n" .
770    "    define ('DB_PORT', '" . $objDBParam->getValue('db_port') .  "');\n" .
771    "    define ('DATA_PATH', '".$data_path."');\n" .
772    "?>";
773   
774    if($fp = fopen($filepath,"w")) {
775        fwrite($fp, $config_data);
776        fclose($fp);
777    }
778}
779
780// ¥Æ¡¼¥Ö¥ë¤ÎÄɲáʴû¤Ë¥Æ¡¼¥Ö¥ë¤¬Â¸ºß¤¹¤ë¾ì¹ç¤ÏºîÀ®¤·¤Ê¤¤¡Ë
781function lfAddTable($table_name, $dsn) {
782    $arrErr = array();
783    if(!sfTabaleExists($table_name, $dsn)) {
784        list($db_type) = split(":", $dsn);
785        $sql_path = "./sql/add/". $table_name . "_" .$db_type .".sql";
786        $arrErr = lfExecuteSQL($sql_path, $dsn);
787    }
788    return $arrErr;
789}
790
791// ¥Æ¡¼¥Ö¥ë¤Îºï½ü¡Ê´û¤Ë¥Æ¡¼¥Ö¥ë¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Î¤ßºï½ü¤¹¤ë¡Ë
792function lfDropTable($table_name, $dsn) {
793    $arrErr = array();
794    if(sfTabaleExists($table_name, $dsn)) {
795        // Debug¥â¡¼¥É»ØÄê
796        $options['debug'] = PEAR_DB_DEBUG;
797        $objDB = DB::connect($dsn, $options);
798        // ÀܳÀ®¸ù
799        if(!PEAR::isError($objDB)) {
800            $objDB->query("DROP TABLE " . $table_name);
801        } else {
802            $arrErr['all'] = ">> " . $objDB->message . "<br>";
803            // ¥¨¥é¡¼Ê¸¤ò¼èÆÀ¤¹¤ë
804            ereg("\[(.*)\]", $objDB->userinfo, $arrKey);
805            $arrErr['all'].= $arrKey[0] . "<br>";
806            gfPrintLog($objDB->userinfo, INSTALL_LOG);
807        }
808    }
809    return $arrErr;
810}
811
812// ¥«¥é¥à¤ÎÄɲáʴû¤Ë¥«¥é¥à¤¬Â¸ºß¤¹¤ë¾ì¹ç¤ÏºîÀ®¤·¤Ê¤¤¡Ë
813function lfAddColumn($dsn) {
814    global $objDBParam;
815
816    // ¼õÃí¥Æ¡¼¥Ö¥ë
817    sfColumnExists("dtb_order", "memo01", "text", $dsn, true); 
818    sfColumnExists("dtb_order", "memo02", "text", $dsn, true);
819    sfColumnExists("dtb_order", "memo03", "text", $dsn, true);
820    sfColumnExists("dtb_order", "memo04", "text", $dsn, true);
821    sfColumnExists("dtb_order", "memo05", "text", $dsn, true);
822    sfColumnExists("dtb_order", "memo06", "text", $dsn, true);
823    sfColumnExists("dtb_order", "memo07", "text", $dsn, true);
824    sfColumnExists("dtb_order", "memo08", "text", $dsn, true);
825    sfColumnExists("dtb_order", "memo09", "text", $dsn, true);
826    sfColumnExists("dtb_order", "memo10", "text", $dsn, true);
827
828    // ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë
829    sfColumnExists("dtb_order_temp", "order_id", "text", $dsn, true);   
830    sfColumnExists("dtb_order_temp", "memo01", "text", $dsn, true);
831    sfColumnExists("dtb_order_temp", "memo02", "text", $dsn, true);
832    sfColumnExists("dtb_order_temp", "memo03", "text", $dsn, true);
833    sfColumnExists("dtb_order_temp", "memo04", "text", $dsn, true);
834    sfColumnExists("dtb_order_temp", "memo05", "text", $dsn, true);
835    sfColumnExists("dtb_order_temp", "memo06", "text", $dsn, true);
836    sfColumnExists("dtb_order_temp", "memo07", "text", $dsn, true);
837    sfColumnExists("dtb_order_temp", "memo08", "text", $dsn, true);
838    sfColumnExists("dtb_order_temp", "memo09", "text", $dsn, true);
839    sfColumnExists("dtb_order_temp", "memo10", "text", $dsn, true);
840
841    // »Ùʧ¾ðÊ󥯡¼¥Ö¥ë
842    sfColumnExists("dtb_payment", "charge_flg", "int2 default 1", $dsn, true); 
843    sfColumnExists("dtb_payment", "rule_min", "numeric", $dsn, true);   
844    sfColumnExists("dtb_payment", "upper_rule_max", "numeric", $dsn, true);
845    sfColumnExists("dtb_payment", "module_id", "int4", $dsn, true);
846    sfColumnExists("dtb_payment", "module_path", "text", $dsn, true);
847    sfColumnExists("dtb_payment", "memo01", "text", $dsn, true);   
848    sfColumnExists("dtb_payment", "memo02", "text", $dsn, true);
849    sfColumnExists("dtb_payment", "memo03", "text", $dsn, true);
850    sfColumnExists("dtb_payment", "memo04", "text", $dsn, true);
851    sfColumnExists("dtb_payment", "memo05", "text", $dsn, true);
852    sfColumnExists("dtb_payment", "memo06", "text", $dsn, true);
853    sfColumnExists("dtb_payment", "memo07", "text", $dsn, true);
854    sfColumnExists("dtb_payment", "memo08", "text", $dsn, true);
855    sfColumnExists("dtb_payment", "memo09", "text", $dsn, true);
856    sfColumnExists("dtb_payment", "memo10", "text", $dsn, true);
857
858    // ¸ÜµÒ
859    if (!sfColumnExists("dtb_customer", "mobile_phone_id", "", $dsn)) {
860        sfColumnExists("dtb_customer", "mobile_phone_id", "text", $dsn, true);
861        $objQuery = new SC_Query($dsn);
862        if ($objDBParam->getValue('db_type') == 'mysql') {
863            $objQuery->query("CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(64))");
864        } else {
865            $objQuery->query("CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id)");
866        }
867    }
868
869    // ¸ÜµÒ¥á¡¼¥ë
870    if ($objDBParam->getValue('db_type') == 'mysql') {
871        sfColumnExists("dtb_customer_mail", "secret_key", "varchar(50) unique", $dsn, true);
872    } else {
873        sfColumnExists("dtb_customer_mail", "secret_key", "text unique", $dsn, true);
874    }
875}
876
877?>
Note: See TracBrowser for help on using the repository browser.