-
Notifications
You must be signed in to change notification settings - Fork 225
feature/hash-cache-keys #53
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
Conversation
.gitignore
Outdated
@@ -1,2 +1,3 @@ | |||
/vendor | |||
composer.lock | |||
.*.sw? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably best handled in your global git configuration. It's been considered "best practice" to leave out environment-specific ignores from the project's git-ignore.
src/CachedModel.php
Outdated
@@ -55,7 +55,7 @@ public static function all($columns = ['*']) | |||
$class = get_called_class(); | |||
$instance = new $class; | |||
$tags = [str_slug(get_called_class())]; | |||
$key = 'genealabslaravelmodelcachingtestsfixturesauthor'; | |||
$key = sha1('genealabslaravelmodelcachingtestsfixturesauthor'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call makeCacheKey()
here, this was bad code on my part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work in a static function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused as to why the function is marked static in the first place. It is called like an object method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this?
$key = $instance->makeCacheKey();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for instance in tests/Unit/CachedBuilderTest.php
line 44.
fixes #48