Commit Graph

183 Commits

Author SHA1 Message Date
Fabien Potencier
b357cafd00 [Routing] renamed hostname pattern to just hostname 2013-01-14 17:14:02 +01:00
Fabien Potencier
48920722f7 Revert "merged branch francisbesset/routing_constant_usage (PR #6449)"
This reverts commit c0e341c618, reversing
changes made to 35f5bca585.
2012-12-28 14:21:48 +01:00
Francis Besset
18daa1017c [Routing] Used static to call constant in XmlFileLoader 2012-12-25 12:02:30 +01:00
Florin Patan
c2acc6c2cb Fixed most of the docblocks/unused namespaces 2012-12-19 08:09:49 +01:00
Pascal Borreli
60eeacd2d1 Fixed typos 2012-12-14 22:27:02 +00:00
Martin Hasoň
34471a636a [Routing] Using class from Config component to loading XML files 2012-12-14 15:33:56 +01:00
Tobias Schultze
e803f4663c made schemes and methods available in XmlFileLoader
it uses an attribute list instead of multiple scheme/method elements that I also experimented with
2012-12-12 09:48:09 +01:00
Tobias Schultze
d374e70f7e made schemes and methods available in YamlFileLoader 2012-12-11 19:46:37 +01:00
Tobias Schultze
237bbd0578 fixed and refactored YamlFileLoader in the same sense as the XmlFileLoader
some nonsesense configs were not validated correctly like an imported resource with a pattern key. added tests for such things too.
2012-12-11 18:26:19 +01:00
Tobias Schultze
45987eb2b7 added tests for the previous XmlFileLoader fixes 2012-12-11 18:03:51 +01:00
Tobias Schultze
b20d6a7960 ensure id, pattern and resource are specified
the yaml loader also requires the pattern to be given, so the xml loader should do the same
2012-12-11 18:03:50 +01:00
Tobias Schultze
8361b5a58b refactor the XMlFileLoader 2012-12-11 18:03:49 +01:00
Tobias Schultze
83fc5ff72f fix namespace handling in xml loader; it could not handle prefixes 2012-12-11 17:52:57 +01:00
Tobias Schultze
1a60a3ceb5 make resource and key attributes required in xsd 2012-12-11 17:52:56 +01:00
Tobias Schultze
02e01b9798 improve exception messages in xml loader 2012-12-11 17:52:55 +01:00
Tobias Schultze
51fbffec26 remove unneeded cast 2012-12-11 17:52:53 +01:00
Tobias Schultze
358e9c47b9 fix some phpdoc 2012-12-11 17:52:53 +01:00
Tobias Schultze
8c7a169a4a [Routing] clean up of RouteCollection API 2012-12-11 14:02:38 +01:00
Fabien Potencier
0e9157a6df fixed previous merge 2012-12-03 14:56:49 +01:00
Fabien Potencier
b22da6ef5d Merge branch '2.1'
* 2.1:
  [TwigBundle] Moved the registration of the app global to the environment
  needs to use simpleContent in xsd to allow empty elements
  bumped Symfony version to 2.1.5-DEV
  bumped Symfony version to 2.0.19-DEV
  removed wrong routing xsd statement `mixed="true"`
  removed unused attribute from routing.xsd
  [HttpFoundation] added a small comment about the meaning of Request::hasSession() as this is a recurrent question (refs #4541)
  updated VERSION for 2.1.4
  updated CHANGELOG for 2.1.4
  updated VERSION for 2.0.19
  update CONTRIBUTORS for 2.0.19
  updated CHANGELOG for 2.0.19

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd
2012-12-03 14:31:00 +01:00
Fabien Potencier
a6e08b18de Merge branch '2.0' into 2.1
* 2.0:
  [TwigBundle] Moved the registration of the app global to the environment
  needs to use simpleContent in xsd to allow empty elements
  bumped Symfony version to 2.0.19-DEV
  removed wrong routing xsd statement `mixed="true"`
  removed unused attribute from routing.xsd
  updated VERSION for 2.0.19
  update CONTRIBUTORS for 2.0.19
  updated CHANGELOG for 2.0.19

Conflicts:
	CONTRIBUTORS.md
	src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
	src/Symfony/Bundle/TwigBundle/TwigEngine.php
	src/Symfony/Component/HttpKernel/Kernel.php
2012-12-03 14:28:41 +01:00
Tobias Schultze
eec788571f needs to use simpleContent in xsd to allow empty elements 2012-12-03 13:35:11 +01:00
Fabien Potencier
90e910f5ab merged branch Tobion/patch-2 (PR #6166)
This PR was merged into the 2.0 branch.

Commits
-------

57edf56 removed wrong routing xsd statement `mixed="true"`

Discussion
----------

removed wrong routing xsd statement `mixed="true"`

mixed="true" means that the element could contain both text and other elements, e.g.
`<requirement key="_locale">text <subelement /></requirement>`
But this wrong and such a definition would not even validate against the scheme as the xsd does not define which elements would be expected inside.
2012-12-02 19:02:32 +01:00
Tobias Schultze
20dbe47223 added annotation 2012-12-02 01:30:09 +01:00
Tobias Schultze
57edf568a2 removed wrong routing xsd statement mixed="true"
mixed="true" means that the element could contain both text and other elements, e.g.
`<requirement key="_locale">text <subelement /></requirement>`
But this wrong and such a definition would not even validate against the scheme as the xsd does not define which elements would be expected inside.
2012-12-01 22:40:50 +01:00
Tobias Schultze
c73cb8a1be add default for pattern for clarity 2012-12-01 22:22:36 +01:00
Tobias Schultze
ddd8918512 make id attribute required 2012-12-01 22:22:35 +01:00
Tobias Schultze
62536e5bec refactor to an xsd:group 2012-12-01 22:22:16 +01:00
Tobias Schultze
451dcdcb63 it should be possible to define the defaults, req. and options in any order, just like in YAML 2012-12-01 22:22:11 +01:00
Tobias Schultze
d5623b46d8 removed unused attribute from routing.xsd 2012-12-01 22:16:05 +01:00
Tobias Schultze
1e1cb13faf [Routing] added more phpdoc and replaced 'array of type' by 'Type[]' 2012-11-12 16:14:50 +01:00
Tobias Schultze
7ed3013a5b switch to array_replace instead of array_merge
we don't need the logic to merge numeric keys, as we don't have them. I could also improve the genrated code by PhpMatcherDumper a little by saving a function call.
2012-11-12 11:54:29 +01:00
Tobias Schultze
94ec653818 removed irrelevant string case in XmlFileLoader
getAttribute() always returns a string
2012-11-12 11:35:46 +01:00
Arnaud Le Blanc
6cd34570d7 fixed CS 2012-11-12 11:35:46 +01:00
Fabien Potencier
68da6ad292 [Routing] added support for hostname in the XML loader 2012-11-12 11:14:25 +01:00
Fabien Potencier
3dfca47bcd [Routing] added some unit tests for the YAML loader 2012-11-12 11:14:24 +01:00
Arnaud Le Blanc
7a15e006e6 [Routing] added hostname matching support to AnnotationClassLoader 2012-11-12 11:14:24 +01:00
Arnaud Le Blanc
cab450c94e [Routing] added hostname matching support to YamlFileLoader 2012-11-12 11:14:24 +01:00
Grégoire Pineau
84adcb1c3e [2.2][Routing] Added support for default attributes with default values of method params 2012-11-12 10:46:49 +01:00
Drak
788cc2c7ef Nsdocblocks 2012-10-20 09:10:30 +02:00
Fabien Potencier
a6bc12c9c1 Merge branch '2.0'
* 2.0:
  updated VERSION for 2.0.17
  updated CHANGELOG for 2.0.17
  updated vendors for 2.0.17
  fixed XML decoding attack vector through external entities
  prevents injection of malicious doc types
  disabled network access when loading XML documents
  refined previous commit
  prevents injection of malicious doc types
  standardized the way we handle XML errors
  Redirects are now absolute

Conflicts:
	CHANGELOG-2.0.md
	src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
	src/Symfony/Component/DomCrawler/Crawler.php
	src/Symfony/Component/HttpKernel/Kernel.php
	tests/Symfony/Tests/Component/DependencyInjection/Loader/XmlFileLoaderTest.php
	tests/Symfony/Tests/Component/Routing/Loader/XmlFileLoaderTest.php
	tests/Symfony/Tests/Component/Serializer/Encoder/XmlEncoderTest.php
	tests/Symfony/Tests/Component/Translation/Loader/XliffFileLoaderTest.php
	tests/Symfony/Tests/Component/Validator/Mapping/Loader/XmlFileLoaderTest.php
	vendors.php
2012-08-28 09:54:42 +02:00
Fabien Potencier
5bf4f92e86 fixed XML decoding attack vector through external entities 2012-08-28 08:43:14 +02:00
Fabien Potencier
4e0c99211d prevents injection of malicious doc types 2012-08-28 08:43:14 +02:00
Fabien Potencier
47fe725bd4 disabled network access when loading XML documents 2012-08-28 08:43:14 +02:00
Fabien Potencier
865461d204 standardized the way we handle XML errors 2012-08-28 08:43:14 +02:00
Fabien Potencier
ef41e308cc merged branch Tobion/phpdoc (PR #4539)
Commits
-------

680e732 [Routing] fix phpDoc

Discussion
----------

[Routing] fix phpDoc

using inheritdoc where possible and removing api tag when parent interface has one
as requested by stof and fabpot

---------------------------------------------------------------------------

by travisbot at 2012-06-09T16:14:53Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1577508) (merged 0a44632a into f8a09db5).

---------------------------------------------------------------------------

by travisbot at 2012-06-10T19:36:25Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1585766) (merged 680e732a into 7bec0786).
2012-06-12 19:54:37 +02:00
Fabien Potencier
77839690d9 changed getName() to name on all Reflection* object calls (fixes #4555, refs https://bugs.php.net/bug.php?id=61384) 2012-06-12 14:23:19 +02:00
Fabien Potencier
ba16a51d37 changed getName() to name on all Reflection* object calls (fixes #4555, refs https://bugs.php.net/bug.php?id=61384) 2012-06-12 13:59:42 +02:00
Tobias Schultze
680e732a9e [Routing] fix phpDoc
using inheritdoc where possible and removing api tag when parent interface has one
2012-06-10 21:30:17 +02:00
Fabien Potencier
d48d88a05a merged 2.0 2012-05-19 09:24:03 +02:00
Fabien Potencier
cf11cc067f removed unused use statements 2012-05-19 09:22:59 +02:00
Fabien Potencier
3bdf52a16a fixed CS 2012-05-18 19:42:42 +02:00
Fabien Potencier
e173d79e34 fixed CS 2012-05-18 19:37:58 +02:00
Fabien Potencier
41621e42e9 fixed phpdoc @param alignment 2012-05-15 22:19:31 +02:00
Fabien Potencier
ce9791246b fixed phpdoc @param alignment 2012-05-15 18:56:32 +02:00
Christophe Coevoet
3c325698ac [Routing] Added the possibility to define options for imported resources
Closes #2772
2012-04-04 03:36:42 +02:00
Fabien Potencier
14dd1a91a9 [Routing] made AnnotationDirectoryLoader deterministic (closes #3683) 2012-03-23 13:42:06 +01:00
Fabien Potencier
30262878f0 merged branch jmikola/2.0-LoaderResolverInterface (PR #2785)
Commits
-------

7c1cbb9 [Config] Use LoaderResolverInterface for type-hinting
48b084e fixed typo
8ad94fb merged branch hhamon/doctrine_bridge_cs (PR #2775)
240796e [Bridge] [Doctrine] fixed coding conventions.
7cfc392 check for session before trying to authentication details
648fae7 merged branch proofek/domcrawlerform-radiodisabled (PR #2768)
3976b7a [DoctrineBridge] fixed CS
9a04783 merged branch beberlei/SecurityEntityRepositoryIdentifierFix (PR #2765)
3c83b89 [DoctrineBridge] Catch user-error when the identifier is not serialized with the User entity.
36c7d03 Fixed GH-2720 - Fix disabled atrribute handling for radio form elements

Discussion
----------

[Config] Use LoaderResolverInterface for type-hinting

```
Bug fix: no
Feature addition: no
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: -
```

I've listed this as a BC break because we're changing the argument type-hint, but I think it's unlikely to affect anyone.
2011-12-05 10:21:19 +01:00
Jeremy Mikola
7c1cbb9f37 [Config] Use LoaderResolverInterface for type-hinting 2011-12-04 22:14:25 -08:00
Fabien Potencier
2e1344eb7e [Routing] added the possibility to define default values and requirements for placeholders in prefix 2011-10-23 11:57:55 +02:00
Fabien Potencier
17af13813a fixed usage of LIBXML_COMPACT as it is not always available 2011-09-28 21:54:54 +02:00
Fabien Potencier
a6670c214a [Routing] fixed a caching issue when annotations are used on a base class used by more than one concrete class
Doctrine caches annotations. For methods, it uses PHP reflection and the getDeclaringClass() to create
a unique cache key. Unfortunately, if you have 2 classes that extend another one, the cache will be shared.
It's not a problem except that before this patch, the default route name was also cached (as the cache is serialized
after we changed the object). So, all other classes inherited this default route name. The fix is quite easy:
just don't change the read annotation object.
2011-08-30 21:39:58 +02:00
Fabien Potencier
946ccb6bd2 [Routing] fixed annotation loaders for abstract classes, added more unit tests 2011-08-30 20:57:43 +02:00
Fabien Potencier
6a81f07862 [Routing] made a small speed optimization 2011-08-30 20:53:32 +02:00
Victor Berchet
2a24603061 [Routing] Allow multiple @Route annotations with a default name on a single method (fixes #1647) 2011-07-12 15:30:32 +02:00
Fabien Potencier
610c1cc987 [Routing] removed AnnotationGlobLoader 2011-06-17 18:18:03 +02:00
Fabien Potencier
3859589daa [Yaml] renamed load() to parse() 2011-06-14 16:25:25 +02:00
Fabien Potencier
72483f946b [Routing] tagged the public @api 2011-06-14 15:35:32 +02:00
Ryan Weaver
4f0214eff4 [Routing] Fixing a bug where the current directory was set too late in the PhpFileLoader 2011-05-29 11:26:36 -05:00
Fabien Potencier
9aa8083cb4 [Routing] fixed previous merge 2011-05-26 18:28:42 +02:00
Fabien Potencier
5911fb946d [Routing] fixed CS 2011-05-26 18:27:18 +02:00
Fabien Potencier
1c0dfad979 Merge remote branch 'Chekote/xmlfileloader_overload_refactor'
* Chekote/xmlfileloader_overload_refactor:
  Refactored the processing of each individual node into it's own method, enabling easier overloading of behavior for Bundles such as FriendsOfSymfony/RestBundle
2011-05-26 18:25:53 +02:00
Fabien Potencier
a2a1a88291 Merge remote branch 'schmittjoh/annotations'
* schmittjoh/annotations:
  removed obsolete compiler pass
  fixed some more tests
  fixed tests
  removed unused vendor
  some cleanups
  updated to latest changes
  [WebProfilerBundle] removed @ignorePhpDoc annotations
  [FrameworkBundle] fixed default
  [FrameworkBundle] updated configuration
  [Validator] updated fixtures
  updated UPDATE file
  updated Annotations integration
  [Routing] updated to changes
  [FrameworkBundle] added framework-wide annotation reader, updated validator tests
  [WebProfilerBundle] fixed controllers
  fixed unit tests
  added Annotations library
2011-05-22 08:45:24 +02:00
Johannes Schmitt
42fb34b647 fixed tests 2011-05-19 22:46:34 +02:00
Benjamin Eberlei
ec22b03b1d [Routing] Remove exception condition in YamlFileLoader::load() as its duplicating a check that is done in parseRoute() anyways. This changes allows to extend the YamlFileLoader without having to duplicate the whole method. 2011-05-19 20:26:26 +02:00
Johannes Schmitt
796d9af0c4 some updates 2011-05-16 22:26:24 +02:00
Chekote
ebab0a3ac2 Refactored the processing of each individual node into it's own method, enabling easier overloading of behavior for Bundles such as FriendsOfSymfony/RestBundle 2011-05-12 10:55:14 -05:00
Johannes Schmitt
73b92db612 [Routing] updated to changes 2011-04-29 17:44:56 +02:00
Johannes Schmitt
7e26575bbd [FrameworkBundle] added framework-wide annotation reader, updated validator tests 2011-04-29 15:54:44 +02:00
Artur Kotyrba
713e8c26a6 [Routing] removed redundant parameter in addRoute method 2011-04-25 22:58:23 +02:00
Pascal Borreli
8c0beea677 [Phpdoc] Cleaning/fixing 2011-04-23 15:18:47 +00:00
Brikou CARRE
e898445b94 removed empty lines/trailing spaces 2011-04-15 21:12:02 +02:00
Ryan Weaver
b9883a3bad [Config] Improving the exception when a resource cannot be imported
This improves, for example, the exception one would receive if they tried to import a resource from a bundle that doesn't exist.
Previously, the deep "bundle is not activated" exception would be thrown. That has value, however there is no indication of where
the exception is actually occurring.

In this new implementation, we throw an exception that explains exactly which resource, and from which source resource, cannot be
loaded. The deeper exception is still thrown as a nested exception.

Two caveats:

  * The `HttpKernel::varToString` method was replicated
  * This introduces a new `Exception` class, which allows us to prevent lot's of exceptions from nesting into each other in the case
    that some deeply imported resource cannot be imported (each upstream import that fails doesn't add its own exception).
2011-04-01 18:59:54 -05:00
Kris Wallsmith
daccbf45bf [Routing] updated for DirectoryResource changes 2011-04-01 04:57:10 -07:00
Fabien Potencier
1fb08b6445 [Routing] fixed private method 2011-03-23 21:40:54 +01:00
Fabien Potencier
e4a3e0c2c7 [Config] moved from protected to private (WIP) 2011-03-23 19:34:00 +01:00
Fabien Potencier
b5857528e0 [Routing] moved protected to private 2011-03-23 19:25:56 +01:00
Sven Paulus
eb8491f754 re-add filename based directory filter to the AnnotationDirectoryLoader,
now restricting to *.php files and therefore disregarding e.g. SVN metadata
files
2011-03-22 18:23:54 +01:00
Sven Paulus
61974adb4f revert adding filename based filter to the directory resource 2011-03-22 12:14:12 +01:00
Sven Paulus
f93e4b2d73 Eleminate the need to manually clear the cache if a new controller file containing routing annotations is added - part II
* add unit tests
* introduce filename filter to DirectoryResource (to restrict change monitoring to a subset of files)
* modify AnnotationDirectoryLoader.php to use filename filter set on Controller\.php$
2011-03-22 09:03:45 +01:00
Fabien Potencier
a505ff43b5 [Routing] added supported for multiple route annotations for a single controller 2011-03-19 17:40:24 +01:00
everzet
e4eee05b06 [Routing] tuned exception message 2011-03-19 12:58:31 +02:00
everzet
3fd50ea4e6 [Routing] throw an exception if route config has unsupported keys 2011-03-19 12:54:29 +02:00
Victor Berchet
61be2b7986 [Routing] XMLFileLoader small optimization 2011-03-11 09:47:46 +01:00
develop
1daedcc6fc fix whitespace problem 2011-03-08 09:49:52 +01:00
develop
a93aa55199 If you use an annotation resource pointing to a controller directory
in your routing configuration, only existing files in this directory
get tracked for changes in this directory. So if you add a new
controller file in this directory you'd have to manually clear the
cache since the new file gets ignored.
This patch adds a DirectoryResource for this case which tracks all
changes in the given directory (and files and directories contained
within).
2011-03-08 09:49:45 +01:00
Fabien Potencier
8c423edfef replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Fabien Potencier
2bb2388c3f fixed typo 2011-02-28 12:12:49 +01:00
Fabien Potencier
3948c2d8a2 [Routing] fixed annotation dir loader auto-reload when a controller class changes 2011-02-27 22:39:54 +01:00
Christophe Coevoet
92bfbf575c Fixed CS 2011-02-27 20:56:29 +01:00