pathname = $pathname; $this->proj = substr($proj,0,1); } /** * Get the pathname used to generate the key * * @return string */ public function getPathname():string { return $this->pathname; } /** * Get the project identifier. Not guaranteed to be printable * * @return string */ public function getProjectIdentifier():string { return $this->proj; } /** * Get the key value * * @return int */ public function getKey():int { return ftok($this->pathname, $this->proj); } /** * Clone the FileKey, increasing the project identifier to create a new key for the * same file * * @return void */ public function __clone() { $this->proj = chr(ord($this->proj) + 1); } /** * Create printable representation of the key * * @return string */ public function __toString() { return $this->getKey(); } }