@@ -14,44 +14,46 @@ The Blocking Component provides methods to manage content based blocking.
1414 <?php
1515
1616 use Brainbits\Blocking\Blocker;
17- use Brainbits\Blocking\Adapter\FilesystemAdapter;
18- use Brainbits\Blocking\Owner\SessionOwner;
17+ use Brainbits\Blocking\Identity\Identity;
18+ use Brainbits\Blocking\Owner\SymfonySessionOwnerFactory;
19+ use Brainbits\Blocking\Storage\FilesystemStorage;
20+ use Brainbits\Blocking\Validator\ExpiredValidator;
1921
20- $adapter = new FilesystemAdapter ('/where/to/store/blocks' /* path to directory on filesystem */);
21- $owner = new SessionOwner ($session /* symfony session */);
22+ $storage = new FilesystemStorage ('/where/to/store/blocks' /* path to directory on filesystem */);
23+ $ownerFactory = new SymfonySessionOwnerFactory ($session /* symfony session */);
2224 $validator = new ExpiredValidator(300 /* block will expire after 300 seconds */);
2325
24- $blocker = new Blocker($adapter , $owner , $validator);
26+ $blocker = new Blocker($storage , $ownerFactory , $validator);
2527
26- $identifier = new Identifer('myContent', 123 );
28+ $identity = new Identity('my_content_123 );
2729
28- $block = $blocker->block($identifier );
29- $result = $blocker->unblock($identifier );
30- $result = $blocker->isBlocked($identifier );
31- $block = $blocker->getBlock($identifier );
30+ $block = $blocker->block($identity );
31+ $result = $blocker->unblock($identity );
32+ $result = $blocker->isBlocked($identity );
33+ $block = $blocker->getBlock($identity );
3234
33- Blocking Adapters
34- -----------------
35- Blocking adapters are used to store the block information.
35+ Blocking Storage
36+ ----------------
37+ The blocking storage is used to store the block information.
3638
37- A file based blocking adapter is provided.
39+ A file based blocking storage is provided.
3840It writes block-files to the filesystem, based on the blocking identifier.
3941
40- Blocking Identifiers
41- --------------------
42- Blocking identifiers are used to identify the content that is being blocked.
42+ Blocking Identity
43+ -----------------
44+ The blocking identity is used to identify the content that is being blocked.
4345
44- A general purpose blocking identifier is provided, that uses content type and
45- content id to create an identifier string.
46+ A general purpose blocking identify is provided, that uses a string as an identifier.
4647
47- Blocking Owners
48- ---------------
49- Blocking owners are used to identify the user that created the block.
48+ Blocking Owner
49+ --------------
50+ The blocking owner is used to identify the user that created the block.
5051
5152A symfony session based owner class is provided.
5253
53- Blocking Validators
54- -------------------
55- Blocking validators test wether or not an existing block is still valid.
54+ Blocking Validator
55+ ------------------
56+ The blocking validator is used to test wether or not an existing block is still valid.
5657
5758A validator that checks a block via last modification time is provided.
59+
0 commit comments