Adds phpseclib version 3.
This commit is contained in:
@ -12,13 +12,20 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// add the autoloader for the composer classes
|
||||
$composer_autoloader = JPATH_LIBRARIES . '/phpseclib3/vendor/autoload.php';
|
||||
if (file_exists($composer_autoloader))
|
||||
{
|
||||
require_once $composer_autoloader;
|
||||
}
|
||||
|
||||
// register this component namespace
|
||||
spl_autoload_register(function ($class) {
|
||||
// project-specific base directories and namespace prefix
|
||||
$search = array(
|
||||
$search = [
|
||||
'libraries/jcb_powers/VDM.Joomla' => 'VDM\\Joomla',
|
||||
'libraries/jcb_powers/VDM.Gitea' => 'VDM\\Gitea'
|
||||
);
|
||||
];
|
||||
// Start the search and load if found
|
||||
$found = false;
|
||||
$found_base_dir = "";
|
||||
@ -40,7 +47,7 @@ spl_autoload_register(function ($class) {
|
||||
// check if we found a match
|
||||
if (!$found)
|
||||
{
|
||||
// no, move to the next registered autoloader
|
||||
// not found so move to the next registered autoloader
|
||||
return;
|
||||
}
|
||||
// get the relative class name
|
||||
@ -3796,7 +3803,7 @@ abstract class ComponentbuilderHelper
|
||||
// make sure we have the composer classes loaded
|
||||
self::composerAutoload('phpseclib');
|
||||
// build class name
|
||||
$CLASS = '\phpseclib3\Crypt\\' . $type;
|
||||
$CLASS = '\phpseclib\Crypt\\' . $type;
|
||||
// make sure we have the phpseclib classes
|
||||
if (!class_exists($CLASS))
|
||||
{
|
||||
@ -3955,7 +3962,7 @@ abstract class ComponentbuilderHelper
|
||||
// make sure we have the composer classes loaded
|
||||
self::composerAutoload('phpseclib');
|
||||
// make sure we have the phpseclib classes
|
||||
if (!class_exists('\phpseclib3\Net\SFTP'))
|
||||
if (!class_exists('\phpseclib\Net\SFTP'))
|
||||
{
|
||||
// class not in place so send out error
|
||||
JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error');
|
||||
@ -3964,7 +3971,7 @@ abstract class ComponentbuilderHelper
|
||||
// insure the port is set
|
||||
$server->port = (isset($server->port) && is_numeric($server->port) && $server->port > 0) ? (int) $server->port : 22;
|
||||
// open the connection
|
||||
self::$sftp[$server->cache] = new phpseclib3\Net\SFTP($server->host, $server->port);
|
||||
self::$sftp[$server->cache] = new phpseclib\Net\SFTP($server->host, $server->port);
|
||||
// heads-up on protocol
|
||||
self::$sftp[$server->cache]->jcb_protocol = 2; // SFTP <-- if called not knowing what type of protocol is being used
|
||||
// now login based on authentication type
|
||||
|
Reference in New Issue
Block a user