<?php emptyResource(SMARTY_COMPILE_DIR); emptyResource(SMARTY_CACHE_DIR); emptyResource(WEB_ROOT . 'uploads/lessons/stamped'); // !!! createEmptyFile(APP_ROOT . CACHES_DIR, 'find');
// echo "Success, wrote ($somecontent) to file ($filename)"; fclose($fp); // genero nombre para el zip $i = 0; $existe = TRUE; while ($existe === TRUE) { if (file_exists(ZIP_DIR . "/{$zipFile}")) { $i++; $zipFile = date("Ymd") . "_Wazzup_" . DRUTT_VIDEO . "_{$i}.zip"; } else { $existe = FALSE; } } // creo file para ftp if ($FTPProcess == "new") { createEmptyFile($tmpDir . "/create.start"); } else { if ($FTPProcess == "update") { createEmptyFile($tmpDir . "/edit.start"); } } // zipeo y muevo a carpeta de "envios" $shellCmd = "cd " . $tmpDir . "; zip ../../../" . ZIP_DIR . "/{$zipFile} * "; $log .= exec($shellCmd); $log .= "\tZip " . ZIP_DIR . "/{$zipFile} generado exitosamente\n"; // chequeo zip filesize $ds = filesize(ZIP_DIR . "/{$zipFile}"); $ds = formatBytes($ds); echo "generado <a href='" . ZIP_DIR . "/{$zipFile}'>" . ZIP_DIR . "/{$zipFile}</a> con {$total} contenidos, <b>{$ds}</b><br/>\n"; echo "<hr/><h3>Log:</h3>"; echo "<textarea cols=50 rows=10>{$log}</textarea>";
function emptyResource($path) { if (removeResource($path, false)) { createEmptyFile($path); } }