jmikola/insecure-routes-bundle

Removes HTTPS scheme requirements from routes in your Symfony2 app (for dev/test environments).

v3.0.1 2013-05-15 16:47 UTC

This package is auto-updated.

Last update: 2024-09-06 09:12:30 UTC


README

Build Status

This bundle removes HTTPS schema requirements from all routes in your Symfony2 application, and is especially helpful if your dev or test environments are not configured with SSL and you would like to avoid maintaining a separate copy of your routing configuration with HTTPS requirements removed.

You probabably should not use this bundle in your prod environment.

Compatibility

This bundle's master branch maintains compatibility with Symfony2's master branch. The sf-2.0 branch of this bundle maintains compatibility with Symfony 2.0. You may use the following tags for this bundle:

  • 3.0.x tracks the master branch.
  • 2.0.x tracks the sf-2.0 branch.

Installation

Add JmikolaInsecureRoutesBundle to the registerBundles() method of your application kernel. Like WebProfilerBundle, this bundle should only be enabled for your dev and test environments:

# app/AppKernel.php

public function registerBundles()
{
    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
        $bundles[] = new Jmikola\InsecureRoutesBundle\JmikolaInsecureRoutesBundle();
    }
}

Configuration

There are no configuration options. Symfony2 will load the bundle's dependency injection extension automatically.

The extension will create a service that composes the existing routing.loader service and assumes its service ID. Whenever a RouteCollection is loaded, any HTTPS _scheme requirements among its routes will then be removed. The filtering process is very similar to that of FrameworkBundle's DelegatingLoader, which resolves short notation for _controller defaults.