当前位置: 首页>>代码示例>>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;未经允许,请勿转载。