Skip to content

Added info on using config component's ConfigCache when dumping the serv... #1616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

richardmiller-zz
Copy link
Contributor

...ice container

$dumper->dump(array('class' => 'MyCachedContainer')),
$container->getResources()
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could even take care of the optimized instantiation code dumped even for the first request (thus, it would make it behave more closely to others):

<?php
if (!$cache->isFresh()) {
    $containerBuilder = new ContainerBuilder()
    // dump the container here
}

require_once $file;
$container = new MyCachedContainer();

This is what is done in the Kernel for instance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks, I have updated the example with this change.

weaverryan added a commit that referenced this pull request Aug 4, 2012
Added info on using config component's ConfigCache when dumping the serv...
@weaverryan weaverryan merged commit 0a5ec36 into symfony:2.0 Aug 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants