wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
FTPUtil Class Reference

Public Member Functions

 getErrorMsg ()
 
 open ($params)
 
 getFiles ($directory='.', $pattern='/./', $prependDirectoryName=false, $recursive=false)
 
 getFileInfo ($file)
 
 copy ($file, $transferMode, $toDir='./', $createDir=true, $destName=null)
 
 synchronize ($localFile, $remoteFile)
 
 delete ($file)
 
 close ()
 

Public Attributes

 $_errorMsg = ''
 
 $_ftpConnId = null
 
 $_ftpRootDir = ''
 

Detailed Description

FTPUtil provides support for ftp functionality.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.FTPUtil.php 1462 2014-02-04 23:52:27Z iherwig
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 27 of file class.FTPUtil.php.

Member Function Documentation

FTPUtil::getErrorMsg ( )

Get last error message.

Returns
The error string

Definition at line 37 of file class.FTPUtil.php.

References $_errorMsg.

FTPUtil::open (   $params)

Open a FTP connection to a given server.

Parameters
paramsInitialization data given in an assoziative array with the following keys: server, port, login, password
Returns
True on success, False else / error string provided by getErrorMsg()

Definition at line 47 of file class.FTPUtil.php.

FTPUtil::getFiles (   $directory = '.',
  $pattern = '/./',
  $prependDirectoryName = false,
  $recursive = false 
)

Definition at line 94 of file class.FTPUtil.php.

FTPUtil::getFileInfo (   $file)

Get size an modification date of a remote file.

Parameters
fileThe name of the file to get the info for
Returns
An assoziative array with keys 'size' and 'mtime' (values -1 indicate an error)

Definition at line 133 of file class.FTPUtil.php.

Referenced by synchronize().

FTPUtil::copy (   $file,
  $transferMode,
  $toDir = './',
  $createDir = true,
  $destName = null 
)

Transfer a file to a given server via FTP.

Parameters
fileThe name of the file to transfer (path relative to the script)
transferModeThe transfer mode [FTP_ASCII | FTP_BINARY]
toDirThe server upload directory (relative to serverroot) [default: './']
createDirTrue/False wether to create the directory if not existing [default: true]
destNameThe destination file / the same as the source file if null [default: null]
Returns
True on success, False else / error string provided by getLastError()

Definition at line 158 of file class.FTPUtil.php.

Referenced by synchronize().

FTPUtil::synchronize (   $localFile,
  $remoteFile 
)

Synchronize a file on the server. The method copies the local file to the server if the remote file does not exist, differs in size or is older than the local file.

Parameters
localFileThe name of the local file (path relative to the script)
remoteFileThe name of the remote file (path relative to serverroot)
Returns
True/False wether the file was transfered or not

Definition at line 212 of file class.FTPUtil.php.

References copy(), and getFileInfo().

+ Here is the call graph for this function:

FTPUtil::delete (   $file)

Delete a remote file.

Parameters
fileThe name of the file to delete
Returns
True on success, False else / error string provided by getLastError()

Definition at line 240 of file class.FTPUtil.php.

FTPUtil::close ( )

Close a FTP connection to a given server.

Definition at line 253 of file class.FTPUtil.php.

Member Data Documentation

FTPUtil::$_errorMsg = ''

Definition at line 29 of file class.FTPUtil.php.

Referenced by getErrorMsg().

FTPUtil::$_ftpConnId = null

Definition at line 30 of file class.FTPUtil.php.

FTPUtil::$_ftpRootDir = ''

Definition at line 31 of file class.FTPUtil.php.


The documentation for this class was generated from the following file: