krak/symfony-playground

Symfony playground for tinkering/testign your app.

Installs: 11 687

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 1

Type:symfony-bundle

v0.1.3 2020-06-04 01:45 UTC

This package is auto-updated.

Last update: 2024-10-13 17:08:19 UTC


README

Symfony playground enables developers to quickly test any code in their system and access any of the private services in their app.

Installation

Install with composer at krak/symfony-playground.

Then you need to change the PlaygroundBundle in your config/bundles.php file to be dev only:

return [
    // ...
    Krak\SymfonyPlayground\PlaygroundBundle::class => ['dev' => true],
];

Usage

To enable the playground, you can create a playground.php in the project root: %kernel.project_dir%/playground.php.

This file needs to return a closure. Here's an example:

<?php

/** this function is autowired, so type hint any service to access it here */
return function(App\Service\MyService $service, Psr\Log\LoggerInterface $log) {
    $log->info("Playing with my symfony app!");
};

You should be able to run this with: ./bin/console playground.