Skip to content

Cache remember - #4107

Merged
paulbalandan merged 6 commits into
codeigniter4:developfrom
agungsugiarto:cache-remember
Jan 28, 2021
Merged

Cache remember#4107
paulbalandan merged 6 commits into
codeigniter4:developfrom
agungsugiarto:cache-remember

Conversation

@agungsugiarto

Copy link
Copy Markdown
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

@paulbalandanpaulbalandan left a comment

Copy link
Copy Markdown
Member

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.

Comment threadsystem/Cache/CacheInterface.php Outdated
Comment threadsystem/Cache/Handlers/FileHandler.php Outdated

@MGatnerMGatner left a comment

Copy link
Copy Markdown
Member

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.

@paulbalandanpaulbalandan left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

bump @agungsugiarto for the UG update

@agungsugiarto

Copy link
Copy Markdown
ContributorAuthor

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

@paulbalandan

Copy link
Copy Markdown
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

samsonasik commented Jan 28, 2021

Copy link
Copy Markdown
Member

@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:developJan 28, 2021
@paulbalandan
paulbalandan removed the request for review from MGatnerJuly 7, 2021 16:42
@datamwebdatamweb mentioned this pull request Jan 8, 2026
5 tasks
Sign up for freeto 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.

5 participants

@agungsugiarto@paulbalandan@samsonasik@datamweb@MGatner