aboutsummaryrefslogtreecommitdiffstats
path: root/includes/filebackend/lockmanager/LockManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/filebackend/lockmanager/LockManager.php')
-rw-r--r--includes/filebackend/lockmanager/LockManager.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/includes/filebackend/lockmanager/LockManager.php b/includes/filebackend/lockmanager/LockManager.php
index f988ff417216..d222babb0c54 100644
--- a/includes/filebackend/lockmanager/LockManager.php
+++ b/includes/filebackend/lockmanager/LockManager.php
@@ -113,6 +113,18 @@ abstract class LockManager {
}
/**
+ * Get the base 16 SHA-1 of a string, padded to 31 digits.
+ * Before hashing, the path will be prefixed with the domain ID.
+ * This should be used interally for lock key or file names.
+ *
+ * @param $path string
+ * @return string
+ */
+ final protected function sha1Base16Absolute( $path ) {
+ return sha1( "{$this->domain}:{$path}" );
+ }
+
+ /**
* Lock resources with the given keys and lock type
*
* @param $paths Array List of storage paths