• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP ftp_quit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ftp_quit函数的典型用法代码示例。如果您正苦于以下问题:PHP ftp_quit函数的具体用法?PHP ftp_quit怎么用?PHP ftp_quit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ftp_quit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: CloseFtp

 function CloseFtp()
 {
     global $g_ftpLink;
     if ($g_ftpLink) {
         @ftp_quit($g_ftpLink);
     }
 }
开发者ID:ahmatjan,项目名称:cmf2,代码行数:7,代码来源:file.helper.php


示例2: ftp_file

/**
* FTP File to Location
*/
function ftp_file($source_file, $dest_file, $mimetype, $disable_error_mode = false)
{
    global $config, $lang, $error, $error_msg;
    $conn_id = attach_init_ftp();
    // Binary or Ascii ?
    $mode = FTP_BINARY;
    if (preg_match("/text/i", $mimetype) || preg_match("/html/i", $mimetype)) {
        $mode = FTP_ASCII;
    }
    $res = @ftp_put($conn_id, $dest_file, $source_file, $mode);
    if (!$res && !$disable_error_mode) {
        $error = true;
        if (!empty($error_msg)) {
            $error_msg .= '<br />';
        }
        $error_msg = sprintf($lang['Ftp_error_upload'], $config['ftp_path']) . '<br />';
        @ftp_quit($conn_id);
        return false;
    }
    if (!$res) {
        return false;
    }
    @ftp_site($conn_id, 'CHMOD 0644 ' . $dest_file);
    @ftp_quit($conn_id);
    return true;
}
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:29,代码来源:functions_posting.php


示例3: disconnect

 function disconnect()
 {
     if ($this->socket) {
         @ftp_quit($this->socket);
         $this->FtpAccess();
     }
 }
开发者ID:BackupTheBerlios,项目名称:swora,代码行数:7,代码来源:class.ftp.php


示例4: enviaImagen

function enviaImagen($fRutaImagen, $fDirServ, $fNombreImagen)
{
    $host = 'ftp.laraandalucia.com';
    $usuario = 'laraandalucia.com';
    $pass = '2525232';
    $errorFtp = 'no';
    $dirServ = 'html/images/Lara/' . $fDirServ;
    $conexion = @ftp_connect($host);
    if ($conexion) {
        if (@ftp_login($conexion, $usuario, $pass)) {
            if (!@ftp_chdir($conexion, $dirServ)) {
                if (!@ftp_mkdir($conexion, $dirServ)) {
                    $errorFtp = 'si';
                }
            }
        } else {
            $errorFtp = 'si';
        }
    } else {
        $errorFtp = 'si';
    }
    if ($errorFtp = 'no') {
        @ftp_chdir($conexion, $dirServ);
        if (@(!ftp_put($conexion, $fNombreImagen, $fRutaImagen, FTP_BINARY))) {
            $errorFtp = 'si';
        }
    }
    @ftp_quit($conexion);
    return $errorFtp == 'no';
}
开发者ID:amarser,项目名称:cmi,代码行数:30,代码来源:ManchaLlana.php


示例5: close

 /**
  * Closes the session
  */
 public function close()
 {
     $success = @ftp_quit($this->handle);
     
     if( !$success )
         throw new cFTP_Exception("Could not disconnect", 2);
 }
开发者ID:robik,项目名称:cFTP,代码行数:10,代码来源:Session.php


示例6: __destruct

    public function __destruct ()
	{
		if($this->stream!==null) {
			ftp_quit($this->stream);
		}
        $this->stream = null;
    }
开发者ID:nhp,项目名称:shopware-4,代码行数:7,代码来源:Ftp.php


