當前位置: 首頁>>代碼示例>>PHP>>正文


PHP gpFiles::FTPConnect方法代碼示例

本文整理匯總了PHP中gpFiles::FTPConnect方法的典型用法代碼示例。如果您正苦於以下問題:PHP gpFiles::FTPConnect方法的具體用法?PHP gpFiles::FTPConnect怎麽用?PHP gpFiles::FTPConnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gpFiles的用法示例。


在下文中一共展示了gpFiles::FTPConnect方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: FTP_CheckDir

 public static function FTP_CheckDir($dir)
 {
     $conn_id = gpFiles::FTPConnect();
     $dir = gpFiles::ftpLocation($dir);
     if (!ftp_mkdir($conn_id, $dir)) {
         return false;
     }
     return ftp_site($conn_id, 'CHMOD 0777 ' . $dir);
 }
開發者ID:VTAMAGNO,項目名稱:gpEasy-CMS,代碼行數:9,代碼來源:Files.php

示例2: MakeDir

 function MakeDir($parent, $new_name)
 {
     global $config, $langmessage;
     $langmessage['not_created'] = 'Oops, the folder could not be created. ';
     $langmessage['not_created'] .= 'You may still be able to create it by doing one of the following: ';
     $langmessage['not_created'] .= '<ul>';
     $langmessage['not_created'] .= '<li>Make the parent folder writable by changing it\'s permissions.</li>';
     $langmessage['not_created'] .= '<li>Supply your server\'s <a href="%s">ftp information</a> to this plugin.</li>';
     $langmessage['not_created'] .= '</ul>';
     $langmessage['not_created'] = sprintf($langmessage['not_created'], common::GetUrl('Admin_Site_Setup', 'cmd=settings'));
     $new_folder = $parent . '/' . $new_name;
     if (mkdir($new_folder, 0755)) {
         chmod($new_folder, 0755);
         //some systems need more than just the 0755 in the mkdir() function
         return true;
     }
     if (empty($config['ftp_server'])) {
         message($langmessage['not_created']);
         return false;
     }
     $conn_id = gpFiles::FTPConnect();
     if (!$conn_id) {
         message($langmessage['not_created'] . ' (FTP Connection Failed)');
         return false;
     }
     $ftp_parent = gpftp::GetFTPRoot($conn_id, $parent);
     if (!$ftp_parent) {
         message('Oops, could not find the ftp location of <i>' . $parent . '</i> using the current ftp login.');
         return false;
     }
     $ftp_destination = $ftp_parent . '/' . $new_name;
     if (!ftp_mkdir($conn_id, $ftp_destination)) {
         message('Oops, could not create the folder using the current ftp login.');
         return false;
     }
     ftp_site($conn_id, 'CHMOD 0755 ' . $ftp_destination);
     return true;
 }
開發者ID:rizub4u,項目名稱:gpEasy-CMS,代碼行數:38,代碼來源:SetupSite.php


注:本文中的gpFiles::FTPConnect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。