Download the PHP package nozell/commando without Composer

On this page you can find all versions of the php package nozell/commando. 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 commando

Commando 


A PocketMine-MP Virion for easier implementation of dynamic commands, including support for Minecraft: Bedrock Edition argument listing aimed for both the end users and the plugin developers.

Usage:

Installation is easy, you may get a compiled phar here, integrate the virion itself into your plugin or you could also use it as a composer library by running the command below:

composer require cortexpe/commando

This virion is purely object oriented. So, to use it you'll have to extend the BaseCommand object, import the PacketHooker object and the optional objects for subcommands and arguments (whenever necessary).

For PocketMine-MP API 4, you will need to include Muqsit/SimplePacketHandler in your dependencies.

Why is this necessary?

The virion provides an easy way to verify user input, convert user input, and for making sure that our arguments are the type that we expect it to.

On the plus side, it also provides the argument list for the client to recognize making it easy to use the command without remembering the order of arguments.

Because not only MC: Bedrock can use the commands, I've also implemented command usage pre-generation for ease of use with the console as well.

This also provides an easy to use API for lessening boilerplate code while adding more functionality and verbosity (error codes, and error lists, and sending usage messages).

It is structured in a similar way to the legacy PocketMine commands for ease of migration from an older codebase.

Upon the time of writing this readme file, This virion will be used on Hierarchy for the command implementation clean-up

Basic Usage:

NOTE: Other miscellaneous functions can be indexed within your IDEs or by reading the source code. This is only the basic usage of the virion, it does not show every aspect of it as that'd be too long to document.

Create your command class

In our command class, we need to extend BaseCommand and implement its required methods to use all of Commando's features.

Register the arguments

If we register arguments, we need to import and use / extend (if needed) the provided argument objects.

Handling our arguments

The arguments passed on our onRun method will be mapped by name => value this makes it easy to understand which argument is which, instead of using numeric indices. It is also guaranteed that the arguments passed will be the declared type that we've set.

Registering the PacketHooker for vanilla command arguments

The PacketHooker listener is required for us to be able to inject data to the AvailableCommandsPacket the server sends.

Registering the command from a plugin

Once we've constructed our command with our arguments and subcommands, we can now register our command to PocketMine's command map, to be available to our users.

The only difference with using this framework is that you don't need to set the usage message, as they are pre-generated after all the arguments have been registered.

SubCommands

Subcommands work the same way as regular commands, the only difference is that they're registered on the parent command with BaseCommand->registerSubCommand() having their own set of arguments and own usage message.

Error messages

The virion provides default error messages for user input errors regarding the arguments given. It also provides a way to register your own error message formats for the sake of customizability.

The error messages are sent in bulk to the users to let them know what parts are wrong with their input, not having to do trial-and-error. A current limitation is that, you cannot register your own error messages with other error codes.


This framework was made with :heart: by CortexPE, Enjoy!~ :3


All versions of commando with dependencies

PHP Build Version
Package Version
Requires pocketmine/pocketmine-mp Version ^5.0
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 nozell/commando contains the following files

Loading the files please wait ....