API15:JFTP/ construct
From Joomla! Documentation
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
JFTP object constructor
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')); } }
[Edit See Also] SeeAlso:JFTP/ construct
Examples
<CodeExamplesForm />
