Closed Qoraiche closed 8 years ago
Looking at your code and the error message this seems to be the same problem as mentioned on the mailing list: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/steam-condenser/rmiEzxG01TM/AuqAPrPOCQAJ
So I'm just repeating my reply here:
The master branch is already namespaced. You have to include the classes that you want to use:
use SteamCondenser\Servers\SourceServer;
Add this line after the
require_once()
.
i do what you say here is the code :
<?php
require_once('./lib/SteamCondenser.php'); use SteamCondenser\Servers\SourceServer; $server = new SourceServer('192.168.0.114', 27015); $server->initialize(); print_r($server->getPlayers());
?>
another error :
Fatal error: Class 'SteamCondenser\Servers\SourceServer' not found in C:\wamp\www\steam-condenser-php-master\ex.php on line 7
Oh, didn’t notice that you’re not using Composer (See https://getcomposer.org/doc/).
Install Composer and run composer install
.
After that use the following require:
require_once "./vendor/autoload.php";
If you don’t want to use Composer, you can only require all needed files manually.
thanks , fixed now , nice day bro
hi , i install steam-condenser and all modules with composer and i create exemple.php file and i add the following code just to test library :
<?php require_once('./lib/SteamCondenser.php'); $server = new SourceServer('193.192.59.19', 27031); ?>
but i always get this error : Fatal error: Class 'SourceServer' not found in C:\wamp\www\steam-condenser-php-master\exemple.php on line 4