Skip to content

A plugin is laid out like core: src/<Bucket>/<Class>.php - #163

Merged
mastacontrola merged 1 commit into
masterfrom
plugin-psr4-layout
Aug 31, 2026
Merged

A plugin is laid out like core: src/<Bucket>/<Class>.php#163
mastacontrola merged 1 commit into
masterfrom
plugin-psr4-layout

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Mirrors FOGProject/fogproject#1540 and FOGProject/fog-plugins#34.

A plugin's PHP moved out of class/ pages/ hooks/ events/ reports/ tasks/ and into:

<plugin>/src/<Bucket>/<Class>.php   declares   FOG\Plugins\<Segment>\<Bucket>\<Class>

— the same PSR-4 arrangement core already used on itself. The plugin directory does not move: it is still the routing node, the permission string and the js/ path, so nothing user-visible changes and there is no migration for an admin to run.

What changed here

Doc Change
docs/development/plugin-development.md Re-ported from the fogproject copy. Rewritten §2, §3, §4.2–4.5, §7a, §9a, §10, §11; the "Discovery still works by filename" subsection is the claim being reversed and is gone; new §11b is the port table for a plugin still on the pre-1.6 layout.
docs/development/plugin-schema-migrations.md Its Key files table still named lib/fog/*.class.php paths that moved when core itself went PSR-4.
docs/1.6/management/web/reports.md User-facing, and it was teaching a path that no longer exists. A report is packages/web/src/Reports/<Class>.php, or <plugin>/src/Reports/<Class>.php inside a plugin. Also spells out why the underscores in Fleet_Report are load-bearing — the menu label, the base64 f URL parameter and the permission node are all derived from that name.
docs/development/storage-node-selection-hooks.md Pointed at lib/fog/storagegroup.class.php and told authors to write a *.hook.php in lib/hooks/.
docs/1.6/kb/reference/csv_import_export.md Named the Location plugin's import hook by its old filename.

Translations

Left alone deliberately. scripts/translate.mjs retranslates a page when its source hash moves, so the French copies refresh themselves on the next run once a provider is configured — hand-editing them now would only be overwritten.

Not changed, and worth a separate look

reports.md's Importing a report section documents a form that has no server-side handler: ReportManagement::upload() renders the Import Reports form, and there is no uploadPost() anywhere in packages/web — nor has there ever been on working-1.6 (git log -S uploadPost is empty). That is a pre-existing defect, independent of this move, so the section is untouched here rather than quietly deleted.

Mirrors FOGProject/fogproject#1540 and FOGProject/fog-plugins#34. A
plugin's PHP moved out of class/ pages/ hooks/ events/ reports/ tasks/
and into src/<Bucket>/<Class>.php, declaring
FOG\Plugins\<Segment>\<Bucket>\<Class> -- the same PSR-4 arrangement core
already used on itself. The plugin DIRECTORY does not move: it is still
the routing node, the permission string and the js/ path.

plugin-development.md is re-ported from the fogproject copy, so it
carries the rewritten §2, §3, §4.2-4.5, §7a, §9a, §10 and §11, loses the
"Discovery still works by filename" subsection that taught the rule this
reverses, and gains §11b -- the port table for a plugin still on the
pre-1.6 layout.

plugin-schema-migrations.md's Key files table still named
lib/fog/*.class.php paths that moved when core itself went PSR-4; the
reference implementation is now
lib/plugins/location/src/Managers/LocationManager.php.

reports.md is the user-facing half and was teaching a path that no longer
exists. A report is packages/web/src/Reports/<Class>.php, or
<plugin>/src/Reports/<Class>.php inside a plugin, and the underscores in
Fleet_Report are load bearing -- the menu label, the base64 `f` parameter
and the permission node are all derived from that name.

Two adjacent references corrected while here: the storage-node hook guide
pointed at lib/fog/storagegroup.class.php and told authors to write a
*.hook.php in lib/hooks/, and the CSV guide named the Location plugin's
hook by its old filename.

Translations are left alone. scripts/translate.mjs regenerates a page
when its source hash moves, so the French copies refresh themselves once
a provider is configured.

Co-Authored-By: Claude <noreply@anthropic.com>
@mastacontrola
mastacontrola merged commit be608a6 into master Aug 31, 2026
@mastacontrola
mastacontrola deleted the plugin-psr4-layout branch August 31, 2026 15:14
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.

1 participant