source: branches/comu/html/upgrade/index.php @ 2

Revision 2, 1.5 KB checked in by root, 17 years ago (diff)

new import

Line 
1<?php
2/*
3 * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8require_once("../require.php");
9
10//¥Ú¡¼¥¸´ÉÍý¥¯¥é¥¹
11class LC_Page {
12    //¥³¥ó¥¹¥È¥é¥¯¥¿
13    function LC_Page() {
14        //¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È¤Î»ØÄê
15        $this->tpl_mainpage = 'upgrade/index.tpl';
16    }
17}
18
19$objPage = new LC_Page();
20$objView = new SC_SiteView();
21
22$con = ftp_connect("localhost");
23$res = ftp_login($con, "osuser", "password");
24if($con != false && $res != false) {
25    //¥Õ¥¡¥¤¥ë¤Î¥À¥¦¥ó¥í¡¼¥É
26    if($_POST['filename'] != "") {
27       
28        $download_file = DATA_PATH . "module/upload/" . $_POST['filename'];
29       
30        if(ftp_get($con, $download_file, $_POST['filename'], FTP_BINARY)) {
31            ftp_quit($con);
32            //¥Õ¥¡¥¤¥ë½êÍ­¼ÔÊѹ¹
33            echo "¥Õ¥¡¥¤¥ë¤Î¥À¥¦¥ó¥í¡¼¥É¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£";
34            sfPrintR(exec("tar zxvf " . $download_file . " ./", $arrRes));
35        } else {
36            echo '¥Õ¥¡¥¤¥ë¤Î¥À¥¦¥ó¥í¡¼¥É¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£';
37        }
38    }
39   
40    //¥Ç¥£¥ì¥¯¥È¥êÆâ¤ÎÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò¼èÆÀ
41    $arrRet = ftp_nlist($con, ".");
42    $i = 0;
43    //ɬÍפʥե¡¥¤¥ë¾ðÊó¤ò¼èÆÀ
44    foreach($arrRet as $val) {
45        if(!ereg("^\.|^\..", $val)) {
46            $arrFile[$i]['filename'] = $val;
47            $arrFile[$i]['date'] = date("Yǯm·îdÆü", ftp_mdtm($con, $val));
48            $arrFile[$i]['filesize'] = number_format(ftp_size($con, $val))."Byte";
49            $i++;
50        }
51    }
52    $objPage->arrFile = $arrFile;
53}
54
55$objView->assignobj($objPage);      //ÊÑ¿ô¤ò¥Æ¥ó¥×¥ì¡¼¥È¤Ë¥¢¥µ¥¤¥ó¤¹¤ë
56$objView->display(SITE_FRAME);      //¥Æ¥ó¥×¥ì¡¼¥È¤Î½ÐÎÏ
57
58//-------------------------------------------------------------------------------------------------------
59
60
61
62?>
Note: See TracBrowser for help on using the repository browser.