Skip to content

Symfony 2/3/4 profiler extension, to change the Carbon date in the whole project.

License

Notifications You must be signed in to change notification settings

dem3trio/carbon-profiler-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Carbon Profiler Bundle

SymfonyInsight

Symfony 2/3/4 profiler extension, to change the Carbon php date in the whole project.

Installation

Install the package with composer.

composer require dem3trio/carbon-profiler-bundle --dev

Configuration Symfony >= 2.8 and SF <= 3.3

As the package adds a new panel in the Symfony profiler, you should add the bundle under the dev section.

// app/AppKernel.php

  public function registerBundles()
    {
        $bundles = [
           // ... prod bundles
        ];

        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
          // ... dev bundles
          
            if ('dev' === $this->getEnvironment()) {
                $bundles[] = new Dem3trio\Bundle\CarbonProfilerBundle\CarbonProfilerBundle();
            }
        }
     }
// 

Add the routing file under the routing_dev.yml file

# app/config/routing_dev.yml

_time_machine:
    resource: '@CarbonProfilerBundle/Resources/config/routing.yml'
    prefix: /_time_machine
    

Configuration for Symfony 3.4 and 4.x

Add the bundle to your bundles.php

// config/bundles.php

<?php

return [
    // ...
    Dem3trio\Bundle\CarbonProfilerBundle\CarbonProfilerBundle::class => ['dev' => true],
    ];

And add the routing file:

# config/routes/dev/carbon_profiler.yml

_time_machine:
    resource: '@CarbonProfilerBundle/Resources/config/routing.yml'
    prefix: /_time_machine

About

Symfony 2/3/4 profiler extension, to change the Carbon date in the whole project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published