Moodle plugin skeleton generator

Admin tools ::: tool_pluginskel
Maintained by David Mudrák
Allows developers to quickly generate code skeleton for a new Moodle plugin.
Latest release:
405 sites
441 downloads
58 fans

This tool allows developers to quickly generate code skeleton for Moodle plugins. Relevant code is generated according to defined list of requested plugin features.

Usage

Plugin features and other properties are described in so called recipe files. Recipes use YAML syntax.

    name: Moodle demo plugin
    component: tool_demo
    release: "0.1.0"
    requires: "3.9"
    maturity: MATURITY_ALPHA
    copyright: 2021 David Mudrák 

    features:
      readme: true
      license: true
      settings: true

    privacy:
      haspersonaldata: false

For full list of supported options, see cli/example.yaml file.

To generate skeleton of the plugin described in ./myplugin.yaml:

    $ php cli/generate.php myplugin.yaml

Run generate.php --help for more options and features.

Documentation

See the page Plugin skeleton generator at moodle docs site.

Installing from Git

  1. Go to the folder with your Moodle development installation:

    $ cd {your/moodle/dirroot}

  2. Clone this repository to the correct location folder:

    $ git clone https://github.com/mudrd8mz/moodle-tool_pluginskel.git admin/tool/pluginskel

  3. Complete the installation:

    $ sudo -u www-data php admin/cli/upgrade.php

or just log in to your Moodle development site as an admin.

Sets

This plugin is part of set Moodle development.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4

Contributors

David Mudrák (Lead maintainer)
Alexandru Elisei: Original author (GSOC 2016 student)
Geoffrey Van Wyk
Ferran Recio Calderó
Daniel Neis Araujo
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Tue, Apr 25, 2017, 10:03 PM
    It currently doesn't allow you to use 3.2 as the required Moodle version (dropdown). Does that mean we should not use it for 3.2 (or higher) plugin development?
  • Tue, Apr 25, 2017, 11:00 PM

    I believe it just needs to be updated. A pull request at github will be appreciated, or an issue created there at least. Thanks in advance.

  • Fri, Jun 1, 2018, 10:14 PM

    Version 1.1.0 released, allowing to generate privacy API scaffolding. No UI at the moment, manually edited input YAML recipes only. Refer to cli/example.yaml.

  • Thu, Apr 25, 2019, 6:09 PM
    I'm probably missing something really obvious here but my generated mod skeleton does not have an install.xml file so has no means to create initial tables. Many thanks in advance.
  • Fri, Apr 26, 2019, 4:49 PM

    Hi Steve. IIRC that is expected behaviour as the XMLDB editor is more appropriate tool to create this file. What I used to do was (1) generate the module's skeleton inside a Moodle installation (2) go directly to the site's /admin/tool/xmldb/ address (that is the annoying part where you have to avoid visiting the Notifications page that would trigger the plugin installation) and (3) create the module's install.xml using the XMLDB and (4) finally install the plugin.

    I agree this is rather cumbersome workflow. Please feel encouraged to report a new feature request so that plugins come with a bare-minimal working install.xml out of the box.

  • Fri, Oct 11, 2019, 6:45 PM

    For the record, the most recent version 1.2.3 has (among other things) the support for generating a minimal db/install.xml implemented. Thanks again Steve for raising it.

Please login to post comments