当前位置: 首页>>代码示例>>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;未经允许,请勿转载。