1
0
Fork
You've already forked digitigrade-template-plugin
0
template plugin for Digitigrade
  • PHP 100%
2025年03月26日 21:54:29 +00:00
src initial commit 2025年03月26日 21:54:29 +00:00
.gitignore initial commit 2025年03月26日 21:54:29 +00:00
build.php initial commit 2025年03月26日 21:54:29 +00:00
Digitigrade_PluginMetadata.php initial commit 2025年03月26日 21:54:29 +00:00
LICENSE initial commit 2025年03月26日 21:54:29 +00:00
metadata.ini initial commit 2025年03月26日 21:54:29 +00:00
README.md initial commit 2025年03月26日 21:54:29 +00:00
stub.php.in initial commit 2025年03月26日 21:54:29 +00:00

Template Digitigrade plugin

This is an implementation of a basic plugin for Digitigrade. As an example, it adds a new route handler for /hello-world and uses an autoloaded class to provide the text shown on that page. This is almost certainly not what you want your own plugin to do, but hopefully it provides a good starting point.

Building and usage

Running ./build.php (or php build.php) will generate a plugin phar file based on the sources in src/ and the metadata in metadata.ini. You can then distribute this file or put it in your Digitigrade installation's plugins folder. As an additional feature, the template includes a simple executable phar stub that outputs the plugin's metadata, so you can "run" the plugin with PHP to remind yourself what it is if needed.

General guidelines

When creating your plugin, please try to do the following:

  • Put your classes in the namespace Digitigrade\Plugin\<your plugin name>
  • Don't do too much in your entrypoint, if you have one - it will be executed whenever the plugin is loaded, which in practice means at the start of every request
  • Make use of existing frameworks in Digitigrade (such as the policy system) where possible, rather than implementing your own