2017 © Pedro Peláez
 

library mod-rewrite-bundle

Bundle that integrates the mod rewrite library into Symfony

image

giftcards/mod-rewrite-bundle

Bundle that integrates the mod rewrite library into Symfony

  • Tuesday, March 21, 2017
  • by yjv
  • Repository
  • 4 Watchers
  • 0 Stars
  • 3,443 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 3 % Grown

The README.md

GiftcardsModRewriteBundle Build Status

Bundle that integrates the mod rewrite library into symfony, (*1)

Config

Default config

# Default configuration for extension with alias: "giftcards_mod_rewrite"
giftcards_mod_rewrite:
    files:                []
    rewrite_listener:
        enabled:              true
        handle_redirects:     true
        files:                []
    router:
        enabled:              false
        priority:             0
        controller:           'GiftcardsModRewriteBundle:Rewrite:rewrite'

New in version 1.1.0

You can configure the files to read in the files key at the root of the config instead of under rewrite_listener key and it will be used for both the rewrite listener as well as the router. The rewrite_listener.files key has been deprecated., (*2)

The Rewrite Listener

the rewrite listener will take requests and set the result of the rewriter to the request attribute mod_rewrite_result if there is a match. to retrieve it call $request->atributes->get('mod_rewrite_result')., (*3)

the files config is a list fo files to load mod rewrite directives from. handle_redirects tells the listener if it hsould just set a redirect directly on the GetResponseEvent and cause a redirect immediately if the result says to redirect. if you dont want the listener then set enabled to false., (*4)

The Router

Now you can also enable the mod rewrite router. This is really only useful generally in addition to other routers but you can use it however you want like any symfony router after its enabled. By default its been setup to be easily integrated with the CMF Routing Bundle's chain routing. You can configure its priority right in the config. When it is enabled it will route mod rewrite matches to the GiftcardsModRewriteBundle:Rewrite:rewrite controller action. This action will return responses immediately for matches that are configured to do so (ex. R, G, F flags). For others that in apache would trigger an internal redirect in apache a sub request is generated and sent back through the request system. This should be a pretty good mirror of what would happen in an apache setup., (*5)

You can enable the router using the router.enabled key, configure what controller action is gets routed to using the router.controller key and configure the routers prirority in the chain router using the router.priority key., (*6)

The Versions

21/03 2017

dev-master

9999999-dev

Bundle that integrates the mod rewrite library into Symfony

  Sources   Download

The Requires

 

The Development Requires

15/03 2017

1.1.0

1.1.0.0

Bundle that integrates the mod rewrite library into Symfony

  Sources   Download

The Requires

 

The Development Requires

13/03 2015

1.0.1

1.0.1.0

Bundle that integrates the mod rewrite library into Symfony

  Sources   Download

The Requires

 

The Development Requires

26/02 2015

1.0.0

1.0.0.0

Bundle that integrates the mod rewrite library into Symfony

  Sources   Download

The Requires

 

The Development Requires