Skip to content

Add an initial guide to modifying the plugin template#19

Merged
michaelwood merged 2 commits into
mainfrom
chore/update-readme-to-add-note-on-hash-collision
May 7, 2026
Merged

Add an initial guide to modifying the plugin template#19
michaelwood merged 2 commits into
mainfrom
chore/update-readme-to-add-note-on-hash-collision

Conversation

@michaelwood
Copy link
Copy Markdown
Contributor

Add some initial guidance on which files to modify, and a note to help mitigate the namespace clash/hash issue.

Fixes: #16

Comment thread README.md Outdated

To create a new plugin start by modify the following:

* `index.php` - Metadata for the plugin (name, version, etc)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be renamed to plugin-name.php

Comment thread README.md Outdated
* `composer.json` - Package Metadata and namespace (psr-4)
* `load.php` - Define the namespace

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. No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe give an example?

Copy link
Copy Markdown
Contributor

@snim2 snim2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Add some initial guidance on which files to modify, and a note to help
mitigate the namespace clash/hash issue.

Fixes: #16
Expand the note about clashing namespace and give it its own section.
Add an example of an autoloader-suffix
@michaelwood michaelwood force-pushed the chore/update-readme-to-add-note-on-hash-collision branch from 7785f75 to 340b5b9 Compare May 7, 2026 13:25
@michaelwood michaelwood merged commit 9416b54 into main May 7, 2026
2 checks passed
@michaelwood michaelwood deleted the chore/update-readme-to-add-note-on-hash-collision branch May 7, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composer hash collision on autoloader

2 participants