API16

JFTP/ construct

From Joomla! Documentation

< API16:JFTP
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

JFTP object constructor


<! removed transcluded page call, red link never existed >

Syntax[edit]

__construct($options=array())
Parameter Name Default Value Description
$options array() $options Associative array of options to set

Defined in[edit]

libraries/joomla/client/ftp.php

Importing[edit]

jimport( 'joomla.client.ftp' );

Source Body[edit]

function __construct($options=array()) {

        // If default transfer type is no set, set it to autoascii detect
        if (!isset ($options['type'])) {
                $options['type'] = FTP_BINARY;
        }
        $this->setOptions($options);

        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
                $this->_OS = 'WIN';
        } elseif (strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') {
                $this->_OS = 'MAC';
        } else {
                $this->_OS = 'UNIX';
        }

        if (FTP_NATIVE) {
                // Import the generic buffer stream handler
                jimport('joomla.utilities.buffer');
                // Autoloading fails for JBuffer as the class is used as a stream handler
                JLoader::load('JBuffer');
        }

        // Register faked "destructor" in PHP4 to close all connections we might have made
        if (version_compare(PHP_VERSION, '5') == -1) {
                register_shutdown_function(array(&$this, '__destruct'));
        }
}


<! removed transcluded page call, red link never existed >

Examples[edit]

Code Examples[edit]