Skip to content

[6.x] Path service#18525

Open
riasvdv wants to merge 4 commits into6.xfrom
feature/path
Open

[6.x] Path service#18525
riasvdv wants to merge 4 commits into6.xfrom
feature/path

Conversation

@riasvdv
Copy link
Contributor

@riasvdv riasvdv commented Mar 8, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces a new Laravel-native Path service (and facade) for resolving Craft’s key filesystem paths, and migrates existing code away from the legacy Yii craft\services\Path APIs.

Changes:

  • Added CraftCms\Cms\Support\Path (singleton) and CraftCms\Cms\Support\Facades\Path.
  • Updated multiple subsystems (Twig, updates, assets, project config, utilities) to use the new Path APIs.
  • Deprecated craft\services\Path and implemented it as a thin delegator to the new service; added feature tests covering the new behavior.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
yii2-adapter/legacy/test/Craft.php Resets the new Path singleton/facade between tests to avoid cached-path leakage.
yii2-adapter/legacy/services/Path.php Deprecates legacy Yii Path service and forwards calls to the new Laravel Path service.
tests/Feature/Support/PathTest.php Adds test coverage for path resolution, directory creation side effects, and facade parity.
src/View/TemplateMode.php Switches template root resolution to the new Path facade.
src/Utility/Utilities/SystemReport.php Uses Path facade to locate Composer’s InstalledVersions file.
src/Utility/Utilities/ClearCaches.php Uses the new Path service for cache directory targets.
src/Updates/Updates.php Uses Path facade for compiled template cleanup during migrations.
src/Updates/Commands/UpdateCommand.php Uses Path facade + join_paths() for composer backup file locations.
src/Twig/Twig.php Points Twig cache directory to Path::compiledTemplates().
src/Twig/TemplateResolver.php Uses join_paths() for safer cross-platform path construction.
src/Support/Security.php Uses Path::system() to determine system directories.
src/Support/Path.php Adds the new Path service implementation.
src/Support/Facades/Path.php Adds the Path facade for convenient static access.
src/Support/Composer.php Uses Path facade for runtime and backup directories; improves path joining.
src/Providers/AppServiceProvider.php Configures the rebrand filesystem disk root via the Path facade.
src/ProjectConfig/ProjectConfigHelper.php Uses Path facade to locate the project config file.
src/ProjectConfig/ProjectConfig.php Uses Path facade and join_paths() for project config IO.
src/ProjectConfig/Commands/ExportCommand.php Uses join_paths() and improves export filename construction.
src/Image/ImageTransforms.php Uses Path facade for asset source/image editor directories.
src/Image/ImageTransformHelper.php Uses Path facade for temp paths.
src/Http/Middleware/CheckForUpdates.php Uses Path facade for compiled template cleanup.
src/Http/Controllers/Dashboard/Widgets/CraftSupportController.php Uses Path facade for temp zip/log/template/config-backup paths.
src/Http/Controllers/Assets/TransformController.php Uses Path facade + join_paths() for transform output paths.
src/Http/Controllers/Assets/ActionController.php Uses Path facade for temp zip path.
src/Filesystem/Filesystems/Temp.php Uses Path facade for default temp upload path.
src/Cp/Rebrand.php Removes legacy Path injection (no longer needed).
src/Asset/Elements/Asset.php Uses Path facade/service for temp and asset-source paths and system dir list.
src/Asset/Assets.php Uses Path facade for temp upload disk root.
CHANGELOG-WIP.md Documents the new Path service/facade and deprecation of legacy Path service.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@riasvdv riasvdv marked this pull request as ready for review March 9, 2026 08:00
@riasvdv riasvdv requested a review from brandonkelly March 9, 2026 08:02
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.

2 participants