source: temp/trunk/html/upgrade/index.php @ 1328

Revision 1328, 1.4 KB checked in by naka, 20 years ago (diff)

* empty log message *

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