當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Ftp::logout方法代碼示例

本文整理匯總了PHP中Ftp::logout方法的典型用法代碼示例。如果您正苦於以下問題:PHP Ftp::logout方法的具體用法?PHP Ftp::logout怎麽用?PHP Ftp::logout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Ftp的用法示例。


在下文中一共展示了Ftp::logout方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getFtpFiles

/**
 * 
 * @param type $from
 * @return type 
 */
function getFtpFiles($from)
{
    $info = pathinfo($from);
    $name = trim($info['basename']);
    $ftpCon = new Ftp(FTP_HOST, FTP_USER, FTP_PASS, FTP_PORT);
    $content_download = FALSE;
    $connected = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
    if ($connected === TRUE) {
        $to = TMP_QR_DIR . "/" . $name;
        $downloaded = $ftpCon->bajar_r($from, $to, FTP_CONN_RETRIES);
        if ($downloaded === TRUE) {
            $content_download = TRUE;
        } else {
            $content_download = FALSE;
        }
    } else {
        $content_download = FALSE;
    }
    $ftpCon->logout();
    return $content_download;
}
開發者ID:vallejos,項目名稱:samples,代碼行數:26,代碼來源:functions.php

示例2: crearImagen

             }
             if ($bajado === TRUE) {
                 $origen_file = $to;
                 $destino_file = $tmpDir . "/" . $video->getPreviewFilename();
                 $width = 100;
                 $height = 100;
                 $background = FALSE;
                 $extension = ".gif";
                 crearImagen($to, $destino_file, $width, $height, $background, $extension);
                 unlink($origen_file);
                 $content_download = TRUE;
             } else {
                 echo "ERROR: descargando el preview del ftp\n";
                 exit;
             }
             $ftpConUSA->logout();
         } else {
             echo "ERROR: descargando el contenido {$from} del ftp a {$to}\n";
             exit;
         }
     } else {
         echo "ERROR: no se puede loguear al ftp\n";
     }
     if ($content_download === TRUE) {
         // obtengo y genero el XML
         $xmlContent .= $video->genXML();
         $total++;
     } else {
         $log .= " ";
     }
 } catch (Exception $e) {
開發者ID:vallejos,項目名稱:samples,代碼行數:31,代碼來源:process-video.php

示例3: limpiarCagadas

function limpiarCagadas($newId)
{
    extract($GLOBALS);
    print "<h4>Borrando archivos:</h4>";
    foreach ($_SESSION['subidos'] as $k) {
        $auxSvr = split("@", $k);
        $file = $auxSvr[0];
        $srvr = $auxSvr[1];
        print "<h4>Borrando registros</h4>";
        print "borrando: {$file}<br />";
        $ftp = new Ftp($servers[$srvr][0], $servers[$srvr][1], $servers[$srvr][2]);
        if (!$ftp->login()) {
            die("no se logueó");
        }
        if (!$ftp->borrar($file)) {
            print "No se pudo borrar: {$file}<br />";
            error("No se pudo borrar: {$file}", true);
        }
    }
    $sql = " DELETE FROM contenidos where id={$newId} LIMIT 1; ";
    $result = mysql_query($sql, $db);
    if (!$result) {
        error("Error al borrar el contenido {$newId} -  sql: {$sql}", true);
    }
    print "contenido {$newId} eliminado!\n";
    $sql = " DELETE FROM contcol_whitelist where contenido={$newId} LIMIT 1; ";
    $result = mysql_query($sql, $db);
    if (!$result) {
        error("Error al borrar de witelist {$newId} -  sql: {$sql}", true);
    }
    print "contenido {$newId} eliminado de whitelist!\n";
    $ftp->logout();
}
開發者ID:vallejos,項目名稱:samples,代碼行數:33,代碼來源:subirWallpapers.php


注:本文中的Ftp::logout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。