Skip to content

Commit f7802d9

Browse files
committed
refactorings, added license, updated readme
1 parent 8e573f8 commit f7802d9

27 files changed

Lines changed: 132 additions & 65 deletions

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2012-2013 brainbits GmbH (http://www.brainbits.net)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@ Blocking Component
22
==================
33
The Locking Component provides methods to manager content based blocking.
44

5-
```php
6-
<?php
5+
<?php
76

8-
use Brainbits\Blocking\Blocker;
9-
use Brainbits\Blocking\Adapter\FilesystemAdapter;
10-
use Brainbits\Blocking\Owner\SessionOwner;
7+
use Brainbits\Blocking\Blocker;
8+
use Brainbits\Blocking\Adapter\FilesystemAdapter;
9+
use Brainbits\Blocking\Owner\SessionOwner;
1110

12-
$adapter = new FilesystemAdapter('/where/to/store/blocks' /* path to directory on filesystem */);
13-
$owner = new SessionOwner($session /* symfony session */);
14-
$validator = new ExpiredValidator(300 /* block will expire after 300 seconds */);
11+
$adapter = new FilesystemAdapter('/where/to/store/blocks' /* path to directory on filesystem */);
12+
$owner = new SessionOwner($session /* symfony session */);
13+
$validator = new ExpiredValidator(300 /* block will expire after 300 seconds */);
1514

16-
$blocker = new Blocker($adapter, $owner, $validator);
15+
$blocker = new Blocker($adapter, $owner, $validator);
1716

18-
$identifier = new Identifer('myContent', 123);
17+
$identifier = new Identifer('myContent', 123);
1918

20-
$block = $blocker->block($identifier);
21-
$result = $blocker->unblock($identifier);
22-
$result = $blocker->isBlocked($identifier);
23-
$block = $blocker->getBlock($identifier);
24-
```
19+
$block = $blocker->block($identifier);
20+
$result = $blocker->unblock($identifier);
21+
$result = $blocker->isBlocked($identifier);
22+
$block = $blocker->getBlock($identifier);
2523

2624
Blocking Adapters
2725
-----------------

src/Brainbits/Blocking/Adapter/AdapterInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/**
33
* This file is part of the brainbits blocking package.
44
*
5-
* @copyright 2012-2013 brainbits GmbH (http://www.brainbits.net)
6-
* @license http://www.brainbits.net/LICENCE Dummy Licence
5+
* (c) 2012-2013 brainbits GmbH (http://www.brainbits.net)
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
79
*/
810

911
namespace Brainbits\Blocking\Adapter;

src/Brainbits/Blocking/Adapter/FilesystemAdapter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/**
33
* This file is part of the brainbits blocking package.
44
*
5-
* @copyright 2012-2013 brainbits GmbH (http://www.brainbits.net)
6-
* @license http://www.brainbits.net/LICENCE Dummy Licence
5+
* (c) 2012-2013 brainbits GmbH (http://www.brainbits.net)
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
79
*/
810

911
namespace Brainbits\Blocking\Adapter;

src/Brainbits/Blocking/Block.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/**
33
* This file is part of the brainbits blocking package.
44
*
5-
* @copyright 2012-2013 brainbits GmbH (http://www.brainbits.net)
6-
* @license http://www.brainbits.net/LICENCE Dummy Licence
5+
* (c) 2012-2013 brainbits GmbH (http://www.brainbits.net)
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
79
*/
810

911
namespace Brainbits\Blocking;

src/Brainbits/Blocking/BlockInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/**
33
* This file is part of the brainbits blocking package.
44
*
5-
* @copyright 2012-2013 brainbits GmbH (http://www.brainbits.net)
6-
* @license http://www.brainbits.net/LICENCE Dummy Licence
5+
* (c) 2012-2013 brainbits GmbH (http://www.brainbits.net)
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
79
*/
810

911
namespace Brainbits\Blocking;

src/Brainbits/Blocking/BlockableInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/**
33
* This file is part of the brainbits blocking package.
44
*
5-
* @copyright 2012-2013 brainbits GmbH (http://www.brainbits.net)
6-
* @license http://www.brainbits.net/LICENCE Dummy Licence
5+
* (c) 2012-2013 brainbits GmbH (http://www.brainbits.net)
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
79
*/
810

911
namespace Brainbits\Blocking;

src/Brainbits/Blocking/Blocker.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/**
33
* This file is part of the brainbits blocking package.
44
*
5-
* @copyright 2012-2013 brainbits GmbH (http://www.brainbits.net)
6-
* @license http://www.brainbits.net/LICENCE Dummy Licence
5+
* (c) 2012-2013 brainbits GmbH (http://www.brainbits.net)
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
79
*/
810

911
namespace Brainbits\Blocking;

src/Brainbits/Blocking/Exception/BlockingException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/**
33
* This file is part of the brainbits blocking package.
44
*
5-
* @copyright 2012-2013 brainbits GmbH (http://www.brainbits.net)
6-
* @license http://www.brainbits.net/LICENCE Dummy Licence
5+
* (c) 2012-2013 brainbits GmbH (http://www.brainbits.net)
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
79
*/
810

911
namespace Brainbits\Blocking\Exception;

src/Brainbits/Blocking/Exception/DirectoryNotWritableException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/**
33
* This file is part of the brainbits blocking package.
44
*
5-
* @copyright 2012-2013 brainbits GmbH (http://www.brainbits.net)
6-
* @license http://www.brainbits.net/LICENCE Dummy Licence
5+
* (c) 2012-2013 brainbits GmbH (http://www.brainbits.net)
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
79
*/
810

911
namespace Brainbits\Blocking\Exception;

0 commit comments

Comments
 (0)