Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b9b8f9d

Browse filesBrowse files
committed
minor #30001 [FrameworkBundle] consolidate the mime types service definition (xabbuh)
This PR was merged into the 4.3-dev branch. Discussion ---------- [FrameworkBundle] consolidate the mime types service definition | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | I wonder if we couldn't simplify things by just initializing the default `MimeTypes` instance once the first one is going to be created. Commits ------- ce546f5 consolidate the mime types service definition
2 parents 865127b + ce546f5 commit b9b8f9d
Copy full SHA for b9b8f9d

File tree

2 files changed

+5
-6
lines changed
Filter options

2 files changed

+5
-6
lines changed

‎src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ public function boot()
7373
if ($trustedHosts = $this->container->getParameter('kernel.trusted_hosts')) {
7474
Request::setTrustedHosts($trustedHosts);
7575
}
76-
77-
if ($this->container->has('mime_types')) {
78-
$mt = $this->container->get('mime_types');
79-
$mt->setDefault($mt);
80-
}
8176
}
8277

8378
public function build(ContainerBuilder $container)

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/mime_type.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/mime_type.xml
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
<services>
88
<defaults public="false" />
99

10-
<service id="mime_types" class="Symfony\Component\Mime\MimeTypes" public="true" />
10+
<service id="mime_types" class="Symfony\Component\Mime\MimeTypes">
11+
<call method="setDefault">
12+
<argument type="service" id="mime_types" />
13+
</call>
14+
</service>
1115
</services>
1216
</container>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.