Esempio n. 1
0
$zipFile = date("Ymd") . "_Wazzup_" . DRUTT_SCREENSAVER . ".zip";
if (!is_writable(TMP_DIR)) {
    die("ERROR: " . TMP_DIR . " is not writable\n");
} else {
    $log .= "borrando tmp dir\n";
    exec("rm -rf " . TMP_DIR . "/*");
}
if (!is_writable(ZIP_DIR)) {
    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";
    $screensaver = new druttScreensaver($dbc, $debug);
    try {
        $screensaver->loadContent($contentId);
    } catch (Exception $e) {
        $log .= "loadContent: " . $e->getMessage() . "\n";
    }
    try {
        $content_download = FALSE;
        $screensaver->setTag($catdrutt);
        // descargo contenido por FTP
        $log .= "\tdescargando contenido...\n";
        $ftpCon = new Ftp();
        $conectado = $ftpCon->login();
        if ($conectado !== TRUE) {
            $conectado = $ftpCon->login();
        }
Esempio n. 2
0
$tmpDir = $sessDir;
if (!is_writable($tmpDir)) {
    die("ERROR: " . $tmpDir . " is not writable\n");
} else {
    $log .= "borrando tmp dir\n";
    exec("rm -rf " . $tmpDir . "/*");
}
if (!is_writable(ZIP_DIR)) {
    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";
    $screensaver = new druttScreensaver($dbc, $debug);
    try {
        $screensaver->loadContent($contentId);
    } catch (Exception $e) {
        $log .= "loadContent: " . $e->getMessage() . "\n";
    }
    try {
        $content_download = FALSE;
        $screensaver->setTag($catdrutt);
        $screensaver->setLangs(array_keys($paises_elegidos));
        // descargo contenido por FTP
        $log .= "\tdescargando contenido...\n";
        $ftpCon = new Ftp();
        $conectado = $ftpCon->login();
        if ($conectado !== TRUE) {
            $conectado = $ftpCon->login();