Skip to content

Instantly share code, notes, and snippets.

@pierredup
Created August 21, 2018 21:02
Show Gist options
  • Save pierredup/dd729884a801af1ae89713f5617fa129 to your computer and use it in GitHub Desktop.
Save pierredup/dd729884a801af1ae89713f5617fa129 to your computer and use it in GitHub Desktop.
Add
<?php
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
// Add `test.php` as a resource to the container.
// Any changes to the file `test.php` will trigger the container cache to be rebuilt
// Note: This only works when Symfony is in development mode
$container->addResource(new FileResource(dirname(__DIR__).'/test.php'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment