Ejemplo n.º 1
0
 $wallpaper = new migWallpaper($dbc, $debug);
 try {
     $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);
Ejemplo n.º 2
0
 $wallpaper = new migWallpaper($dbc, $debug);
 try {
     $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 = $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);