error in my php code

62 views
Skip to first unread message

Chinmay Chandak

unread,
Nov 17, 2016, 3:57:56 PM11/17/16
to Steam Condenser


i have placed my test.php inside lib folder
<?php
require_once('SteamCondenser.php');
use SteamCondenser\Servers\GoldSrcServer;
$server = new GoldSrcServer('192.168.1.104', 27020);
$server->initialize();
echo $server->getPlayers();
?>
i get this error when i run test .php

( ! ) Fatal error: Class 'SteamCondenser\Servers\GoldSrcServer' not found in E:\wamp\www\openGCP\lib\test.php on line 4

Sebastian Staudt

unread,
Nov 18, 2016, 3:07:06 AM11/18/16
to Steam Condenser
Looks like autloading isn't setup correctly.
Did you use Composer to integrate Steam Condenser?
Composer should handle this by default.

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/5b47d635-97b5-4895-b5b5-9d29f1238b8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chinmay Chandak

unread,
Nov 18, 2016, 8:19:26 AM11/18/16
to Steam Condenser
i am not using composer, i downloaded the package from github and then placed test.php in the same file as SteamCondenser.php

Sebastian Staudt

unread,
Nov 26, 2016, 5:49:21 AM11/26/16
to Steam Condenser
You should either try using Composer or you'll have to setup an autoloader yourself. Or you may also fallback to requiring each file on your own.

Chinmay Chandak <chandak...@gmail.com> schrieb am Fr., 18. Nov. 2016 um 14:19 Uhr:
i am not using composer, i downloaded the package from github and then placed test.php in the same file as SteamCondenser.php

--
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.
Reply all
Reply to author
Forward
0 new messages