mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 18:25:13 +00:00
Add Net_SFTP_Stream::register() for easier autoloading.
This commit is contained in:
parent
f360932343
commit
73f961cb7d
@ -126,6 +126,21 @@ class Net_SFTP_Stream
|
|||||||
*/
|
*/
|
||||||
var $notification;
|
var $notification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers this class as a URL wrapper.
|
||||||
|
*
|
||||||
|
* @param optional String $protocol The wrapper name to be registered.
|
||||||
|
* @return Boolean True on success, false otherwise.
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
static function register($protocol = 'sftp')
|
||||||
|
{
|
||||||
|
if (in_array($protocol, stream_get_wrappers(), true)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return stream_wrapper_register($protocol, __CLASS__);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Constructor
|
* The Constructor
|
||||||
*
|
*
|
||||||
@ -783,6 +798,4 @@ class Net_SFTP_Stream
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists('stream_wrapper_register')) {
|
Net_SFTP_Stream::register();
|
||||||
stream_wrapper_register('sftp', 'Net_SFTP_Stream');
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user