JFTP/ construct: Difference between revisions
From Joomla! Documentation
m removing red link to edit, no existant pages |
m clean up |
||
| Line 2: | Line 2: | ||
JFTP object constructor | JFTP object constructor | ||
<! removed transcluded page call, red link never existed > | <! removed transcluded page call, red link never existed > | ||
| Line 59: | Line 57: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | <! removed transcluded page call, red link never existed > | ||
Revision as of 13:57, 24 March 2017
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
<CodeExamplesForm />