1. Go to this page and download the library: Download radic/bukkit-swift-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
array(
'global' => array(
'host' => 'localhost',
'port' => 21111,
'username' => 'admin',
'password' => 'test',
'salt' => 'saltines'
),
'my-other-server' => array(
'host' => '11.11.11.11',
'username' => 'admin',
'password' => 'test'
// If you left out config settings, it will use the global for that setting
)
);
// Uses global config settings
$api = SwiftAPI::connect();
// Define all connection parameters inline
$api = SwiftAPI::connect('ip-or-host', 4444, 'username', 'password', 'crypt-salt');
// null or left out parameters will default back to the global config
$api = SwiftAPI::connect('ip-or-host', null, 'username', 'password');
// Uses 'my-other-server' from conffig.
$api = SwiftAPI::connectTo('my-other-server');