Example with PHP error

104 views
Skip to first unread message

filewarez filewarez

unread,
Jul 19, 2016, 2:06:18 PM7/19/16
to Steam Condenser


Hi guys,

I'm noob in php, especially with composer and tried to use this lib for game Rust.

Composer installed the application from the official website and unzipped all github SteamCondenser folder in my folder "libs", thus:

megarust-> libs-> steam condenser-php-master

then I created a file called test.php on folder "megarust" with the following contents:

<?php
require_once
'libs/steamcondenser-php-master/lib/SteamCondenser.php';
use SteamCondenser\Servers\SourceServer;
$server
= new SourceServer ('64 .94.238.25 ', 28015);
$server
-> initialize ();
print_r
($server-> getPlayers ());
?>


But I get the error:
Fatal error: Class 'SourceServer' not found in C:\wamp\www\megarust\123.php on line 4


Someone could go a step by step of how to use this lib?

Thanks!

Sebastian Staudt

unread,
Jul 19, 2016, 2:45:33 PM7/19/16
to Steam Condenser
Hi,

Composer should install to ./vendor.
Are you sure the libs directory was created by composer?

Best regards,
Sebastian
--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/5c139e76-2efa-4671-94c9-ff8340f57f51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

filewarez filewarez

unread,
Jul 19, 2016, 5:05:04 PM7/19/16
to Steam Condenser

Hi, I install with "php composer.phar install" , and composer create a vendor folder, see the picture:
It's correct?




Thanks for the answer.

Sebastian Staudt

unread,
Jul 19, 2016, 5:35:59 PM7/19/16
to Steam Condenser
That seems a little odd. Looks like your running composer from within libs/steam-condenser-php-master.
You’ll need to create a composer.json file inside your project and run composer from there.
Please have a look at Composer’s docs: https://getcomposer.org/doc/01-basic-usage.md

--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.

filewarez filewarez

unread,
Jul 19, 2016, 5:43:21 PM7/19/16
to Steam Condenser
Hi, I'am copy now you composer.json to my project directory and execute a comand


now my folder like this:


and the error is same:


( ! ) Fatal error: Class 'SourceServer' not found in C:\wamp\www\megarust\123.php on line 4


Thanks Sebastian!


Em terça-feira, 19 de julho de 2016 15:06:18 UTC-3, filewarez filewarez escreveu:

Sebastian Staudt

unread,
Jul 19, 2016, 5:45:31 PM7/19/16
to Steam Condenser
Copying the composer.json isn't enough. You'll need to write your own, referencing steam-condenser.
--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
Message has been deleted

filewarez filewarez

unread,
Jul 19, 2016, 10:55:44 PM7/19/16
to Steam Condenser
Thanks for the great patience Sebastian,

I test now and receive the infos on the server.

Thanks again!


Em terça-feira, 19 de julho de 2016 15:06:18 UTC-3, filewarez filewarez escreveu:
Reply all
Reply to author
Forward
0 new messages