Download the PHP package spomky-labs/ip-filter-bundle without Composer

On this page you can find all versions of the php package spomky-labs/ip-filter-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 ip-filter-bundle

Ip Filter Bundle

Build Status Scrutinizer Quality Score HHVM Status

SensioLabsInsight

Latest Stable Version Total Downloads Latest Unstable Version License

This bundle will help you to restrict access of your application using IP addresses and ranges of IP addresses.

It supports both IPv4 and IPv6 addresses and multiple environments.

For example, you can grant access of a range of addresses from 192.168.1.1 to 192.168.1.100 on dev and test environments and deny all others.

Please note that this bundle has bad results in term of performance compared to similar functionality offered by a .htaccess file for example.

Prerequisites

This version of the bundle requires at least Symfony 2.3. It requires Doctrine. Doctrine ORM is supported, but it may be easy to use Doctrine ODM for example.

At has been tested using PHP 5.3 to PHP 5.6 and HHVM using Symfony 2.3 to Symfony 2.6).

Policy

Please note that authorized IPs have a higher priority than unauthorized ones. For example, if range 192.168.1.10 to 192.168.1.100 is unauthorized and 192.168.1.20 is authorized, then 192.168.1.20 will be granted.

Installation

Installation is a quick 4 steps process:

Step 1: Install the bundle

The preferred way to install this bundle is to rely on Composer:

Step 2: Enable the bundle

Enable the bundle in the kernel:

Step 3: Create IP and Range classes

This bundle needs a database to persist filtered IPs and ranges.

Your first job, then, is to create Ip and Range classes for your application. These classes can look and act however you want: add any properties or methods you find useful.

In the following sections, you'll see an example of how your classes should look.

Your classes can live inside any bundle in your application. For example, if you work at "Acme" company, then you might create a bundle called AcmeIpBundle and place your classes in it.

Ip class:

Easy!

Step 4: Configure your application

Set your classes and managers

If you have your own managers, you can use them. They just need to implement SpomkyLabs\IpFilterBundle\Model\IpManagerInterface or SpomkyLabs\IpFilterBundle\Model\RangeManagerInterface.

Security Strategy

In order for this bundle to take effect, you need to change the default access decision strategy, which, by default, grants access if any voter grants access.

You also need to place your site behind a firewall rule.

How to

Small example

How to grant access for 192.168.1.10 on dev and test environments and deny all others?

Network support

Networks can be supported using a Range object. You just need to get first and last IP addresses. This bundle provides a range calculator, so you can easily extend your range entity using it.


All versions of ip-filter-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
symfony/framework-bundle Version ~2.4
doctrine/orm Version >=2.2,<2.5-dev
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 spomky-labs/ip-filter-bundle contains the following files

Loading the files please wait ....