Skip to content

Create missing cache directories automatically - #83

Merged
vanderlee merged 3 commits into
masterfrom
agent/create-cache-directory
Aug 3, 2026
Merged

Create missing cache directories automatically#83
vanderlee merged 3 commits into
masterfrom
agent/create-cache-directory

Conversation

@vanderlee

Copy link
Copy Markdown
Owner

What changed

  • Ensure the configured cache directory exists before writing a cache file.
  • Create nested directories recursively when needed.
  • Throw a clear RuntimeException when directory creation fails.

Why

A custom cache path currently fails at file_put_contents() when its directory has not already been created. This makes fresh deployments and ignored cache directories unnecessarily fragile and directly addresses the long-standing behavior reported in issue #18.

Compatibility

The implementation remains compatible with the package's supported PHP versions and handles a concurrent directory creation safely by checking is_dir() after mkdir() fails.

Validation

Not run locally: this environment could modify the repository through the GitHub connector but could not clone it or execute PHPUnit. The PR is therefore left as a draft for CI validation.

@vanderlee
vanderlee marked this pull request as ready for review August 3, 2026 18:48
@vanderlee
vanderlee merged commit 093c376 into master Aug 3, 2026
3 of 4 checks passed
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