示例#1
0
 $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;
         } else {
             $log .= "\tgif preview not found...\n";
             $log .= "\ttrying preview (jpg)...\n";
             $to = TMP_DIR_WP . "/preview_tmp.gif";
             $from = str_replace(".gif", ".jpg", $wallpaper->getPreview());
             $bajado = $ftpCon->bajar($from, $to);
             if ($bajado === TRUE) {
                 $origen_file = $to;
示例#2
0
 $log .= "\tdescargando contenido...\n";
 $ftpCon = new Ftp();
 $retries = 0;
 $conectado = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
 if ($conectado === TRUE) {
     $to = $tmpDir . "/" . $wallpaper->getContentFilename();
     $from = $wallpaper->getContent();
     $bajado = $ftpCon->bajar_r($from, $to, FTP_DOWN_RETRIES);
     if ($bajado === TRUE) {
         $log .= "\tdescargando preview (gif)...\n";
         $to = $tmpDir . "/preview_tmp.gif";
         $from = $wallpaper->getPreview();
         $bajado = $ftpCon->bajar_r($from, $to, FTP_DOWN_RETRIES);
         if ($bajado === TRUE) {
             $origen_file = $to;
             $destino_file = $tmpDir . "/" . $wallpaper->getPreviewFilename();
             $width = 100;
             $height = 100;
             $background = FALSE;
             $extension = ".gif";
             crearImagen($to, $destino_file, $width, $height, $background, $extension);
             unlink($origen_file);
             $content_download = TRUE;
         } else {
             $log .= "\tgif preview not found...\n";
             $log .= "\ttrying preview (jpg)...\n";
             $to = $tmpDir . "/preview_tmp.gif";
             $from = str_replace(".gif", ".jpg", $wallpaper->getPreview());
             $bajado = $ftpCon->bajar($from, $to);
             if ($bajado === TRUE) {
                 $origen_file = $to;