Skip to content

allow for folders for file caching - #4765

Closed
colethorsen wants to merge 1 commit into
codeigniter4:developfrom
colethorsen:feature/fix-file-cache
Closed

colethorsen wants to merge 1 commit into
codeigniter4:developfrom
colethorsen:feature/fix-file-cache

Conversation

@colethorsen

Copy link
Copy Markdown
Contributor

Each pull request should address a single issue and have a meaningful title.

Description
Fix the previous breaking change that prevents folders from being created for file based caching allow folders for file caching increases performance and organization when there are significant numbers of cached files.

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

---------Remove from here down in your description----------

Notes

  • Pull requests must be in English
  • If the PR solves an issue, reference it with a suitable verb and the issue number
    (e.g. fixes 12345)
  • Unsolicited pull requests will be considered, but there is no guarantee of acceptance
  • Pull requests should be from a feature branch in the contributor's fork of the repository
    to the develop branch of the project repository

-allow folders for file caching to increase performance.
@paulbalandan
paulbalandan requested a review from MGatner June 2, 2021 06:31
@MGatner

MGatner commented Jun 2, 2021

Copy link
Copy Markdown
Member

I'll admit I had no idea FileHandler was working with subdirectories, but I don't believe that was intended. This breaks on a few levels:

  • clean() only removes files in the top-level directory, meaning sub-directory items are never cleared
  • getCacheInfo() only reads from the top-level directory, meaning sub-directory items are not included in the assessment

This driver was ported from CI3 and I don't see docs in either versions referencing sub-directories. I believe this was an "accidental feature" but given that it was also accidentally buggy I'm not sure that we want to reinstate it, at least not without doing it properly. @lonnieezell ported the driver, let's see if he knows more.

@colethorsen

Copy link
Copy Markdown
Contributor Author

You also can't just remove a feature/bug/whatever you want to call it that production applications are relying on without a proper deprecation cycle, and without a proper solution to the problem that subdirectories fix. i.e. it could just be built to automatically subdirectory based on the first x characters in the string or something similar.

@MGatner

MGatner commented Jun 2, 2021

Copy link
Copy Markdown
Member

You also can't just remove ... that production applications are relying

Agreed. Like I said this was totally unintentional, but I believe that is because the feature was unintentional to begin with (or at least entirely undocumented/commented). We can make this a priority but I'm not comfortable making this call by myself. If you have time and capacity to flesh out this PR to be a proper "allow subdirectories" emendation it would save time if we go that route.

@colethorsen

colethorsen commented Jun 2, 2021 via email

Copy link
Copy Markdown
Contributor Author

@MGatner

MGatner commented Jun 2, 2021

Copy link
Copy Markdown
Member

We for sure won't be hotfixing (i.e. pushing to master and re-releasing). If you mean providing this solution in the repo you can do this with the content you already made by pointing at your branch. Update composer.json as follows:

	"require": {
		"php": "^7.3 || ^8.0",
		"codeigniter4/codeigniter4": "dev-feature/fix-file-cache",
	},
	"repositories": [
		{
			"type": "vcs",
			"url": "https://github.com/colethorsen/codeigniter4"
		}
	]

The forums are back up. If you PM me your Slack email I will invite you directly.

@MGatner MGatner mentioned this pull request Aug 17, 2021
5 tasks done
@paulbalandan

Copy link
Copy Markdown
Member

Superseded by #5008

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.

3 participants