Download the PHP package azine/geoblocking-bundle without Composer

On this page you can find all versions of the php package azine/geoblocking-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package geoblocking-bundle

Simple GeoBlocking-Bundle

Symfony2 Bundle that allows you to configure geoblocking access to certain pages of your application.

It adds an kernel event listener that listens for "kernel.request" events and uses the php geoip module to identify the country of origin of the current request and depending on the configuration displays an error-page.

Requirements

There are no explicit requirements. BUT the default setup makes two assumptions:

1. the php geoip-module is enabled on your server or you installed and configured the Maxmind/GeoIP Bundle

"DefaultLookupAdapter" uses the php function geoip_country_code_by_name($address) to find the country of the given address.

To use the default implementation, this function (provided by the php geoip module => http://www.php.net/manual/en/book.geoip.php) must be available.

Alternatively you can use the MaxmindLookupAdapter (from the Maxmind/GeoIP-Bundle => "maxmind/geoip": "dev-master"), which requires that the MaxmindGeoIPBundle is installed and configured.

Or you can implement and use your own GeoLookupAdapter that uses an other way to find the country for the given ip (see below).

2. you use fosuserbundle for authentication/usermanagment

Most often you would like that registered users can access your site from wherever they are. So there should be a option to login and for logged in users no pages should be blocked. As a lot of people (including me) use the fosuserbundle for user managment, the default configuration is set to work nicely with the default configuration of the fosuserbundle.

You can change this of course in the config.yml.

Installation

To install AzineGeoBlockingBundle with Composer just add the following to your composer.json file:

Then, you can install the new dependencies by running Composer’s update command from the directory where your composer.json file is located:

Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:

Configuration options

For the bundle to work with the default-settings, no config-options are required. The default blocks all anonymouse users unless they are in the same private subnet (=> both server & client are inside the same home/company network) or on localhost (=> web-server and client are the same computer, e.g. when debugging locally).

This is the complete list of configuration options with their defaults.

Allow user by cookie

There are special cases where you want to allow visitors full access to your site even though they are not (yet) registered. For example allow an invited user to see all the pages, before signing up.

To allow this, you can set a coockie (named: geoblocking_allow_cookie, value true) that disables the geoblocking for a while.

To allow "invited" users to check out the site before registering, add this code to the action handling the first page view of an invited user to set the cookie:

Update your config.yml to enable the "allow_by_cookie"-feature and to allow the route that sets the cookie

Alternative GeoIpLookupAdapter

You can create your own implementation of Adapter\GeoIpLookupAdapterInterface.php, define it as service in your service.yml or service.xml and set the service-id as lookup_adapter in the config.yml:

Build-Status ec.

Build Status Total Downloads Latest Stable Version Scrutinizer Quality Score Code Coverage Dependency Status


All versions of geoblocking-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package azine/geoblocking-bundle contains the following files

Loading the files please wait ....