feat: network-scoped USER.md and NETWORK.md for multisite#874
Merged
Conversation
On multisite, WordPress users are network-wide but USER.md was stored
per-site via wp_upload_dir(). This caused each subsite to have its own
isolated copy at wp-content/uploads/sites/{id}/datamachine-files/users/.
Changes:
- DirectoryManager::get_user_directory() now resolves to the main site's
uploads dir on multisite via new get_network_base_directory() helper
- Added LAYER_NETWORK to MemoryFileRegistry for network-scoped files
- Added get_network_directory() for NETWORK.md and future network files
- NETWORK.md scaffold generates multisite topology (sites, themes,
network plugins, shared resources)
- Migration consolidates per-site USER.md files to network location,
keeping the richest (largest) copy
- Updated all layer directory consumers: CoreMemoryFilesDirective,
MemoryFilesReader, AgentFileAbilities, MemoryCommand CLI
- Single-site behavior is completely unchanged
Closes #816. Closes #873.
Homeboy Results —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
networklayer.Changes across 9 files
DirectoryManager.phpget_user_directory()uses newget_network_base_directory()on multisite; addedget_network_directory()MemoryFileRegistry.phpLAYER_NETWORKconstant and validationCoreMemoryFilesDirective.php$layer_dirsmapMemoryFilesReader.php$layer_dirsmapAgentFileAbilities.phpresolveLayerDirectory()MemoryCommand.phpagent pathsoutputbootstrap.phpmigrations.phpdatamachine_get_network_scaffold_content()+datamachine_migrate_user_md_to_network_scope()data-machine.phpdatamachine_activate_for_site()Architecture
Testing
php -lsyntax checkCloses #816. Closes #873.