Plugin skeleton generator

From MoodleDocs
Revision as of 07:48, 21 August 2016 by Alexandru Elisei (talk | contribs) (Add installation instructions)

Generate plugin skeleton

The plugin will generate the skeleton files needed for a specific plugin type. The full functionality of the plugin can be accessed either via a web interface or the command line script.

To generate a skeleton plugin via the web interface:

  1. Proceed to Administration > Site administration > Development > Generate plugin skeleton
  2. Fill in the various plugin features then click on the "Download plugin skeleton button"
Generate plugin skeleton

To generate the plugin skeleton by using the comand line interface:

  1. Create a recipe file in the YAML format, either by writing it from scratch or by editing the template recipe located at "cli/example.yaml" (recommended)
  2. Invoke the command line script at "cli/generate.php":
   php cli/generate.php --recipe=recipe.yaml

Installation

This plugin has been tested to work with Moodle 3.1 and newer. There are no guarantess it will work with earlier versions.

General installation procedures are those common for all Moodle plugins: Installing plugins.

When downloading the plugin from the git repository tool_pluginskel there are several options available: cloning the repository, downloading the zip file and extracting it or using the zip file for the plugin install interface accessible at Administration > Site administration > Plugins > Install plugins.

If you choose to clone the repository, then you need to clone it into MOODLE_ROOT_DIRECTORY/admin/tool/pluginskel:

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

replacing MOODLE_ROOT_DIRECTORY with the actual Moodle installation root directory path. The zip file should be extracted to the same location.

Keep in mind that cloning the repository also creates a hidden .git directory, which you may not want on live servers.

Note: If you decide to use the install plugin interface don't forget to rename the folder inside the archive to pluginskel.