示例7: _authenticate

 /**
  * Find out if a set of login credentials are valid.
  *
  * @param string $userId      The userId to check.
  * @param array $credentials  An array of login credentials. For FTP,
  *                            this must contain a password entry.
  *
  * @throws Horde_Auth_Exception
  */
 protected function _authenticate($userId, $credentials)
 {
     $ftp = @ftp_connect($this->_params['hostspec'], $this->_params['port']);
     $res = $ftp && @ftp_login($ftp, $userId, $credentials['password']);
     @ftp_quit($ftp);
     if ($res) {
         throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
     }
 }
开发者ID:horde,项目名称:horde,代码行数:18,代码来源:Ftp.php


示例8: ObtenerRuta

function ObtenerRuta()
{
    //Obriene ruta del directorio del Servidor FTP (Comando PWD)
    $id_ftp = ConectarFTP();
    //Obtiene un manejador y se conecta al Servidor FTP
    $Directorio = ftp_pwd($id_ftp);
    //Devuelve ruta
    ftp_quit($id_ftp);
    //Cierra la conexion FTP
    return $Directorio;
    //Devuelve la ruta a la función
}
开发者ID:FranchuCorraliza,项目名称:html,代码行数:12,代码来源:ftpfunc.php


示例9: GetFTPServer

 static function GetFTPServer()
 {
     if (isset($_SERVER['HTTP_HOST'])) {
         $server = $_SERVER['HTTP_HOST'];
     } elseif (isset($_SERVER['SERVER_NAME'])) {
         $server = $_SERVER['SERVER_NAME'];
     } else {
         return '';
     }
     $conn_id = @ftp_connect($server, 21, 6);
     if ($conn_id) {
         @ftp_quit($conn_id);
         return $server;
     }
     return '';
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:16,代码来源:ftp.php


示例10: sion_ftp_put

 function sion_ftp_put($fileOri)
 {
     // ------------------------------------------------------
     // Esta funcion se encarga de poner un ARCHIVO en FTP.
     // ------------------------------------------------------
     $ftp_server = "ftpham04.hamburgsud.com";
     $ftp_user_name = "ope";
     $ftp_user_pass = "ope0313ftp";
     $path_parts = pathinfo($fileOri);
     $fileX = $path_parts['basename'];
     //$dirRem = $dirRem."/";
     $id_ftp = ftp_connect($ftp_server, 21);
     ftp_login($id_ftp, $ftp_user_name, $ftp_user_pass);
     ftp_pasv($id_ftp, false);
     ftp_chdir($id_ftp, "from");
     if (ftp_put($id_ftp, $fileX, $fileOri, FTP_BINARY)) {
         echo "<hr>OK Cargado : {$fileOri}<hr>";
     } else {
         echo "<hr>No subio : {$fileOri}<hr>";
     }
     ftp_quit($id_ftp);
 }
开发者ID:nesmaster,项目名称:mopsapro,代码行数:22,代码来源:ediHS.php


示例11: attachment_exists

/**
* Check if Attachment exist
*/
function attachment_exists($filename)
{
    global $upload_dir, $config;
    $filename = basename($filename);
    if (!intval($config['allow_ftp_upload'])) {
        if (!@file_exists(@amod_realpath($upload_dir . '/' . $filename))) {
            return false;
        } else {
            return true;
        }
    } else {
        $found = false;
        $conn_id = attach_init_ftp();
        $file_listing = array();
        $file_listing = @ftp_rawlist($conn_id, $filename);
        for ($i = 0, $size = sizeof($file_listing); $i < $size; $i++) {
            if (ereg("([-d])[rwxst-]{9}.* ([0-9]*) ([a-zA-Z]+[0-9: ]*[0-9]) ([0-9]{2}:[0-9]{2}) (.+)", $file_listing[$i], $regs)) {
                if ($regs[1] == 'd') {
                    $dirinfo[0] = 1;
                    // Directory == 1
                }
                $dirinfo[1] = $regs[2];
                // Size
                $dirinfo[2] = $regs[3];
                // Date
                $dirinfo[3] = $regs[4];
                // Filename
                $dirinfo[4] = $regs[5];
                // Time
            }
            if ($dirinfo[0] != 1 && $dirinfo[4] == $filename) {
                $found = true;
            }
        }
        @ftp_quit($conn_id);
        return $found;
    }
}
开发者ID:GabrielAnca,项目名称:icy_phoenix,代码行数:41,代码来源:displaying.php


示例12: listPfiles

function listPfiles($datasrc, $filter = "")
{
    $con = ftp_connect($datasrc->host) or die("Couldn't connect to {$datasrc->host}");
    if (!ftp_login($con, $datasrc->user, $datasrc->pwd)) {
        trigger_error("ftp login to {$datasrc->host} failed.");
        $pfileTree = 0;
    } else {
        $rawFiles = ftp_rawlist($con, $datasrc->dataDir);
        foreach ($rawFiles as $raw) {
            //echo $raw;
            ereg("([-d])([rwxst-]{9}).* ([0-9]*) ([a-zA-Z]+[0-9: ]* [0-9]{2}:?[0-9]{2}) (.+)", $raw, $regs);
            $files[] = array("is_dir" => $regs[1] == "d" ? true : false, "mod" => $regs[2], "size" => $regs[3], "time" => $regs[4], "name" => $regs[5], "raw" => $regs[0]);
        }
        // Find all P-files
        foreach ($files as $f) {
            if (ereg("^P.*\\.7\$", basename($f["name"]))) {
                $pfiles[] = basename($f["name"]);
            }
        }
        if (count($pfiles) > 0) {
            // Now find the tree of files associated with each P-file
            foreach ($pfiles as $pfileNum => $pfile) {
                foreach ($files as $f) {
                    if (ereg(".*" . $pfile . ".*", basename($f["name"]))) {
                        $pfileTree[$pfile]->name[] = $f["name"];
                        $pfileTree[$pfile]->size[] = $f["size"];
                        $pfileTree[$pfile]->time[] = $f["time"];
                    }
                }
            }
        } else {
            $pfileTree = 0;
        }
    }
    ftp_quit($con);
    return $pfileTree;
}
开发者ID:racheldenison,项目名称:megavista,代码行数:37,代码来源:showPfiles.php


示例13: SendViaFTP

function SendViaFTP($i, $source_file, $conn_msg = 1)
{
    global $config, $out, $lang;
    flush();
    if ($conn_msg == 1) {
        $out .= '<span class="success">' . $lang['L_FILESENDFTP'] . "(" . $config['ftp_server'][$i] . " - " . $config['ftp_user'][$i] . ")</span><br>";
    }
    // Herstellen der Basis-Verbindung
    if ($config['ftp_useSSL'][$i] == 0) {
        $conn_id = @ftp_connect($config['ftp_server'][$i], $config['ftp_port'][$i], $config['ftp_timeout'][$i]);
    } else {
        $conn_id = @ftp_ssl_connect($config['ftp_server'][$i], $config['ftp_port'][$i], $config['ftp_timeout'][$i]);
    }
    // Einloggen mit Benutzername und Kennwort
    $login_result = @ftp_login($conn_id, $config['ftp_user'][$i], $config['ftp_pass'][$i]);
    if ($config['ftp_mode'][$i] == 1) {
        ftp_pasv($conn_id, true);
    }
    // Verbindung überprüfen
    if (!$conn_id || !$login_result) {
        $out .= '<span class="error">' . $lang['L_FTPCONNERROR'] . $config['ftp_server'][$i] . $lang['L_FTPCONNERROR1'] . $config['ftp_user'][$i] . $lang['L_FTPCONNERROR2'] . '</span><br>';
    } else {
        if ($conn_msg == 1) {
            $out .= '<span class="success">' . $lang['L_FTPCONNECTED1'] . $config['ftp_server'][$i] . $lang['L_FTPCONNERROR1'] . $config['ftp_user'][$i] . '</span><br>';
        }
    }
    // Upload der Datei
    $dest = $config['ftp_dir'][$i] . $source_file;
    $source = $config['paths']['backup'] . $source_file;
    $upload = @ftp_put($conn_id, $dest, $source, FTP_BINARY);
    // Upload-Status überprüfen
    if (!$upload) {
        $out .= '<span class="error">' . $lang['L_FTPCONNERROR3'] . "<br>({$source} -> {$dest})</span><br>";
    } else {
        $out .= '<span class="success">' . $lang['L_FILE'] . ' <a href="' . $config['paths']['backup'] . $source_file . '" class="smallblack">' . $source_file . '</a>' . $lang['L_FTPCONNECTED2'] . $config['ftp_server'][$i] . $lang['L_FTPCONNECTED3'] . '</span><br>';
        WriteLog("'{$source_file}' sent via FTP.");
    }
    // Schließen des FTP-Streams
    @ftp_quit($conn_id);
}
开发者ID:Otomatic,项目名称:MySQLDumper,代码行数:40,代码来源:functions_dump.php


示例14: ftpClose

 /**
  * close FTP connection
  *
  * @return boolean
  */
 function ftpClose()
 {
     if (!$this->ftp) {
         return false;
     }
     if (@ftp_quit($this->ftp)) {
         $this->addMsg("Closed connection to {$this->host}:{$this->port}");
         $this->ftp = null;
         return true;
     }
     $this->addMsg("Could not close connection to {$this->host}:{$this->port}", 'error');
     return false;
 }
开发者ID:andreyvit,项目名称:retester,代码行数:18,代码来源:FileSystem.php


示例15: getProtocol

function getProtocol($datasrc, $category, $protocol)
{
    // Try to prevent rogue users from getting any random file from the server.
    // This should prevent 'category=../../../' style hacks.
    $category = basename($category);
    $protocol = basename($protocol);
    $con = ftp_connect($datasrc->host) or die("Couldn't connect to {$datasrc->host}");
    if (!ftp_login($con, $datasrc->user, $datasrc->pwd)) {
        trigger_error("ftp login to {$datasrc->host} failed.");
    } else {
        $temp = tmpfile();
        $getFile = $datasrc->protocolDir . "/" . $category . "/" . $protocol;
        $stat = ftp_fget($con, $temp, $getFile, FTP_ASCII);
        rewind($temp);
        $protStr = fread($temp, 1000000);
        fclose($temp);
    }
    ftp_quit($con);
    // PARSE PROTOCOL FILE
    // For debugging:
    //echo "<pre>$protStr</pre>";
    // First, remove the many useless 'GLOBAL' lines
    $protStr = preg_replace("/global .*\n/", "", $protStr);
    // Extract the protocol description fields
    preg_match("/set PROTNAME \"(.*)\"/", $protStr, $matches);
    $p["name"] = $matches[1];
    preg_match("/set REVNO \"(.*)\"/", $protStr, $matches);
    $p["revno"] = $matches[1];
    preg_match("/set SCANNUM \"(.*)\"/", $protStr, $matches);
    $p["scanNum"] = $matches[1];
    preg_match("/set SERIESNUM \"(.*)\"/", $protStr, $matches);
    $p["seriesNum"] = $matches[1];
    // Now, parse each series
    $ser = explode('proc ', $protStr);
    array_shift($ser);
    foreach ($ser as $seriesNum => $seriesStr) {
        $tmp = explode('set ', $seriesStr);
        array_shift($tmp);
        foreach ($tmp as $paramNum => $paramStr) {
            preg_match("/(.*) \"(.*)\"/", $paramStr, $matches);
            $p['series'][$seriesNum + 1][strtolower(trim($matches[1]))] = $matches[2];
            //echo "$seriesNum $matches[1] $p[$seriesNum+1][$matches[1]]";
        }
    }
    return $p;
}
开发者ID:racheldenison,项目名称:megavista,代码行数:46,代码来源:protocolWizard.php


示例16: ftp_closeconnection

function ftp_closeconnection($conn_id)
{
    // --------------
    // This function closes an ftp connection
    // --------------
    ftp_quit($conn_id);
}
开发者ID:GTAWWEKID,项目名称:tsiserver.us,代码行数:7,代码来源:filesystem.inc.php


示例17: page_common_form

         page_common_form($s_hidden_fields, $lang['Download_config']);
     }
     page_footer();
     exit;
 } else {
     // Write out a temp file...
     $tmpfname = @tempnam('/tmp', 'cfg');
     @unlink($tmpfname);
     // unlink for safety on php4.0.3+
     $fp = @fopen($tmpfname, 'w');
     @fwrite($fp, stripslashes($HTTP_POST_VARS['config_data']));
     @fclose($fp);
     // Now ftp it across.
     @ftp_chdir($conn_id, $ftp_dir);
     $res = ftp_put($conn_id, 'config.' . $phpEx, $tmpfname, FTP_ASCII);
     @ftp_quit($conn_id);
     unlink($tmpfname);
     if ($upgrade == 1) {
         require 'upgrade.' . $phpEx;
         exit;
     }
     // Ok we are basically done with the install process let's go on
     // and let the user configure their board now. We are going to do
     // this by calling the admin_board.php from the normal board admin
     // section.
     $s_hidden_fields = '<input type="hidden" name="username" value="' . $admin_name . '" />';
     $s_hidden_fields .= '<input type="hidden" name="password" value="' . $admin_pass1 . '" />';
     $s_hidden_fields .= '<input type="hidden" name="redirect" value="../admin/index.' . $phpEx . '" />';
     $s_hidden_fields .= '<input type="hidden" name="submit" value="' . $lang['Login'] . '" />';
     page_header($lang['Inst_Step_2']);
     page_common_form($s_hidden_fields, $lang['Finish_Install']);
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:31,代码来源:install.php


示例18: urlencode

                if ($ftpserver = @parse_url($phpAds_config['type_web_ftp'])) {
                    $type_web_ftp_password = $ftpserver['pass'];
                }
            }
            if (isset($type_web_ftp_host) && ($ftpsock = @ftp_connect($type_web_ftp_host))) {
                if (@ftp_login($ftpsock, $type_web_ftp_user, $type_web_ftp_password)) {
                    if (empty($type_web_ftp_path) || @ftp_chdir($ftpsock, $type_web_ftp_path)) {
                        $type_web_ftp = 'ftp://' . urlencode($type_web_ftp_user) . ':' . urlencode($type_web_ftp_password) . '@' . $type_web_ftp_host . '/' . urlencode($type_web_ftp_path);
                        phpAds_SettingsWriteAdd('type_web_ftp', $type_web_ftp);
                    } else {
                        $errormessage[2][] = $strTypeFTPErrorDir;
                    }
                } else {
                    $errormessage[2][] = $strTypeFTPErrorConnect;
                }
                @ftp_quit($ftpsock);
            } else {
                $errormessage[2][] = $strTypeFTPErrorHost;
            }
        }
    }
    phpAds_SettingsWriteAdd('type_html_auto', isset($type_html_auto));
    phpAds_SettingsWriteAdd('type_html_php', isset($type_html_php));
    if (!count($errormessage)) {
        if (phpAds_SettingsWriteFlush()) {
            header("Location: settings-admin.php");
            exit;
        }
    }
}
/*********************************************************/
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:31,代码来源:settings-banner.php


