示例#1
0
 //------------------------
 // si es update
 //------------------------
 foreach ($listaIds as $i => $contentId) {
     $contentId = trim($contentId);
     $log .= "\tprocessando {$contentId}  \n";
     $wallpaper = new migWallpaper($dbc, $debug, $catLvl, $webCat, $rating, $marca, $festivo);
     try {
         $wallpaper->loadContent($contentId);
     } catch (Exception $e) {
         $log .= "loadContent: " . $e->getMessage() . "\n";
     }
     try {
         $wallpaper->setLangs(array_keys($idiomas_elegidos));
         $wallpaper->setMerchants(array_keys($paises_elegidos));
         $wallpaper->setTag($catmig);
         $wallpaper->setSubTag($subcatmig);
         $wallpaper->setTag($catmigen, 'en');
         $wallpaper->setSubTag($subcatmigen, 'en');
         $xmlContent = $wallpaper->updateXML();
         $arrayMuestra[] = $wallpaper->getArraySubForm();
         $total++;
         $d2 = $tmpDir . "/{$contentId}/";
         $wallpaper->setDirToWrite($d2);
         if (!file_exists($d1)) {
             exec("mkdir {$d1}");
         }
         if (!file_exists($d2)) {
             exec("mkdir {$d2}");
         }
         $written = file_put_contents($wallpaper->getDirToWrite() . $xmlFile, $xmlContent);
示例#2
0
    $log .= "borrando tmp dir\n";
    exec("rm -rf " . TMP_DIR_WP . "/*");
}
if (!is_writable(ZIP_DIR)) {
    die("ERROR: " . ZIP_DIR . " is not writable\n");
}
foreach ($listaIds as $i => $contentId) {
    $contentId = trim($contentId);
    $log .= "\tprocesando {$contentId}\n";
    $wallpaper = new migWallpaper($dbc, $debug, $catLvl, $webCat, $rating);
    try {
        $wallpaper->loadContent($contentId);
    } catch (Exception $e) {
        $log .= "loadContent: " . $e->getMessage() . "\n";
    }
    $wallpaper->setTag($catmig);
    $wallpaper->setSubTag($subcatmig);
    //$wallpaper->setKeywords($keywords[$i]);
    //$wallpaper->setShortDesc($shortDesc[$i]);
    // $wallpaper->setLongDesc($longDesc[$i]);
    try {
        $content_download = FALSE;
        // descargo contenido por FTP
        $log .= "\tdescargando contenido...\n";
        $ftpCon = new Ftp();
        $retries = 0;
        $conectado = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
        $todos = true;
        if ($conectado === TRUE) {
            $result = $wallpaper->downloadContent($ftpCon);
            foreach ($result as $size => $data) {
示例#3
0
    die("ERROR: " . ZIP_DIR . " is not writable\n");
}
$xmlContent = '<?xml version="1.0" encoding="utf-8" standalone="yes"?>' . "\n";
$xmlContent .= '<asset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . "\n";
foreach ($listaIds as $contentId) {
    $contentId = trim($contentId);
    $log .= "\tprocessando {$contentId}\n";
    $wallpaper = new migWallpaper($dbc, $debug);
    try {
        $wallpaper->loadContent($contentId);
    } catch (Exception $e) {
        $log .= "loadContent: " . $e->getMessage() . "\n";
    }
    try {
        $content_download = FALSE;
        $wallpaper->setTag($catdrutt);
        // descargo contenido por FTP
        $log .= "\tdescargando contenido...\n";
        $ftpCon = new Ftp();
        $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...\n";
                $to = $tmpDir . "/preview_tmp.gif";
                $from = $wallpaper->getPreview();
                $bajado = $ftpCon->bajar_r($from, $to, FTP_DOWN_RETRIES);
                if ($bajado === TRUE) {
                    $origen_file = $to;