From 95b2ddb33ecef14d8d66d2c17b6c790fbfb31df1 Mon Sep 17 00:00:00 2001 From: Drak Date: Mon, 13 May 2013 14:58:11 +0200 Subject: [PATCH 1/3] Make namespaces much more explicit --- doc/04-schema.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/04-schema.md b/doc/04-schema.md index c1097d161..a3ac3d9ad 100644 --- a/doc/04-schema.md +++ b/doc/04-schema.md @@ -366,6 +366,10 @@ classes). Under the `psr-0` key you define a mapping from namespaces to paths, relative to the package root. Note that this also supports the PEAR-style non-namespaced convention. +Please note namespace declarations should end in `\\` to make sure the autoloader +responds extactly. For example `Foo` would match in `FooBar` so the traling +backslashes solve the problem: `Foo\\` and `FooBar\\` are distinct. + The PSR-0 references are all combined, during install/update, into a single key => value array which may be found in the generated file `vendor/composer/autoload_namespaces.php`. @@ -374,7 +378,7 @@ Example: { "autoload": { "psr-0": { - "Monolog": "src/", + "Monolog\\": "src/", "Vendor\\Namespace\\": "src/", "Vendor_Namespace_": "src/" } @@ -386,7 +390,7 @@ you can specify them as an array as such: { "autoload": { - "psr-0": { "Monolog": ["src/", "lib/"] } + "psr-0": { "Monolog\\": ["src/", "lib/"] } } } @@ -477,7 +481,7 @@ To do that, `autoload` and `target-dir` are defined as follows: { "autoload": { - "psr-0": { "Symfony\\Component\\Yaml": "" } + "psr-0": { "Symfony\\Component\\Yaml\\": "" } }, "target-dir": "Symfony/Component/Yaml" } From 38f13f8a444c803813043ccfb07d64b2c3be819f Mon Sep 17 00:00:00 2001 From: Drak Date: Mon, 13 May 2013 15:02:48 +0200 Subject: [PATCH 2/3] Update 04-schema.md --- doc/04-schema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/04-schema.md b/doc/04-schema.md index a3ac3d9ad..9abef1658 100644 --- a/doc/04-schema.md +++ b/doc/04-schema.md @@ -367,7 +367,7 @@ Under the `psr-0` key you define a mapping from namespaces to paths, relative to package root. Note that this also supports the PEAR-style non-namespaced convention. Please note namespace declarations should end in `\\` to make sure the autoloader -responds extactly. For example `Foo` would match in `FooBar` so the traling +responds extactly. For example `Foo` would match in `FooBar` so the trailing backslashes solve the problem: `Foo\\` and `FooBar\\` are distinct. The PSR-0 references are all combined, during install/update, into a single key => value From 4f18f8242c436a1922416a4afc4f95caa1172249 Mon Sep 17 00:00:00 2001 From: Drak Date: Mon, 13 May 2013 15:03:42 +0200 Subject: [PATCH 3/3] Update 04-schema.md --- doc/04-schema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/04-schema.md b/doc/04-schema.md index 9abef1658..775414102 100644 --- a/doc/04-schema.md +++ b/doc/04-schema.md @@ -367,7 +367,7 @@ Under the `psr-0` key you define a mapping from namespaces to paths, relative to package root. Note that this also supports the PEAR-style non-namespaced convention. Please note namespace declarations should end in `\\` to make sure the autoloader -responds extactly. For example `Foo` would match in `FooBar` so the trailing +responds exactly. For example `Foo` would match in `FooBar` so the trailing backslashes solve the problem: `Foo\\` and `FooBar\\` are distinct. The PSR-0 references are all combined, during install/update, into a single key => value