Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Prevent colliding internal cache ids based on adapter #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ protected function _getCacheInternalId()
// @codingStandardsIgnoreEnd
return md5(
get_class($this->getAdapter())
. json_encode($this->getAdapter())
. hash('sha512', print_r($this->getAdapter(), true))
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't spl_object_hash($this->getAdapter()) make more sense here?

Copy link
Member

Choose a reason for hiding this comment

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

@weierophinney
See your own comment: #41 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

spl_object_hash has been used in the past: 54f4f4c#diff-b7dae88f55a82631386bada74d3d1e9fL863

Copy link
Member

Choose a reason for hiding this comment

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

Ah, okay, that makes sense again. (I'm getting old and can't remember this stuff!)

Still need unit tests, though!

. $this->getItemCountPerPage()
);
}
Expand Down