Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,27 @@ Checks took 0.01 seconds and used 6.608MB of memory
No files analyzed
Psalm was able to infer types for 97.7273% of the codebase
```

## Modifying the template for a new plugin

To create a new plugin start by modify the following:

* `index.php` - Add Metadata values for the new plugin (name, version, etc).
* `index.php` - Rename this file to the plugin name e.g. `my-new-plugin.php`.
* `composer.json` - Package Metadata and namespace (psr-4).
* `load.php` - Define the namespace.
* `README` - Update to contain any specific instructions and information for the plugin.

### Note

#### Namespace clashing
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 in the `composer.lock` and `vendor.phar` file. This is especially important if other plugins have been based off this template.
For example in composer.json:
```json
"config": {
"autoloader-suffix": "MyNewPluginNameHere",
"platform": {
"php": "8.2"
}
},
```
Loading