本文整理汇总了PHP中Ftp::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP Ftp::logout方法的具体用法?PHP Ftp::logout怎么用?PHP Ftp::logout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ftp
的用法示例。
在下文中一共展示了Ftp::logout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFtpFiles
/**
*
* @param type $from
* @return type
*/
function getFtpFiles($from)
{
$info = pathinfo($from);
$name = trim($info['basename']);
$ftpCon = new Ftp(FTP_HOST, FTP_USER, FTP_PASS, FTP_PORT);
$content_download = FALSE;
$connected = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
if ($connected === TRUE) {
$to = TMP_QR_DIR . "/" . $name;
$downloaded = $ftpCon->bajar_r($from, $to, FTP_CONN_RETRIES);
if ($downloaded === TRUE) {
$content_download = TRUE;
} else {
$content_download = FALSE;
}
} else {
$content_download = FALSE;
}
$ftpCon->logout();
return $content_download;
}
示例2: crearImagen
}
if ($bajado === TRUE) {
$origen_file = $to;
$destino_file = $tmpDir . "/" . $video->getPreviewFilename();
$width = 100;
$height = 100;
$background = FALSE;
$extension = ".gif";
crearImagen($to, $destino_file, $width, $height, $background, $extension);
unlink($origen_file);
$content_download = TRUE;
} else {
echo "ERROR: descargando el preview del ftp\n";
exit;
}
$ftpConUSA->logout();
} else {
echo "ERROR: descargando el contenido {$from} del ftp a {$to}\n";
exit;
}
} else {
echo "ERROR: no se puede loguear al ftp\n";
}
if ($content_download === TRUE) {
// obtengo y genero el XML
$xmlContent .= $video->genXML();
$total++;
} else {
$log .= " ";
}
} catch (Exception $e) {
示例3: limpiarCagadas
function limpiarCagadas($newId)
{
extract($GLOBALS);
print "<h4>Borrando archivos:</h4>";
foreach ($_SESSION['subidos'] as $k) {
$auxSvr = split("@", $k);
$file = $auxSvr[0];
$srvr = $auxSvr[1];
print "<h4>Borrando registros</h4>";
print "borrando: {$file}<br />";
$ftp = new Ftp($servers[$srvr][0], $servers[$srvr][1], $servers[$srvr][2]);
if (!$ftp->login()) {
die("no se logueó");
}
if (!$ftp->borrar($file)) {
print "No se pudo borrar: {$file}<br />";
error("No se pudo borrar: {$file}", true);
}
}
$sql = " DELETE FROM contenidos where id={$newId} LIMIT 1; ";
$result = mysql_query($sql, $db);
if (!$result) {
error("Error al borrar el contenido {$newId} - sql: {$sql}", true);
}
print "contenido {$newId} eliminado!\n";
$sql = " DELETE FROM contcol_whitelist where contenido={$newId} LIMIT 1; ";
$result = mysql_query($sql, $db);
if (!$result) {
error("Error al borrar de witelist {$newId} - sql: {$sql}", true);
}
print "contenido {$newId} eliminado de whitelist!\n";
$ftp->logout();
}