示例19: sendTrouthFTP

 private function sendTrouthFTP($host, $user, $password, $folder_local, $file_name, $folder_remout)
 {
     // Соединение с удаленным FTP-сервером
     print "Соединение с сервером {$host}<br>";
     $connect = ftp_connect($host);
     if (!$connect) {
         echo "Ошибка соединения";
         exit;
     } else {
         echo "Соединение установлено<br><br>";
     }
     // Регистрация на FTP-сервере
     print "Регистрация на FTP-сервере<br>Логин {$user}<br>Пароль {$password}<br>";
     $result = ftp_login($connect, $user, $password);
     if (!$result) {
         echo "Не залогинились";
         exit;
     } else {
         echo "Залогинились<br><br>";
     }
     ftp_pasv($connect, true);
     //  $new_dir = "home/i/itwebnetru/rusneon/public_html";
     // сохраняем имя текущего рабочего каталога
     print $current_dir = ftp_pwd($connect);
     //        $folder_remout = "/rusneon/public_html/";
     //        $folder_remout = $current_dir;
     // Копируем файл
     //        $folder_local = $_SERVER['DOCUMENT_ROOT'] . "/";
     //        $file_name = "200812111155_1ddbf8a5.tar.gz";
     $rrr = ftp_put($connect, $folder_local . $file_name, $folder_remout . $file_name, FTP_BINARY);
     print "Копирование файла {$file_name}<br>";
     if (!$rrr) {
         echo "Завершилось неудачей (((";
     } else {
         echo "Удачно скопировано )))";
     }
     // Закрываем соединение
     ftp_quit($connect);
 }
