1
0
mirror of https://github.com/xPaw/PHP-Source-Query.git synced 2026-05-18 14:33:34 +02:00

PSR-4 support for #70 plus PhpDoc

This commit is contained in:
Tim
2015-10-10 17:31:05 +01:00
parent a0f07fa801
commit 9af9cf4f6b
17 changed files with 259 additions and 98 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
require __DIR__ . '/../SourceQuery/bootstrap.php';
use xPaw\SourceQuery\SourceQuery;
// For the sake of this example
Header( 'Content-Type: text/plain' );
Header( 'X-Content-Type-Options: nosniff' );
// Edit this ->
define( 'SQ_SERVER_ADDR', 'localhost' );
define( 'SQ_SERVER_PORT', 27015 );
define( 'SQ_TIMEOUT', 1 );
define( 'SQ_ENGINE', SourceQuery :: SOURCE );
// Edit this <-
$Query = new SourceQuery( );
try
{
$Query->Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE );
print_r( $Query->GetInfo( ) );
print_r( $Query->GetPlayers( ) );
print_r( $Query->GetRules( ) );
}
catch( Exception $e )
{
echo $e->getMessage( );
}
$Query->Disconnect( );