Download the PHP package stilling/minecraft-rcon without Composer

On this page you can find all versions of the php package stilling/minecraft-rcon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package minecraft-rcon

Minecraft RCON Client

tests Packagist Version

Lightweight Minecraft RCON client supporting multi-packet responses. Based on PHP-Minecraft-Rcon by thedudeguy.

The package requires PHP 8.3 or later.

Quick start

sendCommand() returns the response from the server as a string.

Constructor arguments

Argument Type Default Description
host string The server hostname or IP address.
port int The RCON port. The Minecraft default is 25575.
password string The RCON password (rcon.password in server.properties).
timeout int 3 The time in seconds to wait for the connection and for each response.

Connection state

isConnected() returns true after connect() succeeds. It returns false after disconnect(), and after the client finds that the connection is closed or not usable.

Errors

All exceptions extend Stilling\MinecraftRcon\Exceptions\RconException.

Exception Thrown when
AuthException The server rejects the password.
ConnectionException The client cannot connect, connect() is called on a connected client, sendCommand() is called before connect(), or the server closes the connection.
PacketException The command is too long (see Command length limit), or the server sends a packet with an invalid size.
TimeoutException The server does not respond within the timeout.

After an AuthException, a closed connection, or an invalid packet from the server, the client is disconnected. Call connect() to connect again.

disconnect() is safe to call when the client is not connected.

Command length limit

A command can be at most 1446 bytes. For a longer command, sendCommand() throws a PacketException and does not send the command.

Development

composer test starts a fake RCON server on 127.0.0.1:25575 and stops it when the tests end. If a server already listens on that port, the tests use it. The fake server writes its output to fake-server.log.

See also

stilling/snbt-parser reads SNBT into PHP values. Use it to parse the output of commands such as data get ....


All versions of minecraft-rcon with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stilling/minecraft-rcon contains the following files

Loading the files please wait ...