BlueShoes Application Framework made with PHP http://www.blueshoes.org/


Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: C:/usr/local/lib/php/blueshoes-4.2/core/net/ftp/Bs_FtpClientPhp.class.php
BlueShoes Application Framework - net/ftp

Bs_FtpClientPhp

Bs_Object
   |
  +-- Bs_FtpClient
     |
    +-- Bs_FtpClientPhp

Ftp client class using the built in module/functions from php.

 

public class Bs_FtpClientPhp extends Bs_FtpClient

Ftp client class using the built in module/functions from php.
features:-missing:- error messages. the php functions just return false so there's nothing i can do :(- server welcome message. i don't see how to grab that with the php implementation.- server-to-server transfer. i don't think we'll ever need that in php. for thesethings better use your standard ftp client.wishlist:- synchronize (by datetime and filesize)- resume on broken transfers.- secure mode, transfering files first as temp files, then renaming the old versions,and then renaming the temp files to the original names. this way, if a transferbrakes, the system isn't let alone with a corrupt file.*************************************************************************************knowledge base:(from http://www.php.net/manual/en/ref.ftp.php so it is regarding php's ftp functions)jerry@acusd.edu24-Apr-2000 12:20Don't forget that PHP's "filesystem" functions can also work with FTP URLs. Inparticular, I went and wrote an "ftp_sput" mod to PHP's code to "put" a string toa remote FTP file--and then discovered that with the "fopen" command PHP canalready do that!orque@uvic.ca15-Aug-2000 06:35Remember that if you've installed php as an apache module then you must compile,shut down and restart apache to have access to your new ftp functions. It took mea while to figure out that you have to actually shut down the server and not justrestart it.sean@debugs.org26-Dec-2000 01:21Be careful when using ftp_size; some ftp servers report different results dependingon whether you have issued a BINARY or ASCII command first. This is a bit of a dragbecause there appears to be no way of issuing either command with these functions.Instead you must specify the desired transfer type with each ftp_get or ftp_put.Thus for some servers you will get a different number of bytes actually transferedthan that reported by the ftp_size function....... Yuk....ceo@l-i-e.com14-Aug-2001 01:40I suspect one could issue "binary" or "ascii" (or any other "missing" command fromthis function list) via the ftp_site command...You'll have to try it and see.m.veldhuizen@itess.nl03-Sep-2001 03:46The FTP functions don't seem to handle spaces in pathnames at all? I've triedseveral ways of escaping the path string when it didn't work, to no effect :(*************************************************************************************

Authors
Version4.0.$id$
Copyrightblueshoes.org

 

Methods inherited from Bs_FtpClient

localpwd, localcdup, localchdir, localmkdir, rmdirrec, localrmdir, localnlist, &parserawlist, &localrawlist, fileexists, localsize, locallastmod, localrename, localdelete, synchronizefile, synchronizedir, isconnected, localrmdirrec, localexists, direxists, localdirexists, set_perm, get_perm, ftp_file_exists

Methods inherited from Bs_Object

isex, isexception, tostring, tohtml, persist, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean

Public Method Summary

void

reset()

uses parent method, see there.Warning: documentation is missing.

Private Method Summary

void

Bs_FtpClient()

constructorWarning: documentation is missing.
void

connect()

uses ftp_connectWarning: documentation is missing.
void

login()

uses ftp_loginWarning: documentation is missing.
void

pwd([ bool $useCache ])

uses ftp_pwdWarning: documentation is missing.
void

cdUp()

uses ftp_cdup — Changes to the parent directoryWarning: documentation is missing.
void

chDir(string $directory)

ftp_chdir — Changes directories on an FTP serverWarning: documentation is missing.
void

mkDir(string $directory)

ftp_mkdir — Creates a directoryWarning: documentation is missing.
void

rmDir(string $directory)

ftp_rmdir — Removes a directoryWarning: documentation is missing.
void

&nList(string $directory)

ftp_nlist — Returns a list of files in the given directory.Warning: documentation is missing.
void

&rawList(string $directory, [ bool $parse ])

ftp_rawlist — Returns a detailed list of files in the given directory.Warning: documentation is missing.
void

sysType([ bool $useCache ])

ftp_systype — Returns the system type identifier of the remote FTP server.Warning: documentation is missing.
void

pasv(bool $param)

ftp_pasv — Turns passive mode on or off.Warning: documentation is missing.
void

get(string $localFile, string $remoteFile, [ int $mode ])

ftp_get — Downloads a file from the FTP server.Warning: documentation is missing.
void

fGet(int $fp, string $remoteFile, [ int $mode ])

ftp_fget — Downloads a file from the FTP server and saves to an open file.Warning: documentation is missing.
void

put(string $localFile, string $remoteFile, [ int $mode ])

ftp_put — Uploads a file to the FTP server.Warning: documentation is missing.
void

fPut(int $fp, string $remoteFile, [ int $mode ])

ftp_fput — Uploads from an open file to the FTP server.Warning: documentation is missing.
void

size(string $remoteFile)

ftp_size — Returns the size of the given file.Warning: documentation is missing.
void

lastMod(string $remoteFile)

ftp_mdtm — Returns the last modified time of the given file.Warning: documentation is missing.
void

rename(string $remoteFile, string $newRemoteFile)

ftp_rename — Renames a file on the ftp server.Warning: documentation is missing.
void

delete(string $remoteFile)

ftp_delete — Deletes a file on the ftp server.Warning: documentation is missing.
void

site(string $command)

ftp_site — Sends a SITE command to the server.Warning: documentation is missing.
void

quit()

ftp_quit — Closes an FTP connectionWarning: documentation is missing.

Fields inherited from Bs_FtpClient

$_bs_date, $_isconnected, $host, $port, $anonymous, $username, $password, $transfermode, $_remotepath, $_localpath, $_systype, $_remoterootpath

Private Field Summary

int

$_conn_id

FTP stream.

Private Constant Summary

BS_FTPCLIENTPHP_VERSION >>4.0.$x$<< Warning: documentation is missing.

Public Method Details

reset

public void reset( )

  uses parent method, see there.

Warning: documentation is missing.

Returns void


Private Method Details

Bs_FtpClient

private void Bs_FtpClient( )

  constructor

Warning: documentation is missing.

Returns void


connect

private void connect( )

  uses ftp_connect

Warning: documentation is missing.

Returns void


login

private void login( )

  uses ftp_login

Warning: documentation is missing.

Returns void


pwd

private void pwd( [ bool $useCache ] )

  uses ftp_pwd

Warning: documentation is missing.

Parameter
bool $useCache = >>TRUE<<
default is TRUE. if we should use the cached information if available.
Returns void

Throws bool FALSE

cdUp

private void cdUp( )

  uses ftp_cdup — Changes to the parent directory

Warning: documentation is missing.

Returns void


chDir

private void chDir( string $directory )

  ftp_chdir — Changes directories on an FTP server

Warning: documentation is missing.

Parameter
string $directory
(the directory to go to.)
Returns void


mkDir

private void mkDir( string $directory )

  ftp_mkdir — Creates a directory

Warning: documentation is missing.

Parameter
string $directory
(the new directory name.)
Returns void


rmDir

private void rmDir( string $directory )

  ftp_rmdir — Removes a directory

Warning: documentation is missing.

Parameter
string $directory
(the directory name.)
Returns void


&nList

private void &nList( string $directory )

  ftp_nlist — Returns a list of files in the given directory.

Warning: documentation is missing.

Parameter
string $directory
(the directory name.)
Returns void

Throws bool FALSE

&rawList

private void &rawList( string $directory, [ bool $parse ] )

  ftp_rawlist — Returns a detailed list of files in the given directory.

Warning: documentation is missing.

Parameter
string $directory
(the directory name.)
bool $parse = >>TRUE<<
(default is TRUE, see above.)
Returns void


sysType

private void sysType( [ bool $useCache ] )

  ftp_systype — Returns the system type identifier of the remote FTP server.

Warning: documentation is missing.

Parameter
bool $useCache = >>TRUE<<
default is TRUE. if we should use the cached information if available.
Returns void

Throws bool FALSE

pasv

private void pasv( bool $param )

  ftp_pasv — Turns passive mode on or off.

Warning: documentation is missing.

Parameter
bool $param
Returns void


get

private void get( string $localFile, string $remoteFile, [ int $mode ] )

  ftp_get — Downloads a file from the FTP server.

Warning: documentation is missing.

Parameter
string $localFile
string $remoteFile
int $mode = >>NULL<<
(use constant, one of FTP_ASCII or FTP_BINARY. if not given $this->_transferMode is used.)
Returns void


fGet

private void fGet( int $fp, string $remoteFile, [ int $mode ] )

  ftp_fget — Downloads a file from the FTP server and saves to an open file.

Warning: documentation is missing.

Parameter
int $fp
er)
string $remoteFile
int $mode = >>NULL<<
(use constant, one of FTP_ASCII or FTP_BINARY. if not given $this->_transferMode is used.)
Returns void


put

private void put( string $localFile, string $remoteFile, [ int $mode ] )

  ftp_put — Uploads a file to the FTP server.

Warning: documentation is missing.

Parameter
string $localFile
string $remoteFile
int $mode = >>NULL<<
(use constant, one of FTP_ASCII or FTP_BINARY. if not given $this->_transferMode is used.)
Returns void


fPut

private void fPut( int $fp, string $remoteFile, [ int $mode ] )

  ftp_fput — Uploads from an open file to the FTP server.

Warning: documentation is missing.

Parameter
int $fp
er)
string $remoteFile
int $mode = >>NULL<<
(use constant, one of FTP_ASCII or FTP_BINARY. if not given $this->_transferMode is used.)
Returns void


size

private void size( string $remoteFile )

  ftp_size — Returns the size of the given file.

Warning: documentation is missing.

Parameter
string $remoteFile
Returns void

Throws bool FALSE on error or if not supported by server.
See Also localSize()

lastMod

private void lastMod( string $remoteFile )

  ftp_mdtm — Returns the last modified time of the given file.

Warning: documentation is missing.

Parameter
string $remoteFile
Returns void

Throws bool FALSE on error or if not supported by server.
See Also localLastMod()

rename

private void rename( string $remoteFile, string $newRemoteFile )

  ftp_rename — Renames a file on the ftp server.

Warning: documentation is missing.

Parameter
string $remoteFile
string $newRemoteFile
Returns void

See Also localRename()

delete

private void delete( string $remoteFile )

  ftp_delete — Deletes a file on the ftp server.

Warning: documentation is missing.

Parameter
string $remoteFile
Returns void

See Also localDelete()

site

private void site( string $command )

  ftp_site — Sends a SITE command to the server.

Warning: documentation is missing.

Parameter
string $command
Returns void


quit

private void quit( )

  ftp_quit — Closes an FTP connection

Warning: documentation is missing.

Returns void


Private Field Details

$_conn_id

private int $_conn_id

>><<

FTP stream.
the thing we got returned from ftp_connect().


Private Constant Details

BS_FTPCLIENTPHP_VERSION

define( BS_FTPCLIENTPHP_VERSION, >>4.0.$x$<< )
Case: default: case sensitive




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta