fuel / core

Fuel PHP Framework - The core of the Fuel v1 framework
http://fuelphp.com
813 stars 345 forks source link

Problem with using phpseclib from composer #1951

Closed craftpip closed 8 years ago

craftpip commented 8 years ago

Hello, I installed flysystem, that uses phpseclib for its sftp functionalities, So i have noticed composer installed phpseclib as its dependencies.

When i try to use the flysystem library i get the error:

COREPATH/vendor/phpseclib/Net/SSH2.php" does not contain class "phpseclib\Net\SSH2"

Apparently there are two copies of phpseclib in Fuel now, and Flysystem is using the one in the Fuel's Core directory.

How do i overcome this? Thank you.

kenjis commented 8 years ago

COREPATH/vendor/phpseclib was removed yesterday. Try the latest 1.8/develop branch.

craftpip commented 8 years ago

Do i need to update the other components like Auth, Email, Oil also to 1.8/develop ? My current version is 1.7/master

WanWizard commented 8 years ago

The problem here is that the included version of PHPSecLib is from before the composer package. At that time it was not namespaced, and we decided to move it to the "phpseclib" namespace.

The composer package uses the same namespace, violating the general rule that you use "vendorname\packagename" for your composer namespace.

If you upgrade your core to 1.8/develop, I suggest you upgrade the other packages too, for consistency. Only the Auth package has a phpseclib dependency, so that one MUST be upgraded.

If you do so you also get PHP7 compatibility.

craftpip commented 8 years ago

Alright, so now i understood the problem, it was helpful. Thanks for the support :)

craftpip commented 8 years ago

Hello, After upgrading to 1.8/develop i get the following error

Mustache_Exception_RuntimeException [ Error ]: FilesystemLoader baseDir must be a directory: UTF-8
DOCROOT/fuel/vendor/mustache/mustache/src/Mustache/Loader/FilesystemLoader.php @ line 57
WanWizard commented 8 years ago

That suggests a Mustache error, not a FuelPHP error?

WanWizard commented 8 years ago

Your basedir isn't set correctly.

See https://github.com/bobthecow/mustache.php/blob/master/src/Mustache/Loader/FilesystemLoader.php#L48

craftpip commented 8 years ago

I got it, Thanks for the great support, love fuel. :+1: