Herzult / php-ssh

An experimental object oriented SSH api in PHP
MIT License
359 stars 82 forks source link

Composer install issue when ssh2 not available #30

Closed antonmedv closed 10 years ago

antonmedv commented 10 years ago

The php-ssh dependency has a hard dependency on the ssh extension.

 "ext-ssh2": "*"

Possible solution is to make ext-ssh2 a suggest instead of a require.

It will help to install libs which uses php-ssh as require.

antonmedv commented 10 years ago

Hey! Any body there? :)

martijngastkemper commented 10 years ago

This library uses function from ext-ssh2 so installing it without ssh2 will break this library.

$stdout = ssh2_exec($this->getResource(), $cmd, $pty, $env, $width, $height, $width_height_type);

ssh2_exec is a function from ssh2 to if that extension isn't available it won't work.

antonmedv commented 10 years ago

My lib uses your php-ssh lib, but if ext-ssh does not available, it fallback to phpseclib.

01 àâã. 2014 ã., â 11:57, Martijn Gastkemper notifications@github.com íàïèñàë(à):

This library uses function from ext-ssh2 so installing it without ssh2 will break this library.

$stdout = ssh2_exec($this->getResource(), $cmd, $pty, $env, $width, $height, $width_height_type); ssh2_exec is a function from ssh2 to if that extension isn't available it won't work.

— Reply to this email directly or view it on GitHub.

martijngastkemper commented 10 years ago

I'm not maintaining this lib. I didn't know phpseclib. Maybe you can add phpseclib as a suggestion too.

h4cc commented 10 years ago

@elfet Thanks for your contribution. As @martijngastkemper said, this library is hardwired to ext-ssh2. Removing that requirement will result in annoying runtime errors for people trying to use this library without the extension. The feature you are intending to have is desirable and your intention is comprehensible, but i think it can not be fulfilled with your suggested change.

@Herzult What do you think about this?

h4cc commented 10 years ago

@elfet Have a look at this configuration option: https://github.com/composer/composer/pull/2990 Maybe that is what you could use.

Closing here for now.