Composer does not load automatically

I am currently working on Laravel 4. I added the following to my composer.json and started the update:

"require": { ... "koraktor/steam-condenser": "*" 

Package: https://packagist.org/packages/koraktor/steam-condenser

The problem I am facing is that if I call one of the classes that it uses, for example:

 $steamUser = new SteamId('000000000000000000'); echo "Welcome, " . $steamUser->getNickname() . "<br />"; 

I get an error Class 'SteamId' not found

If I need a file manually, it works fine:

 require_once('/home/path-to-laravel/laravel/vendor/koraktor/steam-condenser/lib/steam-condenser.php'); 

I ran composer dump-autoload and still not working. Does anyone know why this is? It really upsets me :(

+7
source share
2 answers

Steam Condenser is not yet compatible with PSR-0, so you need to use a different approach to startup (see http://getcomposer.org/doc/04-schema.md#autoload ).

Using the files method is best suited here:

 { "autoload": { "files": ["vendor/koraktor/steam-condenser/lib/steam-condenser.php"] } } 
+9
source

It just requires a package, it does not force the composer to automatically download the package.

Look at startup with the composer, but something like this should start:

 autoload: { "classmap": ["vendor/koraktor/steam-condenso/lib"] } 
+1
source

All Articles