constructor Bs_FtpClient [line 177]
method cdUp [line 261]
Changes to the remote parent directory.
it's like doing 'cd ..'.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::cdUp()
- uses ftp_cdup — Changes to the parent directory
method chDir [line 281]
bool chDir(
string
$directory)
|
|
Changes remote directory.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::chDir()
- ftp_chdir — Changes directories on an FTP server
Parameters:
method connect [line 220]
Opens up an FTP connection (to the current host/port).
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::connect()
- uses ftp_connect
method delete [line 726]
bool delete(
string
$remoteFile)
|
|
Deletes a file on the ftp server.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::delete()
- ftp_delete — Deletes a file on the ftp server.
Parameters:
method dirExists [line 632]
method fGet [line 579]
bool fGet(
resource
$fp, string
$remoteFile, [int
$mode = NULL])
|
|
Downloads a file from the FTP server and saves to an open file.
retrieves remote_file from the FTP server, and writes it to the given file pointer, fp. The transfer mode specified must be either FTP_ASCII or FTP_BINARY.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::fGet()
- ftp_fget — Downloads a file from the FTP server and saves to an open file.
Parameters:
method fileExists [line 620]
bool fileExists(
string
$remoteFile)
|
|
tells if the given file exists on the server.
Tags:
Parameters:
method fPut [line 609]
bool fPut(
resource
$fp, string
$remoteFile, [int
$mode = NULL])
|
|
Uploads from an open file to the FTP server.
uploads the data from the file pointer fp until end of file. The results are stored in remote_file on the FTP server. The transfer mode specified must be either FTP_ASCII or FTP_BINARY.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::fPut()
- ftp_fput — Uploads from an open file to the FTP server.
Parameters:
method get [line 565]
bool get(
string
$localFile, string
$remoteFile, [int
$mode = NULL])
|
|
Downloads a file from the FTP server.
retrieves $remoteFile from the FTP server, and saves it to $localFile locally. The transfer mode specified must be either FTP_ASCII or FTP_BINARY. caution: overwrites any existing file.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::get()
- ftp_get — Downloads a file from the FTP server.
Parameters:
method isConnected [line 210]
method lastMod [line 679]
int lastMod(
string
$remoteFile)
|
|
Returns the last modified time of the given remote file.
caution: Not all servers support this feature. see header documentation. note: does not work with directories. executes the FTP MDTM command.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::lastMod()
- ftp_mdtm — Returns the last modified time of the given file.
Parameters:
method localCdUp [line 271]
Changes to the local parent directory.
it's like doing 'cd ..'.
Tags:
method localChDir [line 291]
bool localChDir(
string
$param)
|
|
Changes local directory.
Tags:
Parameters:
method localDelete [line 737]
bool localDelete(
string
$localFile)
|
|
Deletes a local file.
Tags:
Parameters:
method localDirExists [line 636]
method localExists [line 628]
method localLastMod [line 691]
int localLastMod(
string
$localFile)
|
|
Returns the last modified time of the given local file.
Tags:
Parameters:
method localMkDir [line 312]
mixed localMkDir(
string
$directory)
|
|
Creates a local directory.
Tags:
Parameters:
method localNlist [line 395]
mixed localNlist(
string
$directory)
|
|
Returns a list of files in the given local directory.
Tags:
Parameters:
method localPwd [line 251]
Returns the current local directory name.
Tags:
method localRawList [line 517]
array &localRawList(
string
$localDir)
|
|
Returns a detailed list of files in the given local directory.
in difference to rawList() the returned value is always 'parsed'. everything else would make no sense.
Tags:
Parameters:
method localRename [line 715]
bool localRename(
string
$localFile, string
$newLocalFile)
|
|
Renames a local file.
Tags:
Parameters:
method localRmDir [line 365]
bool localRmDir(
string
$directory)
|
|
Removes a local directory.
Tags:
Parameters:
method localRmDirRec [line 369]
method localSize [line 664]
int localSize(
string
$localFile)
|
|
Returns the size of the given local file.
Tags:
Parameters:
method login [line 231]
Logs in an FTP connection.
uses the current username/password.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::login()
- uses ftp_login
method mkDir [line 302]
bool mkDir(
string
$directory)
|
|
Creates a remote directory.
your current working dir won't change [into that directory].
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::mkDir()
- ftp_mkdir — Creates a directory
Parameters:
method nList [line 385]
array &nList(
string
$directory)
|
|
Returns a list of files in the given remote directory.
2do: does it return directories too? how about file- and dirlinks? are the values relative or absolute?
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::nList()
- ftp_nlist — Returns a list of files in the given directory.
Parameters:
method parseRawList [line 471]
array &parseRawList(
array
&$rawList)
|
|
parses the given $rawList.
i really don't see why the return of an ftp LIST command has never been standardized. see header documentation.
different ftp servers return a different string format. please report here what you know. Serv-U version 2.4 "-rw-r--r-- 1 user group 117 Sep 17 10:38 welcomeMessage.txt" comets ftpd (some linux ftpd, i should check that.) "drwxr-xr-x 3 root root 4096 Jan 25 2001 ircd"
Serv-U and the linux one give the same output (one space different). that's pretty good.
description of the parts: drwxr-xr-x => the first character can be a 'd' or a '-'. d means the 'file' is a directory,
3 => this integer is a number from 1 to n. if the 'file' is a file, it's always set to 1. if it is a directory, it is 2-n. it is the number of (recursive) subdirectories plus the current directory plus 1. so a '3' means this dir has exactly one subdir. root => the owner user. root => the owner group. 4096 => the file size in bytes. Jan 25 2001 => this is the datetime in some strange format and with missing information. if the file has changed this year for the last time, we get month day and hour/minute. if it was in a previous year, we get month day and the year. anyway we never get the seconds. this makes it harder/more buggy to synchronize files. ircd => the file/directory name (whatever it is). i've read about problems if the names have spaces in there. my suggestion: don't use spaces at all.
the return array may have the following keys, depending on the ftpserver-os: 'name' => 'someshit.txt' //file or directory name 'size' => 4096 //bytes 'date' => '2001/09/07 08:23' //or '2001/09/07'. see above. 'attr' => 'drwxr-xr-x' //(directory yes/no, user rights, group rights, world rights) 'type' => [dir|file] //can't tell if it's a link :( 'dirno' => [1-n] //the directory number, details see above. 'user' => 'root' //the owner user. on windows this doesn't mean much. 'group' => 'root' //the owner group. on windows this doesn't mean much.
Tags:
Parameters:
method pasv [line 550]
Turns passive mode on or off.
if $param is TRUE, passive mode will be activated, deactivated otherwise. in passive mode, data connections are initiated by the client, rather than by the server.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::pasv()
- ftp_pasv — Turns passive mode on or off.
Parameters:
method put [line 594]
bool put(
string
$localFile, string
$remoteFile, [int
$mode = NULL])
|
|
Uploads a file to the FTP server.
stores local_file on the FTP server, as remote_file. The transfer mode specified must be either FTP_ASCII or FTP_BINARY. caution: overwrites any existing file.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::put()
- ftp_put — Uploads a file to the FTP server.
Parameters:
method pwd [line 242]
string pwd(
[bool
$useCache = TRUE])
|
|
Returns the current remote directory name.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::pwd()
- uses ftp_pwd
Parameters:
method quit [line 759]
Closes the FTP connection.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::quit()
- ftp_quit — Closes an FTP connection
method rawList [line 419]
mixed &rawList(
string
$directory, [bool
$parse = TRUE])
|
|
Returns a detailed list of files in the given remote directory.
executes the FTP LIST command.
if param $parse is TRUE, the return value is a vector holding a hash. each file is represented by a hash inside the vector. for details see parseRawList().
if param $parse is FALSE, the return value is a vector holding strings with the unparsed information. use $this->sysType() to do something on your own. or better implement the missing functionality into your favorite ftp class! whatever! do something! don't just sit here and stare at these lines! and give me some of your pizza! *yummy* :-)
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::rawList()
- ftp_rawlist — Returns a detailed list of files in the given directory.
Parameters:
method rename [line 703]
bool rename(
string
$remoteFile, string
$newRemoteFile)
|
|
Renames a file on the ftp server.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::rename()
- ftp_rename — Renames a file on the ftp server.
Parameters:
method reset [line 195]
clears up the object by resetting all class vars to its original state, as if the object was newly created. reusing an object this way saves resources and time in php (instead of creating a new object).
the subclassing class should implement a reset() method also, call this one to clean up the vars of this class, and clean up it's own vars itself. and of course disconnect the connection first.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::reset()
- uses parent method, see there.
method rmDir [line 326]
bool rmDir(
string
$directory)
|
|
Removes a remote directory.
the directory must be empty. if you are currently in that directory (current working dir) you better move out. the ftp command for this is RMD.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::rmDir()
- ftp_rmdir — Removes a directory
Parameters:
method rmDirRec [line 339]
int rmDirRec(
string
$directory)
|
|
Removes a remote directory recursively; with all content in it.
if you are currently in that directory (current working dir) you better move out.
Tags:
Parameters:
method site [line 750]
Sends a SITE command to the server.
sends the command $command to the FTP server. SITE commands are not standardized, and vary from server to server. They are useful for handling such things as file permissions and group membership.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::site()
- ftp_site — Sends a SITE command to the server.
Parameters:
method size [line 652]
int size(
string
$remoteFile)
|
|
Returns the size of the given remote file.
caution: Not all servers support this feature. see header documentation. please report here which server do/don't support it. thanx. executes the FTP SIZE command.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::size()
- ftp_size — Returns the size of the given file.
Parameters:
method synchronizeDir [line 774]
void synchronizeDir(
mixed
$localDir, mixed
$remoteDir, [int
$depth = 0], [mixed
$direction = 'both'])
|
|
Parameters:
method synchronizeFile [line 767]
void synchronizeFile(
mixed
$localFile, mixed
$remoteFile, [string
$direction = 'both'])
|
|
Parameters:
method sysType [line 538]
string sysType(
[bool
$useCache = TRUE])
|
|
Returns the system type identifier of the remote FTP server.
executes the FTP SYST command. the name returned shall be one listed in the assigned numbers document. see the kb file operatingSystemNames.txt (about 130 are listed).
my Serv-U ftpd on windows returns 'UNIX', exactly like some ftpd on my linux box does. and because they give similar unix-like output on the LIST command (see parseRawList()) i think that's what it's for. if you want to know the operating system you better use something else than ftp.
Tags:
Overridden in child classes as:
- Bs_FtpClientPhp::sysType()
- ftp_systype — Returns the system type identifier of the remote FTP server.
Parameters: