1
votes

Using steam condenser with laravel 4 and installed it via composer.

I am trying to get the players inventory for dota2. I tried:

WebApi::setApiKey('*******');
$inventory = DotA2Inventory::createInventory('username');

But it gives me:

Class 'DotA2Inventory' not found

I am doing this on my User Controller.

Here is the inventory class, and here is the dota2 inventory class.

I am just trying to extract the inventory of the user so I can display it, complete with image, name, rarity and other item info.


UPDATE

So I have found that I forgot to add this:

require_once STEAM_CONDENSER_PATH . 'steam/community/GameInventory.php';

Now with that I am getting another error: Trying to get property of non-object

protected function _getJSONData($interface, $method, $version = 1, $params = null) {
    $data = $this->getJSON($interface, $method, $version, $params);
    $result = json_decode($data)->result;

Additional Info

I am working with version 1.3.7 of steam-condenser. (checked my steam-condenser.php to confirm this)

The error is "Trying to get property of non-object" on line 190 of WebApi.php

$result = json_decode($data)->result;

Specifically was trying to get the dota 2 inventory of the user 76561198115395760.

2
Please add more detail to your question. What version of Steam Condenser are you using and at which line does the error occur (a stack trace is always welcome)? Additionally, it's always interesting to see which exact user / inventory causes your problem.Koraktor
@Koraktor I have updated my question with additional info sir.madziikoy
Line 190 of WebApi.php does not access a property, so it can't be the cause of your problem: github.com/koraktor/steam-condenser-php/blob/1.3.7/lib/steam/…Koraktor
@Koraktor oddly that is what the error says. On this note line 190 of my webapi.php is this $result = json_decode($data)->result;madziikoy

2 Answers

0
votes

json_decode() will probably return an array. Try

$array = json_decode($data);
$result = $array['result'];
0
votes

Having a look at the answer to this question and your issue on GitHub this may be caused by your PHP environment (WAMP) on Windows.

Please try using XAMPP (or a manual installation).