Skip to content

Commit

Permalink
added in namespace to HttpDigestAuth and standardised the usage examp…
Browse files Browse the repository at this point in the history
…le in class
  • Loading branch information
silentworks committed Nov 2, 2012
1 parent b1260d9 commit a831f4e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
12 changes: 12 additions & 0 deletions Middleware/CsrfGuard.php
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,16 @@
<?php <?php
/**
* CSRF Guard
*
* Use this middleware with your Slim Framework application
* to protect you from CSRF attacks.
*
* USAGE
*
* $app = new \Slim\Slim();
* $app->add(new \Slim\Extras\Middleware\CsrfGuard());
*
*/
namespace Slim\Extras\Middleware; namespace Slim\Extras\Middleware;


class CsrfGuard extends \Slim\Middleware class CsrfGuard extends \Slim\Middleware
Expand Down
4 changes: 2 additions & 2 deletions Middleware/HttpBasicAuth.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* *
* USAGE * USAGE
* *
* $app = new Slim(); * $app = new \Slim\Slim();
* $app->add(new HttpBasicAuth('theUsername', 'thePassword')); * $app->add(new \Slim\Extras\Middleware\HttpBasicAuth('theUsername', 'thePassword'));
* *
* MIT LICENSE * MIT LICENSE
* *
Expand Down
8 changes: 5 additions & 3 deletions Middleware/HttpDigestAuth.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* *
* USAGE * USAGE
* *
* $app = new Slim(); * $app = new \Slim\Slim();
* $app->add(new HttpDigestAuth(array('user1' => 'password1', 'user2' => 'password2'))); * $app->add(new \Slim\Extras\Middleware\HttpDigestAuth(array('user1' => 'password1', 'user2' => 'password2')));
* *
* MIT LICENSE * MIT LICENSE
* *
Expand All @@ -39,7 +39,9 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
class HttpDigestAuth extends Slim_Middleware { namespace Slim\Extras\Middleware;

class HttpDigestAuth extends \Slim\Middleware {
/** /**
* @var array * @var array
*/ */
Expand Down
7 changes: 2 additions & 5 deletions Middleware/StrongAuth.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
* @copyright 2012 Andrew Smith * @copyright 2012 Andrew Smith
* *
* USAGE * USAGE
*
* use Slim\Slim;
* use Slim\Extras\Middleware\StrongAuth;
* *
* $app = new Slim(); * $app = new \Slim\Slim();
* $app->add(new StrongAuth(array('provider' => 'PDO', 'dsn' => 'sqlite:memory'))); * $app->add(new \Slim\Extras\Middleware\StrongAuth(array('provider' => 'PDO', 'dsn' => 'sqlite:memory')));
* *
* MIT LICENSE * MIT LICENSE
* *
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "slim/extras", "name": "slim/extras",
"type": "library", "type": "library",
"description": "Extras package for the Slim Framework", "description": "Extras package for the Slim Framework",
"keywords": ["templating", "extensions"], "keywords": ["templating", "extensions", "middleware"],
"homepage": "http://github.com/codeguy/Slim-Extras", "homepage": "http://github.com/codeguy/Slim-Extras",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
Expand Down

0 comments on commit a831f4e

Please sign in to comment.