Actions

API15

JFTP/syst

From Joomla! Documentation

< API15:JFTP
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Method to system string from the FTP server

[<! removed edit link to red link >]

<! 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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />