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


PHP Ftp::bajar_r方法代碼示例

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


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

     $wallpaper->loadContent($contentId);
 } catch (Exception $e) {
     $log .= "loadContent: " . $e->getMessage() . "\n";
 }
 try {
     $content_download = FALSE;
     $wallpaper->setTag($catmig);
     // descargo contenido por FTP
     $log .= "\tdescargando contenido...\n";
     $ftpCon = new Ftp();
     $retries = 0;
     $conectado = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
     if ($conectado === TRUE) {
         $to = TMP_DIR_WP . "/" . $wallpaper->getContentFilename();
         $from = $wallpaper->getContent();
         $bajado = $ftpCon->bajar_r($from, $to, FTP_DOWN_RETRIES);
         if ($bajado === TRUE) {
             $log .= "\tdescargando preview (gif)...\n";
             $to = TMP_DIR_WP . "/preview_tmp.gif";
             $from = $wallpaper->getPreview();
             $bajado = $ftpCon->bajar_r($from, $to, FTP_DOWN_RETRIES);
             if ($bajado === TRUE) {
                 $origen_file = $to;
                 $destino_file = TMP_DIR_WP . "/" . $wallpaper->getPreviewFilename();
                 $width = 100;
                 $height = 100;
                 $background = FALSE;
                 $extension = ".gif";
                 crearImagen($to, $destino_file, $width, $height, $background, $extension);
                 unlink($origen_file);
                 $content_download = TRUE;
開發者ID:vallejos,項目名稱:samples,代碼行數:31,代碼來源:process-wallpaper.php

示例3: generateThumbnail

 private function generateThumbnail()
 {
     $ftpCon = new Ftp(FTP_USA, FTP_USA_USR, FTP_USA_PWD);
     $connected = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
     if (!$connected) {
         return false;
     }
     $from = str_replace("%RESOLUTION%", PREVIEW_WIDTH . "x" . PREVIEW_HEIGHT, $this->getPreview());
     $from = str_replace("contenido", "netuy", $from);
     $from = "/www.wazzup.com.uy" . $from;
     $this->thumbnailFilename = "thumbnail" . str_replace(" ", "_", sanitizeString($this->title)) . ".gif";
     $tmp = $this->dirToWrite . "/" . $this->thumbnailFilename;
     //echo "thumb $from => $tmp";
     $bajado = $ftpCon->bajar_r($from, $tmp, FTP_DOWN_RETRIES);
     return $bajado;
 }
開發者ID:vallejos,項目名稱:samples,代碼行數:16,代碼來源:migGame.class.php

示例4: getFtpFiles

function getFtpFiles($archivo)
{
    global $dirToWrite;
    $info = pathinfo($archivo);
    $toJad = $info['basename'];
    $toJar = str_replace(".jad", ".jar", $toJad);
    $ftpCon = new Ftp();
    $i = 0;
    $jad = str_replace("netuy", "contenido", $archivo);
    $jar = str_replace(".jad", ".jar", $jad);
    $conectado = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
    if ($conectado === TRUE) {
        $to = $tmpDir . "/" . $toJad;
        echo "descargando jad <b>{$jad}</b> => <b>{$to}</b>...<br/>";
        $bajado = $ftpCon->bajar_r($jad, $to, FTP_DOWN_RETRIES);
        if ($bajado === TRUE) {
            echo "jad Ok!<br/>";
            $to = $tmpDir . "/" . $toJar;
            echo "descargando jar {$jar} => {$to}...<br/>";
            $bajado = $ftpCon->bajar_r($jar, $to, FTP_DOWN_RETRIES);
            if ($bajado === TRUE) {
                echo "jar Ok!<br/>";
                $content_download = TRUE;
            } else {
                // jar no encontrado; intentando leer jar del jad
                $jadLines = file($toJad);
                $jarName = getJarNamefromJad($jadLines);
                $pathName = pathinfo($jar);
                $newJar = $pathName['dirname'] . "/" . $jarName;
                echo "jar {$jar} no encontrado...<br/>";
                echo "intentando {$newJar}...<br/>";
                $bajado = $ftpCon->bajar_r($newJar, $toJar, FTP_DOWN_RETRIES);
                if ($bajado === TRUE) {
                    echo "jar {$newJar} Ok!<br/>";
                    $content_download = TRUE;
                } else {
                    echo "ERROR: descargando el jar '{$newJar}' del ftp<br/>";
                    exit;
                }
            }
        } else {
            $log .= "jad {$jad} not found...<br/>";
            echo "ERROR: descargando el jad '{$jad}' del ftp<br/>";
            exit;
        }
        $bajado = FALSE;
    } else {
        echo "ERROR: no se puede conectar al ftp<br/>";
    }
    if ($content_download === TRUE) {
        return TRUE;
    } else {
        return FALSE;
    }
}
開發者ID:vallejos,項目名稱:samples,代碼行數:55,代碼來源:functions.php

示例5: generateThumbnail

 private function generateThumbnail()
 {
     $ftpCon = new Ftp(FTP_USA, FTP_USA_USR, FTP_USA_PWD);
     $connected = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
     if (!$connected) {
         return false;
     }
     $from = str_replace("%RESOLUTION%", PREVIEW_WIDTH . "x" . PREVIEW_HEIGHT, $this->getContent());
     $from = str_replace("contenido", "netuy", $from);
     //echo "Bajando FROM: $from";
     $tmp = $this->dirToWrite . "/thumbnail" . sanitizeString($this->title) . ".gif";
     $bajado = $ftpCon->bajar_r($from, $tmp, FTP_DOWN_RETRIES);
     return $bajado;
 }
開發者ID:vallejos,項目名稱:samples,代碼行數:14,代碼來源:migWallpaper.class_2.php

示例6: foreach

 $conectado = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
 if ($conectado === TRUE) {
     echo "+ connection Ok!";
     $download_errors = 0;
     foreach ($juegos as $archivo) {
         //				$modelId = $datos["idcel"];
         //				$archivo = getArchivo($dbc, $modelId, $contentId);
         $jad = str_replace("netuy", "contenido", $archivo);
         $jar = str_replace(".jad", ".jar", $jad);
         $info = pathinfo($jad);
         $toJadName = $info['basename'];
         $info = pathinfo($jar);
         $toJarName = $info['basename'];
         $to = $dirToWrite . "/" . $toJadName;
         echo "<li>descargando jad <b>{$jad}</b> => <b>{$to}</b>...</li>";
         $bajado = $ftpCon->bajar_r($jad, $to, FTP_DOWN_RETRIES);
         if ($bajado === TRUE) {
             echo "+ jad Ok!<br/>";
             $to = $dirToWrite . "/" . $toJarName;
             echo "<li>descargando jar <b>{$jar}</b> => <b>{$to}</b>...</li>";
             $bajado = $ftpCon->bajar_r($jar, $to, FTP_DOWN_RETRIES);
             if ($bajado === TRUE) {
                 echo "+jar Ok!<br/>";
                 $content_download = TRUE;
             } else {
                 // jar no encontrado; intentando leer jar del jad
                 $toJad = $dirToWrite . "/" . $toJadName;
                 $jadLines = file($toJad);
                 $jarName = getJarNamefromJad($jadLines);
                 $pathName = pathinfo($jar);
                 $newJar = $pathName['dirname'] . "/" . $jarName;
開發者ID:vallejos,項目名稱:samples,代碼行數:31,代碼來源:process-game.php

示例7: generateThumbnail

 private function generateThumbnail()
 {
     $ftpCon = new Ftp(FTP_USA, FTP_USA_USR, FTP_USA_PWD);
     $connected = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
     if (!$connected) {
         return false;
     }
     $from = str_replace("contenido", "netuy", $this->prefixSearch);
     $from .= "/100x100/" . $this->idRange . "/" . $this->contentName . ".gif";
     $tmp = $this->dirToWrite . "/thumbnail" . sanitizeString($this->title) . ".gif";
     $bajado = $ftpCon->bajar_r($from, $tmp, FTP_DOWN_RETRIES);
     return $bajado;
 }
開發者ID:vallejos,項目名稱:samples,代碼行數:13,代碼來源:migVideo.class.php


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