API16:JFTP/ construct
From Joomla! Documentation
Description
JFTP object constructor
<! removed transcluded page call, red link never existed >
Syntax
__construct($options=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $options | array() | $options Associative array of options to set |
Defined in
libraries/joomla/client/ftp.php
Importing
jimport( 'joomla.client.ftp' );
Source Body
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
Code Examples