26 lines
516 B
PHP
26 lines
516 B
PHP
|
<?php
|
||
|
require __DIR__ . '/lib/MinecraftPing.php';
|
||
|
require __DIR__ . '/lib/MinecraftPingException.php';
|
||
|
|
||
|
use xPaw\MinecraftPing;
|
||
|
use xPaw\MinecraftPingException;
|
||
|
|
||
|
try
|
||
|
{
|
||
|
$Query = new MinecraftPing( 'localhost', 25555 );
|
||
|
|
||
|
print_r( $Query->Query() );
|
||
|
}
|
||
|
catch( MinecraftPingException $e )
|
||
|
{
|
||
|
echo $e->getMessage();
|
||
|
}
|
||
|
finally
|
||
|
{
|
||
|
if( $Query )
|
||
|
{
|
||
|
$Query->Close();
|
||
|
}
|
||
|
}
|
||
|
?>
|