Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[3.0][HttpKernel] remove deprecated functions and classes #14634

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

vincentaubert
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

@vincentaubert
Copy link
Contributor Author

Hello,

I have a problem with the dependency injection of the Framework bundle.

in the services.xml file in the framework bundle I got this :

<service id="http_kernel" class="Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel">
            <argument type="service" id="event_dispatcher" />
            <argument type="service" id="service_container" />
            <argument type="service" id="controller_resolver" />
            <argument type="service" id="request_stack" />
        </service>

But the Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel class is marked as deprecated in the HttpKernel component.

By what should I replace this class to make it work ?

Thanks

@vincentaubert vincentaubert force-pushed the master_remove_deprecation_httpKernel branch from 38c523c to d98acac Compare May 14, 2015 13:43
@xabbuh
Copy link
Member

xabbuh commented May 14, 2015

@vincentaubert You can use Symfony\Component\HttpKernel\HttpKernel instead.

@dosten
Copy link
Contributor

dosten commented May 14, 2015

You should replace it by Symfony\Component\HttpKernel\HttpKernel and remove <argument type="service" id="service_container" /> from the definition.

@vincentaubert
Copy link
Contributor Author

Thanks

@@ -75,7 +75,7 @@ public function testLogNonUtf8()

public function testLogLongString()
{
$logger = $this->getMock('Symfony\\Component\\HttpKernel\\Log\\LoggerInterface');
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
Copy link
Member

Choose a reason for hiding this comment

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

This change and the next one should happen in Symfony 2.7 instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in PR #14637

@vincentaubert vincentaubert force-pushed the master_remove_deprecation_httpKernel branch 3 times, most recently from aaf7e51 to fcfdafa Compare May 14, 2015 18:19
@vincentaubert
Copy link
Contributor Author

ping @symfony/mergers

This PR is ready for merge.

The 2 failing tests have been fixed in the 2.7 branch via the #14637 PR but the 2.7 branch hasn't been merged in master at the moment.

I launched the tests locally with the patch and all the tests passed

@dosten
Copy link
Contributor

dosten commented May 15, 2015

ProfilerListener::getSubscribedEvents() remove the KernelEvents::REQUEST => array('onKernelRequest', 1024), line and the comments above.

@vincentaubert vincentaubert force-pushed the master_remove_deprecation_httpKernel branch from fcfdafa to 1195613 Compare May 15, 2015 06:57
@vincentaubert
Copy link
Contributor Author

fixed thanks

@@ -200,10 +200,8 @@ public function getDumps($format, $maxDepthLimit = -1, $maxItemsPerDepth = -1)
foreach ($this->data as $dump) {
if (method_exists($dump['data'], 'withMaxDepth')) {
Copy link
Member

Choose a reason for hiding this comment

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

if to be removed also

@vincentaubert vincentaubert force-pushed the master_remove_deprecation_httpKernel branch from 1195613 to 2a29119 Compare May 15, 2015 14:19
@vincentaubert
Copy link
Contributor Author

done and code rebased on the latest master

@@ -198,12 +198,6 @@ public function getDumps($format, $maxDepthLimit = -1, $maxItemsPerDepth = -1)
$dumps = array();

foreach ($this->data as $dump) {
if (method_exists($dump['data'], 'withMaxDepth')) {
$dumper->dump($dump['data']->withMaxDepth($maxDepthLimit)->withMaxItemsPerDepth($maxItemsPerDepth));
Copy link
Member

Choose a reason for hiding this comment

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

You should keep this line!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@vincentaubert vincentaubert force-pushed the master_remove_deprecation_httpKernel branch from 2a29119 to 5bf6b0d Compare May 15, 2015 15:24
@vincentaubert vincentaubert force-pushed the master_remove_deprecation_httpKernel branch from 336016c to c19f918 Compare May 16, 2015 08:02
@fabpot
Copy link
Member

fabpot commented May 16, 2015

Thank you @vincentaubert.

@fabpot fabpot merged commit c19f918 into symfony:master May 16, 2015
fabpot added a commit that referenced this pull request May 16, 2015
…ses (vincentaubert)

This PR was merged into the 3.0-dev branch.

Discussion
----------

[3.0][HttpKernel] remove deprecated functions and classes

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

c19f918 [3.0][HttpKernel] remove deprecated functions and classes
@vincentaubert vincentaubert deleted the master_remove_deprecation_httpKernel branch May 16, 2015 13:38
@@ -67,34 +67,12 @@ public function __construct($matcher, RequestContext $context = null, LoggerInte
throw new \InvalidArgumentException('You must either pass a RequestContext or the matcher must implement RequestContextAwareInterface.');
}

if (!$requestStack instanceof RequestStack) {
Copy link
Contributor

Choose a reason for hiding this comment

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

requestStack must be made required

fabpot added a commit to sensiolabs/SensioDistributionBundle that referenced this pull request Sep 16, 2015
…derrabus)

This PR was submitted for the master branch but it was merged into the 3.0 branch instead (closes #225).

Discussion
----------

Don't include ContainerAwareHttpKernel if it's not present

When generating the bootstrap file, the composer script handler also includes `Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel`, a class that has been removed with PR symfony/symfony#14634 and that will be gone in Symfony 3.0.

This pull request checks if the class is present and includes `Symfony\Component\HttpKernel\HttpKernel` otherwise. The code should work with Symfony 2.7 as well as with 3.0-dev.

Commits
-------

2e45487 Don't include ContainerAwareHttpKernel if it's not present.
fabpot added a commit that referenced this pull request Oct 1, 2015
…ion)

This PR was merged into the 3.0-dev branch.

Discussion
----------

[HttpKernel] make RequestStack parameter required

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Continuation of #14634, #8904

Commits
-------

a2e154d [HttpKernel] make RequestStack parameter required for classes that need it
@fabpot fabpot mentioned this pull request Nov 16, 2015
nicolas-grekas added a commit that referenced this pull request Aug 7, 2017
This PR was merged into the 3.3 branch.

Discussion
----------

[HttpKernel] Remove isset call used for legacy

| Q             | A
| ------------- | ---
| Branch?       | 3.3 <!-- see comment below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Added in #9628 in which the request stack dependency was nullable. Forgotten to be removed in #14634.

Commits
-------

e0a6010 [HttpKernel] Remove isset call used for legacy
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.

6 participants