API16:JFTP/syst
From Joomla! Documentation
Description
Method to system string from the FTP server
<! removed transcluded page call, red link never existed >
Syntax
syst()
Returns
string System identifier string
Defined in
libraries/joomla/client/ftp.php
Importing
jimport( 'joomla.client.ftp' );
Source Body
function syst() {
// If native FTP support is enabled lets use it...
if (FTP_NATIVE) {
if (($ret = @ftp_systype($this->_conn)) === false) {
JError::raiseWarning('35', 'JFTP::syst: Bad response');
return false;
}
} else {
// Send print working directory command and verify success
if (!$this->_putCmd('SYST', 215)) {
JError::raiseWarning('35', 'JFTP::syst: Bad response', 'Server response: '.$this->_response.' [Expected: 215]');
return false;
}
$ret = $this->_response;
}
// Match the system string to an OS
if (strpos(strtoupper($ret), 'MAC') !== false) {
$ret = 'MAC';
} elseif (strpos(strtoupper($ret), 'WIN') !== false) {
$ret = 'WIN';
} else {
$ret = 'UNIX';
}
// Return the os type
return $ret;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples