Index: /branches/dev/data/include/ftp.php
===================================================================
--- /branches/dev/data/include/ftp.php	(revision 14367)
+++ /branches/dev/data/include/ftp.php	(revision 14367)
@@ -0,0 +1,104 @@
+<?php
+/*
+ * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ */
+/*
+    $host:FTP¥Û¥¹¥È
+    $user:FTP¥æ¡¼¥¶
+    $pass:FTP¥Ñ¥¹¥ï¡¼¥É
+    $dst_file:Á÷¿®Àè¥Õ¥¡¥¤¥ë¡ÊÁêÂÐ¥Ñ¥¹¡Ë
+    $src_file:Á÷¿®¸µ¥Õ¥¡¥¤¥ë¡ÊÀäÂÐ¥Ñ¥¹¡Ë
+ */
+function sfFtpCopy($host, $user, $pass, $dst_file, $src_file) {
+    // FTPÀÜÂ³
+    $conn_id = ftp_connect($host); 
+
+    // ÀÜÂ³³ÎÇ§
+    if((!$conn_id)) {
+        gfPrintLog("FTPÀÜÂ³¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£SERVER:" . $host);
+        return;
+    }
+    
+    // FTP¥í¥°¥¤¥ó
+    $login_result = ftp_login($conn_id, $user, $pass); 
+        
+    if ((!$login_result)) { 
+        gfPrintLog("FTP¥í¥°¥¤¥ó¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£USER:" . $user . " SERVER:" . $host);
+        return;
+    }
+    
+    // Á÷¿®¸µ¥Õ¥¡¥¤¥ë¤ÎÂ¸ºß¥Á¥§¥Ã¥¯
+    if (is_file($src_file)) {
+        
+        // ¥Õ¥¡¥¤¥ëÁ÷¿®
+        $upload = ftp_put($conn_id, $dst_file, $src_file, FTP_BINARY); 
+    } else {
+        gfPrintLog("FTPÁ÷¿®¸µ¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£" . $src_file);
+        return;
+    }
+    
+    // ¥Õ¥¡¥¤¥ë¥¢¥Ã¥×¥í¡¼¥É
+    if (!$upload) { 
+        gfPrintLog("¥¢¥Ã¥×¥í¡¼¥É¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£SERVER:" . $host . " " . $src_file . " -> " . $dst_file);
+    } else {
+        gfPrintLog("¥¢¥Ã¥×¥í¡¼¥É¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£SERVER:" . $host . " " . $src_file . " -> " . $dst_file);
+    }
+
+    // ÀÜÂ³¤òÊÄ¤¸¤ë 
+    ftp_close($conn_id);
+}
+
+function sfFtpDelete($host, $user, $pass, $dst_file) {
+    // FTPÀÜÂ³
+    $conn_id = @ftp_connect($host); 
+    
+    // ÀÜÂ³³ÎÇ§
+    if((!$conn_id)) {
+        gfPrintLog("FTPÀÜÂ³¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£SERVER:" . $host);
+        return;
+    }
+    
+    // FTP¥í¥°¥¤¥ó
+    $login_result = @ftp_login($conn_id, $user, $pass); 
+    
+    if ((!$login_result)) { 
+        gfPrintLog("FTP¥í¥°¥¤¥ó¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£USER:" . $user . " SERVER:" . $host);
+        return;
+    }
+        
+    // ¥Õ¥¡¥¤¥ëºï½ü
+    if (@ftp_delete($conn_id, $dst_file)) { 
+        gfPrintLog("¥Õ¥¡¥¤¥ëºï½ü¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£SERVER:" . $host . " " . $dst_file);
+    } else {
+        gfPrintLog("¥Õ¥¡¥¤¥ëºï½ü¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£SERVER:" . $host . " " . $dst_file);
+    }
+    
+    // ÀÜÂ³¤òÊÄ¤¸¤ë 
+    ftp_close($conn_id);
+}
+
+ /* 
+ * ´Ø¿ôÌ¾ ¡§sfFtpExist
+ * °ú¿ô1¡¡:FTP¥Û¥¹¥È
+ * $user:FTP¥æ¡¼¥¶
+ * $pass:FTP¥Ñ¥¹¥ï¡¼¥É
+ * $file_path:¥Õ¥¡¥¤¥ë¥Ñ¥¹
+ * Ìá¤êÃÍ¡§Â¸ºß¤·¤¿¤étrueÌµ¤«¤Ã¤¿¤éfalse¤òÊÖ¤¹
+ * ÀâÌÀ¡¡¡§FTP¤¹¤ë¥µ¡¼¥Ð¤Ë¥Õ¥¡¥¤¥ë¤¬Ìµ¤¤¤«Ä´ºº¤¹¤ë
+ */
+ function sfFtpExist($host, $user, $pass, $file_path) {
+
+    $conn_id = ftp_connect($host);
+    $login_result = ftp_login($conn_id, $user, $pass);
+    $res = ftp_size($conn_id, $file_path);
+
+    // Ìá¤êÃÍ¤¬-1¤Ê¤é¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤
+    if($res == -1) {
+        return false;
+    }
+        
+    return true;
+}
+?>
