• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use phpseclib by composer

#1
Hi everybody,

I need some help... I install the phpseclib Modul by composer, but how can I use the Library???


Code:
include('Net/SFTP.php');

This Code will not work :-(

Thanks for your help!
Tom
Reply

#2
(02-15-2017, 07:33 AM)SirTom Wrote: Hi everybody,

I need some help... I install the phpseclib Modul by composer, but how can I use the Library???


Code:
include('Net/SFTP.php');

This Code will not work :-(

Thanks for your help!
Tom


In config/config.php:


PHP Code:
$config['composer_autoload'] = TRUE


It is especially important that your vendor directory be INSIDE your application directory, which means placing your composer.json file INSIDE the application directory. Run composer init inside the application directory if you don't already have a composer.json file there. Once you've created your composer.json and required phpseclib, make sure to run composer update.

Then inside your library, controller, model, etc:


PHP Code:
<?php
use \phpseclib\Net\SFTP;

class 
Whatever {

  public function doSftp(){
    $sftp = new SFTP('123.456.789.000''22''10');
    // now use SFTP ...
  }

Reply

#3
Thanks!!!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.