Skip to content

Commit

Permalink
consider placeholder values in cache key generation
Browse files Browse the repository at this point in the history
  • Loading branch information
wyrfel committed Aug 29, 2017
1 parent 9f93bc2 commit 365cbec
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Space.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,17 @@ public function addPath($path): Space
}

/**
* get the path to the cache config file for the current environment
*
* @return string the file path
* @return string the cache key
*/
protected function getCacheKey(): string
{
return strtolower(md5(sprintf('%s_%s', implode('::', $this->getPaths()), implode('::', $this->getSections()))));
$parts = [
implode('::', $this->getPaths()),
implode('::', $this->getSections()),
json_encode($this->placeholders),
];

return strtolower(md5(implode('_', $parts)));
}

/**
Expand Down

0 comments on commit 365cbec

Please sign in to comment.