PHPackages                             mxc-commons/mxc-routeguard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. mxc-commons/mxc-routeguard

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

mxc-commons/mxc-routeguard
==========================

Zend Framework 2 Module that provides protection for routes from anonymous access.

v1.0.1(12y ago)277PHPPHP &gt;=5.3.3

Since Jul 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mxc-commons/MxcRouteGuard)[ Packagist](https://packagist.org/packages/mxc-commons/mxc-routeguard)[ Docs](http://www.github.com/mxc-commons/MxcRouteGuard/)[ RSS](/packages/mxc-commons-mxc-routeguard/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

MxcRouteGuard
=============

[](#mxcrouteguard)

Version 1.0.1 created by Frank Hein and the mxc-commons team.

MxcRouteGuard is part of the maxence Open Source Initiative by by [maxence business consulting gmbh, Germany](http://www.maxence.de).

Introduction
------------

[](#introduction)

MxcRouteGuard restricts access to routes for unauthenticated users. Out of the box MxcRouteGuard works with ZfcUser, however, alternative authentication services (such as `Zend\Authentication\AuthenticationService`) may be used as long as they provide a `public function hasIdentity()` returning `bool`. MxcRouteGuard is designed to be very simple and reasonably extendable.

Requirements
------------

[](#requirements)

- [Zend Framework 2](https://github.com/zendframework/zf2) (latest master)

Features / Goals
----------------

[](#features--goals)

- Allow/Deny access to application routes globally for anonymous users
- Support for ZfcUser Registration Feature (automatically whitelist if enabled)
- Support for ZfcUser redirect feature

Installation
------------

[](#installation)

### Main Setup

[](#main-setup)

#### By cloning project

[](#by-cloning-project)

1. Clone this project into your `./vendor/` directory.

#### With composer

[](#with-composer)

1. Add this project in your composer.json:

    ```
    "require": {
        "mxc-commons/mxc-routeguard": "dev-master"
    }
    ```
2. Now tell composer to download MxcRouteGuard by running the command:

    ```
    $ php composer.phar update
    ```

#### Post installation

[](#post-installation)

1. Enabling it in your `application.config.php`file.

    ```
