mirror of
https://github.com/xPaw/PHP-Source-Query.git
synced 2026-06-10 23:33:15 +02:00
Bring in CS-Fixer, reformat.
This commit is contained in:
+30
-32
@@ -1,34 +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( );
|
||||
}
|
||||
finally
|
||||
{
|
||||
$Query->Disconnect( );
|
||||
}
|
||||
declare(strict_types=1);
|
||||
|
||||
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();
|
||||
} finally {
|
||||
$Query->Disconnect();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user