选择语言 :

Core_Ftp

FTP核心类

API - Core_Ftp

author
呼吸二氧化碳 jonwang@myqee.com
category
MyQEE
package
System
subpackage
Core
copyright
Copyright © 2008-2013 myqee.com
license
http://www.myqee.com/license.html

$this->__construct( $ftp_dsn )

参数列表

参数 类型 描述 默认值
$ftp_dsn string Ftp://user:pass@localhost/

$this->__destruct( )


Ftp::factory( $ftp_dsn )

获取一个实例化后的FTP的对象

参数列表

参数 类型 描述 默认值
$ftp_dsn string Ftp://user:pass@localhost/
返回值
  • FTP

Ftp::parse_dsn( $dsn )

解析FTP DSN

参数列表

参数 类型 描述 默认值
$dsn string DSN string
返回值
  • array

$this->connect( )

连接FTP服务器

返回值
  • bool

$this->_login( )

登录FTP

返回值
  • bool

$this->_is_conn( )

验证是否登录

返回值
  • bool

$this->changedir( $path = '')

改变目录

可以用来测试文件夹的存在,相当于FTP上的is_dir()

参数列表

参数 类型 描述 默认值
$path string empty
返回值
  • bool

$this->mkdir( $path = '', $permissions = null)

创建一个目录

参数列表

参数 类型 描述 默认值
$path string empty
$permissions int null
返回值
  • bool

$this->upload( $locpath , $rempath , $mode = 'auto', $permissions = null)

上传文件

参数列表

参数 类型 描述 默认值
$locpath string
$rempath string
$mode string string(4) "auto"
$permissions int null
返回值
  • bool

$this->download( $rempath , $locpath , $mode = 'auto')

从FTP上下载一个文件

参数列表

参数 类型 描述 默认值
$rempath string
$locpath string
$mode string string(4) "auto"
返回值
  • bool

$this->rename( $old_file , $new_file , $move = false)

重命名或移动一个文件

参数列表

参数 类型 描述 默认值
$old_file string
$new_file string
$move bool bool false
返回值
  • bool

$this->move( $old_file , $new_file )

移动一个文件

参数列表

参数 类型 描述 默认值
$old_file string
$new_file string
返回值
  • bool

$this->delete_file( $filepath )

删除一个文件

参数列表

参数 类型 描述 默认值
$filepath string
返回值
  • bool

$this->delete_dir( $filepath )

删除一个目录(包括子目录)

参数列表

参数 类型 描述 默认值
$filepath string
返回值
  • bool

$this->chmod( $path , $perm )

设置权限

参数列表

参数 类型 描述 默认值
$path string 文件路径
$perm string 权限,比如0755
返回值
  • bool

$this->list_files( )

列出FTP上文件

返回值
  • array

$this->mirror( $locpath , $rempath )

将本地路径目录文件上传同步到FTP指定目录

参数列表

参数 类型 描述 默认值
$locpath string 本地完整路径
$rempath string 远程路径
返回值
  • bool

$this->_getext( $filename )

获取后缀

参数列表

参数 类型 描述 默认值
$filename string
返回值
  • string

$this->_settype( $ext )

设置类型

参数列表

参数 类型 描述 默认值
$ext string
返回值
  • string

$this->close( )

关闭连接

返回值
  • bool