Skip to content

A template for a new LotGD module. Start with this code to make your own module.

License

Notifications You must be signed in to change notification settings

lotgd/module-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Module Template

Tests

This is a template for a new lotgd module. You can use this package to quickly initialize a new, empty module with basic features.

For full instructions, see the Modules section in the core's wiki.

Quickstart Guide

  1. Make sure you have composer available and executable.

  2. Run the following command, but replace fancymodule with whatever module name you want:

    composer create-project lotgd/module-project fancymodule --repository https://raw.githubusercontent.com/lotgd/packages/master/build/packages.json -s dev
  3. Change the namespace (MyVendor\MyNamespace\) in all files. Ideally, search and replace for MyVendor and MyNamespace individually with an editor supporting directory-wide searches.

  4. Search and replace the module name in all files (lotgd/module-project).

  5. Make sure you configure your lotgd.yml appro

  6. Test your code (by running ./t or directly vendor/bin/phpunit).

  7. Use git to track your changes.

  8. Publish your code on github or somewhere else to make it available for others. You could also use a private repository if you want to keep the module for yourself.

Remarks

The project template comes with a bunch of empty directories. The naming scheme is recommended, as it helps others feel at home in your module, but you do not need to adhere to this system. Delete the folders and make sure remove them from your git repository.

Testing

Currently, the test runners install the module, but adding the events must be done manually by adjusting the datasets. For each module you add, you also must provide data for module registration, events, even templates.