Skip to content

Commit 7785f75

Browse files
committed
Add an initial guide to modifying the plugin template
Add some initial guidance on which files to modify, and a note to help mitigate the namespace clash/hash issue. Fixes: #16
1 parent 903d9c2 commit 7785f75

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,13 @@ Checks took 0.01 seconds and used 6.608MB of memory
5555
No files analyzed
5656
Psalm was able to infer types for 97.7273% of the codebase
5757
```
58+
59+
## Modifying the template for a new plugin
60+
61+
To create a new plugin start by modify the following:
62+
63+
* `index.php` - Metadata for the plugin (name, version, etc)
64+
* `composer.json` - Package Metadata and namespace (psr-4)
65+
* `load.php` - Define the namespace
66+
67+
Note: As we're distributing the `vendor.phar` file it may be a good idea to add an [autoload-suffix](https://getcomposer.org/doc/06-config.md#autoloader-suffix)" to the `config` object in `composer.json` and then re-generate the lock file. This ensures that there are no other namespace clashes and a unique hash is generated from the composer.json. This is especially important if other plugins have been based off this template.

0 commit comments

Comments
 (0)