Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache remember #4107

Merged
merged 6 commits into from
Jan 28, 2021
Merged

Conversation

agungsugiarto
Copy link
Contributor

Description
Retrieve & Store cache
Sometimes we wish to retrieve an item from the cache, but also store a default value if the requested item doesn't exist.
Usage:

$value = Service::cache->remember('sample', 3600, function () {
    return [
       'sample' => 'data',
    ];
});

Checklist:

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

Copy link
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

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

This needs to be discussed in the user guide.

system/Cache/CacheInterface.php Outdated Show resolved Hide resolved
system/Cache/Handlers/FileHandler.php Outdated Show resolved Hide resolved
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

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

Please participate in and resolve conversations.

Copy link
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

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

Please add a discussion in the user guide.

@paulbalandan
Copy link
Member

bump @agungsugiarto for the UG update

@agungsugiarto
Copy link
Contributor Author

Forgive me @paulbalandan, im not good to write some documentation.

@paulbalandan
Copy link
Member

ping @samsonasik , there seems to be a problem with rector. It says it cannot find the ReflectionUnionType class. I think it's internally used by rector.

@samsonasik
Copy link
Member

samsonasik commented Jan 28, 2021

@paulbalandan Yes, I reverted phpstan update #4173 . That issue happen after update to latest phpstan release 0.12.70.

@paulbalandan paulbalandan merged commit 7a0b54d into codeigniter4:develop Jan 28, 2021
@paulbalandan paulbalandan removed the request for review from MGatner July 7, 2021 16:42
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.

4 participants