开发者ID:A111ex,项目名称:parser.ru,代码行数:39,代码来源:UnloadingController.php


示例20: elseif

                    $table[$z][3]['text'] = $lineinfo['rounded_size'];
                } elseif ($lineinfo['folder'] == TRUE and $lineinfo['name'] != "." and $lineinfo['name'] != "..") {
                    $linkurl = rawurlencode($lineinfo['name']);
                    $table[$z][0]['text'] = '<img src="design/' . $auth['design'] . '/images/downloads_folder.gif" border="0">';
                    $table[$z][0]['link'] = 'index.php?mod=downloads&action=show&go_dir=' . $linkurl;
                    $table[$z][1]['text'] = "<a href=\"index.php?mod=downloads&action=show&go_dir=" . $linkurl . "\" class=\"menu\" >" . $lineinfo['name'] . "</a>";
                    $table[$z][1]['link'] = 'index.php?mod=downloads&action=show&go_dir=' . $linkurl;
                    $table[$z][2]['text'] = "Ordner";
                    $table[$z][3]['text'] = "&nbsp;";
                }
                unset($lineinfo);
                $z++;
            }
        } else {
            $func->information(t('Kein Inhalt vorhanden'));
        }
        $dsp->NewContent(t('Downloads'), t('Hier kannst du zum Download bereitgestellte Dateien downloaden. Ordner sind durch ein Ordner-Symbol gekennzeichnet und können per Klick auf dieses oder den Namen ge&ouml;ffnet werden. Bei &ouml;ffnen eines Unterverzeichnisses wird das aktuelle Verzeichnis am oberen Rand angezeigt. Ebenfalls angezeigt wird ein Symbol mit dem du zum nächst höhergelegenen Verzeichnis gelangst'));
        if (count($_SESSION['downloads_dir']) > "0") {
            $dsp->AddSingleRow('<a href="index.php?mod=downloads&action=show&go_dir=up"><img src="design/' . $auth['design'] . '/images/downloads_goup.gif" border="0"></a> ' . $dir . '/');
        }
        $dsp->AddTableRow($table);
        $dsp->AddContent();
        $quit = ftp_quit($connect);
        $debugFTP[] = "FTP> Quit connection " . $connect . HTML_NEWLINE;
    } else {
        $func->error(t('Konnte Verbindung zum Downloadserver "%1" auf Port %2 nicht herstellen', $server, $port));
    }
    if (isset($debug) and $cfg['sys_showdebug_ftp'] == "1") {
        $debug->addvar('FTP', $debugFTP);
    }
}
开发者ID:eistr2n,项目名称:lansuite,代码行数:31,代码来源:show.php



注:本文中的ftp_quit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ftp_raw函数代码示例发布时间:2022-05-15
下一篇:
PHP ftp_pwd函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap