コード例 #1
0
ファイル: process-video.php プロジェクト: vallejos/samples
$xmlFile = "metadata.xml";
//$zipFile = "Wazzup_".MIG_VIDEO."_".date("Ymd").".zip";
$zipFile = "Wazzup_" . MIG_VIDEO . "_" . date("Ymd") . ".zip";
if (!is_writable(TMP_DIR_VD)) {
    die("ERROR: " . TMP_DIR_VD . " is not writable\n");
} else {
    $log .= "borrando tmp dir\n";
    exec("rm -rf " . TMP_DIR_VD . "/*");
}
if (!is_writable(ZIP_DIR)) {
    die("ERROR: " . ZIP_DIR . " is not writable\n");
}
foreach ($listaIds as $i => $contentId) {
    $contentId = trim($contentId);
    $log .= "\tprocessando {$contentId}\n";
    $video = new migVideo($dbc, $debug, $catLvl, $webCat, $rating);
    try {
        $video->loadContent($contentId);
    } catch (Exception $e) {
        $log .= "loadContent: " . $e->getMessage() . "\n";
    }
    $video->setTag($catmig);
    $video->setSubTag($subcatmig);
    //$video->setKeywords($keywords[$i]);
    //$video->setShortDescription($shortDesc[$i]);
    //$video->setLongDescription($longDesc[$i]);
    $todos = true;
    $alguno = false;
    try {
        $content_download = FALSE;
        $log .= "\tdescargando contenido...\n";
コード例 #2
0
ファイル: process-video.php プロジェクト: vallejos/samples
            $existe = FALSE;
        }
    }
    // zipeo y muevo a carpeta de "envios"
    $shellCmd = "cd " . $tmpDir . "; zip -r ../../../" . ZIP_DIR . "/{$zipFile} * ";
    $log .= exec($shellCmd);
    $log .= "\tZip " . ZIP_DIR . "/{$zipFile} generado exitosamente\n";
} else {
    if ($tipoCarga == "update") {
        //------------------------
        // si es update
        //------------------------
        foreach ($listaIds as $i => $contentId) {
            $contentId = trim($contentId);
            $log .= "\tprocessando {$contentId}\n";
            $video = new migVideo($dbc, $debug, $catLvl, $webCat, $marca, $rating, $festivo, $tipoVideo);
            try {
                $video->loadContent($contentId);
            } catch (Exception $e) {
                $log .= "loadContent: " . $e->getMessage() . "\n";
            }
            try {
                $video->setLangs(array_keys($idiomas_elegidos));
                $video->setMerchants(array_keys($paises_elegidos));
                $video->setTag($catmig);
                $video->setSubTag($subcatmig);
                $video->setTag($catmigen, 'en');
                $video->setSubTag($subcatmigen, 'en');
                $xmlContent = $video->updateXML();
                $arrayMuestra[] = $video->getArraySubForm();
                $total++;