1 | <?php |
||
8 | class FileFactory implements Factory |
||
9 | { |
||
10 | private $lock_dir; |
||
11 | private $hash_algo; |
||
12 | |||
13 | private $logger; |
||
14 | |||
15 | /** |
||
16 | * Create a new FileFactory |
||
17 | * @param string $lock_dir directory where lock files will be created |
||
18 | * @param string $hash_algo hashing algotithms used to generate lock file name from identifier |
||
19 | * see http://php.net/manual/en/function.hash-algos.php |
||
20 | * @param LoggerInterface|null $logger |
||
21 | */ |
||
22 | public function __construct($lock_dir, $hash_algo = 'sha256', LoggerInterface $logger = null) |
||
29 | |||
30 | /** |
||
31 | * Create a FileLock for $resource |
||
32 | * @param string $resource resource identifier |
||
33 | * @param boolean $exclusive true for an exclusive lock, false for shared one |
||
34 | * @param boolean $blocking true to wait for lock to be available, false to throw exception instead of waiting |
||
35 | * @return FileLock |
||
36 | */ |
||
37 | public function create( |
||
49 | } |
||
50 |