function ZookeeperStore::getKeyResource
3 calls to ZookeeperStore::getKeyResource()
- ZookeeperStore::delete in vendor/
symfony/ lock/ Store/ ZookeeperStore.php - Removes a resource from the storage.
- ZookeeperStore::exists in vendor/
symfony/ lock/ Store/ ZookeeperStore.php - Returns whether or not the resource exists in the storage.
- ZookeeperStore::save in vendor/
symfony/ lock/ Store/ ZookeeperStore.php - Stores the resource if it's not locked by someone else.
File
-
vendor/
symfony/ lock/ Store/ ZookeeperStore.php, line 129
Class
- ZookeeperStore
- ZookeeperStore is a PersistingStoreInterface implementation using Zookeeper as store engine.
Namespace
Symfony\Component\Lock\StoreCode
private function getKeyResource(Key $key) : string {
// Since we do not support storing locks as multi-level nodes, we convert them to be stored at root level.
// For example: foo/bar will become /foo-bar and /foo/bar will become /-foo-bar
$resource = (string) $key;
if (str_contains($resource, '/')) {
$resource = strtr($resource, [
'/' => '-',
]) . '-' . sha1($resource);
}
if ('' === $resource) {
$resource = sha1($resource);
}
return '/' . $resource;
}