This tutorial assumes that you know what composer is and have it installed on your system. You can go to http://getcomposer.org for information. Miner is still a beta program and bugs should be labelled as "features". If that label won't stick please report it at https://github.com/Falkirks/Miner/issues The problem Composer is great. But it just won't play well with PocketMine for a few reasons: The "/vendor" directory contradicts PocketMine plugin development standards Registering an additional autoloader for composer is messy and impractical. Also it could interfere with the PocketMine one. Also the classes wouldn't be accessible from AsyncTasks because that autoloaders need to be registered again on the worker threads. Adding "/vendor" to the PocketMien autoloader would work but would not be standards and would cause issues if PocketMine needed to remove your plugin from the loader. The solution Miner. Miner is composer wrapper which behaves like composer. Just run Miner instead of composer and Miner will do directory prep, execute composer and then port the composer autoloaders into your "/src" directory. This will work for most psr-0 and psr-4 autoloaders, it can even fix some autoloaders which wouldn't work on a simple copy-paste. How? Get composer installed as one of the following composer (in your $PATH) composer.phar (in your home directory) composer.phar (in plugin directory) Go to https://github.com/Falkirks/Miner/releases/latest and download the phar build. Put it somewhere that is easy to access on your computer. Open a terminal and cd to your plugin directory with a composer.json Run php /path/to/Miner.phar You should see something similar to what is shown above. Now try running php /path/to/Miner.phar install This will install dependencies and move them to you "/src"
That would be useful. Didn't think to do that at the time. I am just executing the PHAR file directly with PHP, so a stub like that never was really needed in my build process. If you want to PR, go ahead.
But it has the side effect of an extra line of STDOUT, which may not be so attractive. (It has to be before <?php)