2017 © Pedro Peláez
 

symfony-bundle symfony-profiler-matcher

Allow desable profiler on choosen routes with annotation.

image

webonaute/symfony-profiler-matcher

Allow desable profiler on choosen routes with annotation.

  • Friday, November 3, 2017
  • by Webonaute
  • Repository
  • 1 Watchers
  • 0 Stars
  • 366 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

SymfonyProfilerMatcher

Simple setup

Allow to easily desable profiler by adding annotation to your controller., (*1)

Install the bundle :, (*2)

composer install webonaute/symfony-profiler-matcher "^1.0"

Add bundle to kernel., (*3)

<?php

use Symfony\Component\Config\Loader\LoaderInterface;
use UgroupMedia\Bundle\CommonBundle\HttpKernel\Kernel;

class AppKernel extends Kernel
{
    public function loadBundles()
    {
        $bundles = array(
          ...
            new Webonaute\SymfonyProfilerMatcherBundle\SymfonyProfilerMatcherBundle(),
        );

        return $bundles;
    }

    ...
}

Add annotation to your controller., (*4)

<?php

namespace AppBundle\Controller\App;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Webonaute\SymfonyProfilerMatcherBundle\Annotation as SPM;

class PingController extends Controller
{
    /**
     * @Route(name="ping", path="/ping")
     * @SPM\Profiler(desable=true)
     * @return Response
     */
    public function pingAction()
    {
        return new Response('OK');
    }
}

Add config, (*5)

framework:
    profiler:
        matcher:
            service: webonaute.profiler.request.matcher

Setup with cache.

We support Redis/Predis caching using SNC Redis bundle., (*6)

Simply add a service to inject the cache object., (*7)

services:
    webonaute.profiler.request.matcher.cache:
        class: Webonaute\SymfonyProfilerMatcherBundle\Profiler\Matcher\RequestMatcher
        arguments: ['@router', "@snc_redis.default"]
        public: false

Change @snc_redis.default for whatever configuration your use., (*8)

Than set the framework profiler matcher to the new service., (*9)

framework:
    profiler:
        matcher:
            service: webonaute.profiler.request.matcher.cache

         , (*10)

The Versions

03/11 2017

dev-master

9999999-dev

Allow desable profiler on choosen routes with annotation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu Delisle

database development symfony2 symfony annotation profiler matcher

03/11 2017

v1.1.2

1.1.2.0

Allow desable profiler on choosen routes with annotation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu Delisle

database development symfony2 symfony annotation profiler matcher

18/08 2017

v1.1.1

1.1.1.0

Allow desable profiler on choosen routes with annotation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu Delisle

database development symfony2 symfony annotation profiler matcher

26/04 2017

v1.1

1.1.0.0

Allow desable profiler on choosen routes with annotation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu Delisle

database development symfony2 symfony annotation profiler matcher

25/04 2017

v1.0

1.0.0.0

Allow desable profiler on choosen routes with annotation.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mathieu Delisle

database development symfony2 symfony annotation profiler matcher