Skip to content

Commit

Permalink
Example Properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jgniecki committed Aug 1, 2020
1 parent 5d3ee73 commit ee4d302
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,29 @@ This class allows downloading logs from the server.
echo implode("<br />", $logs->getLogs(true));
```

### Properties

```php
<?php
require 'vendor/autoload.php';

use DevLancer\MCPack\Properties;
use phpseclib\Net\SFTP;

$host = "some.minecraftserver.com";
$login = "user";
$password = "password";
$sftp = new SFTP($host);
$sftp->login($login, $password);
$sftp->setTimeout(3);

$properties = Properties::generate($sftp, "mc/server.properties");
$port = (int) $properties->getProperty("server-port");
$query_port = (int) $properties->getProperty("query.port");
$rcon_port = (int) $properties->getProperty("rcon.port");
$rcon_pass = $properties->getProperty("rcon.password");

```

## License
[MIT](LICENSE)

0 comments on commit ee4d302

Please sign in to comment.