Esempio n. 1
0
$debug->add("oDbc: " . var_export($oDbc, TRUE));
$DEBUG_LVL = 2;
$todo = count($ids);
$USE_LOCAL_FTP === TRUE ? $debug->add("Using Local FTP - 241") : $debug->add("Using Remote FTP - USA");
$debug->add("Preparing to process {$todo} contents...");
// borro work_dir
$debug->add("Cleaning working dir {$work_dir}...");
exec("rm -rf {$work_dir}/*");
$i = 0;
$j = 0;
foreach ($ids as $id) {
    $i++;
    $debug->add("******* Processing content #{$id}, {$i} of {$todo}...");
    $map = $xml_map["video_tpl"];
    $vid = new video($oDbc, $id);
    $vid->load($workingCat, $workingSubCat);
    // copio archivos
    $debug->add("## Copying img sources...");
    $debug->add("Switching to Remote FTP - USA");
    $USE_LOCAL_FTP = FALSE;
    $download_ok = FALSE;
    $debug->add("Downloading source img...");
    $file = $vid->icons;
    if (get_preview($file, "{$work_dir}/" . $vid->filename . ".gif") === TRUE) {
        $debug->add("Download OK!");
        $download_ok = TRUE;
    } else {
        $debug->add("Download ERROR!!!");
        $debug->add("Giving up :( ");
        echo "{$id} - {$file} (preview)\n";
    }