8000 merged branch Slamdunk/optimize/composer.json (PR #5627) · markross/symfony@01bcaae · GitHub
[go: up one dir, main page]

Skip to content

Commit 01bcaae

Browse files
committed
merged branch Slamdunk/optimize/composer.json (PR symfony#5627)
This PR was merged into the master branch. Commits ------- 45bf523 Optimize autoload prefix in composer.json Discussion ---------- Optimize autoload prefix in composer.json By having more specific autoload prefixes it is possible to reduce the number of stat calls made. Also it prevents conflicts with similar namespaces. See ref: zendframework/zendframework@e58c6cd SessionHandlerInterface is left intentionally. --------------------------------------------------------------------------- by sstok at 2012-09-28T08:41:25Z @Seldaek Is this true? And if so shouldn't this be optimized in Composer it self? --------------------------------------------------------------------------- by stof at 2012-09-28T08:48:05Z @sstok I cannot be optimized in Composer itself. It already optimize things by putting most specific prefixes first. Composer matches a prefix. The most specific the prefix is, the better (as it is less likely to match other classes). For components, it is quite useless as we don't have component with a name being a prefix for the name of another one. For the main package, it can indeed optimize things if someone was using ``Symfony_`` in an old-way package. This is not likely as there is no reason to have some new Symfony code using the PHP 5.2 naming and symfony1 was not using PSR-0. but it is indeed a working solution. This was occuring in Zend Framework as using ``Zend`` for the namespace prefix of ZF2 would match when loading ``Zend_Registry`` (and this was causing issues when using ZF1 and ZF2 together as the PSR-0 path for ``Zend_Registry`` or ``Zend\Registry`` would be the same, thus loading the wrong file) --------------------------------------------------------------------------- by Slamdunk at 2012-09-28T09:04:17Z I know the main reason occurred in ZF doesn't happen in Symfony, but I see only benefits for taking it even so.
2 parents 58cb6f5 + 45bf523 commit 01bcaae

File tree

33 files changed

+33
-33
lines changed

33 files changed

+33
-33
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
},
6464
"autoload": {
6565
"psr-0": {
66-
"Symfony": "src/",
66+
"Symfony\\": "src/",
6767
"SessionHandlerInterface": "src/Symfony/Component/HttpFoundation/Resources/stubs"
6868
}
6969
},

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"doctrine/orm": ">=2.2.3,<2.4-dev"
2828
},
2929
"autoload": {
30-
"psr-0": { "Symfony\\Bridge\\Doctrine": "" }
30+
"psr-0": { "Symfony\\Bridge\\Doctrine\\": "" }
3131
},
3232
"target-dir": "Symfony/Bridge/Doctrine",
3333
"minimum-stability": "dev",

src/Symfony/Bridge/Monolog/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"monolog/monolog": "1.*"
2222
},
2323
"autoload": {
24-
"psr-0": { "Symfony\\Bridge\\Monolog": "" }
24+
"psr-0": { "Symfony\\Bridge\\Monolog\\": "" }
2525
},
2626
"target-dir": "Symfony/Bridge/Monolog",
2727
"minimum-stability": "dev",

src/Symfony/Bridge/Propel1/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"propel/propel1": "1.6.*"
2424
},
2525
"autoload": {
26-
"psr-0": { "Symfony\\Bridge\\Propel1": "" }
26+
"psr-0": { "Symfony\\Bridge\\Propel1\\": "" }
2727
},
2828
"target-dir": "Symfony/Bridge/Propel1",
2929
"minimum-stability": "dev",

src/Symfony/Bridge/Swiftmailer/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/http-kernel": "2.2.*"
2424
},
2525
"autoload": {
26-
"psr-0": { "Symfony\\Bridge\\Swiftmailer": "" }
26+
"psr-0": { "Symfony\\Bridge\\Swiftmailer\\": "" }
2727
},
2828
"target-dir": "Symfony/Bridge/Swiftmailer",
2929
"minimum-stability": "dev",

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"symfony/security": "2.2.*"
3737
},
3838
"autoload": {
39-
"psr-0": { "Symfony\\Bridge\\Twig": "" }
39+
"psr-0": { "Symfony\\Bridge\\Twig\\": "" }
4040
},
4141
"target-dir": "Symfony/Bridge/Twig",
4242
"minimum-stability": "dev",

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"symfony/validator": "2.2.*"
3838
},
3939
"autoload": {
40-
"psr-0": { "Symfony\\Bundle\\FrameworkBundle": "" }
40+
"psr-0": { "Symfony\\Bundle\\FrameworkBundle\\": "" }
4141
},
4242
"target-dir": "Symfony/Bundle/FrameworkBundle",
4343
"minimum-stability": "dev",

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"symfony/security": "2.2.*"
2121
},
2222
"autoload": {
23-
"psr-0": { "Symfony\\Bundle\\SecurityBundle": "" }
23+
"psr-0": { "Symfony\\Bundle\\SecurityBundle\\": "" }
2424
},
2525
"target-dir": "Symfony/Bundle/SecurityBundle",
2626
"minimum-stability": "dev",

src/Symfony/Bundle/TwigBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"symfony/twig-bridge": "2.2.*"
2121
},
2222
"autoload": {
23-
"psr-0": { "Symfony\\Bundle\\TwigBundle": "" }
23+
"psr-0": { "Symfony\\Bundle\\TwigBundle\\": "" }
2424
},
2525
"target-dir": "Symfony/Bundle/TwigBundle",
2626
"minimum-stability": "dev",

src/Symfony/Bundle/WebProfilerBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"symfony/twig-bundle": "2.2.*"
2121
},
2222
"autoload": {
23-
"psr-0": { "Symfony\\Bundle\\WebProfilerBundle": "" }
23+
"psr-0": { "Symfony\\Bundle\\WebProfilerBundle\\": "" }
2424
},
2525
"target-dir": "Symfony/Bundle/WebProfilerBundle",
2626
"minimum-stability": "dev",

0 commit comments

Comments
 (0)
0