Commit Graph

765 Commits

Author SHA1 Message Date
Bernhard Schussek
ac5440f8d4 [Form] DateTimeToArrayTransformer does not accept partially filled arrays anymore. Replaces DateField::isPartiallyFilled() and TimeField::isPartiallyFilled() 2011-02-23 21:17:20 +01:00
Igor Wiedler
bcca989c41 [Locale] refactor and simplify some parts of StubIntlDateFormatter 2011-02-23 19:09:48 +01:00
Bernhard Schussek
33e70673c2 [Locale] Fixed failing StubNumberFormatterTest when intl extension is not loaded 2011-02-23 14:38:05 +01:00
Igor Wiedler
71c99422f3 [Locale] convenience createStubFormatter method for StubIntlDateFormatter tests 2011-02-23 14:20:47 +01:00
Igor Wiedler
ee5bc36c55 [Locale] add docblocks to StubIntlDateFormatter and adjust some things to be more like StubNumberFormatter 2011-02-23 14:20:47 +01:00
Igor Wiedler
5fdf68a08a [Locale] add license docblock to LocaleTestCase 2011-02-23 14:20:47 +01:00
Igor Wiedler
31313f183a [Locale] use is64Bit helper for StubIntlDateFormatterTest 2011-02-23 14:20:46 +01:00
Igor Wiedler
17e2d4e24c [Locale] StubCollator: asort with initial tests 2011-02-23 14:20:46 +01:00
Igor Wiedler
3cc60f7cb4 [Locale] throw NotImplementedException on unimplemented chars 2011-02-23 14:20:45 +01:00
Igor Wiedler
d555049342 [Locale] only test BC era if on 64bit 2011-02-23 14:20:45 +01:00
Igor Wiedler
4fb79b715a [Locale] split another StubIntlDateFormatter test into two 2011-02-23 14:20:45 +01:00
Igor Wiedler
53839f9235 [Locale] refactor tests, make use of specialized exception 2011-02-23 14:20:45 +01:00
Igor Wiedler
77258223f1 [Locale] re-order StubIntlDateFormatter methods, rename timezoneId to timeZoneId, add setLenient method 2011-02-23 14:20:44 +01:00
Igor Wiedler
1191ab4b56 [Locale] add remaining IntlDateFormatter methods with tests 2011-02-23 14:20:44 +01:00
Igor Wiedler
69b38faff7 [Locale] refactoring and some more tests 2011-02-23 14:20:44 +01:00
Igor Wiedler
e95df5d2a7 [Locale] fix failing test case 2011-02-23 14:20:44 +01:00
Igor Wiedler
8dab760160 [Locale] use eriksens intl test helpers 2011-02-23 14:20:43 +01:00
Jordi Boggiano
47c1110166 [Locale] Fixed two tests 2011-02-23 14:20:43 +01:00
Igor Wiedler
e962c4a633 [Locale] add another failing escape test case 2011-02-23 14:20:42 +01:00
Igor Wiedler
c7380fbb4c [Locale] support standard date and time types if no format is set, refactoring and more tests 2011-02-23 14:20:42 +01:00
Igor Wiedler
85e6c5e426 [Locale] add some more test cases with escaping 2011-02-23 14:20:42 +01:00
Igor Wiedler
632ded5c96 [Locale] use UTC if timezone is unsupported 2011-02-23 14:20:42 +01:00
Igor Wiedler
a883a3f62a [Locale] adjust to new quoting format, some tests failing 2011-02-23 14:20:42 +01:00
Igor Wiedler
cbfaaef76e [Locale] support for z (timezone offset from GMT) 2011-02-23 14:20:41 +01:00
Igor Wiedler
d68c5fa7fd [Locale] refactor to use DateTime and DateTimeZone, adding timezone support 2011-02-23 14:20:41 +01:00
Igor Wiedler
7efe476693 [Locale] support for s (second) 2011-02-23 14:20:41 +01:00
Igor Wiedler
87d3547679 [Locale] support for m (minute of hour) 2011-02-23 14:20:40 +01:00
Igor Wiedler
6b26f8296d [Locale] support for K (12-hour (0-11)) 2011-02-23 14:20:40 +01:00
Igor Wiedler
5a767045b6 [Locale] implement k (24-hour (1-24) 2011-02-23 14:20:40 +01:00
Igor Wiedler
bfc7e55692 [Locale] support for H (24 hour) 2011-02-23 14:20:39 +01:00
Igor Wiedler
71e3c97358 [Locale] support for a (AM/PM) 2011-02-23 14:20:39 +01:00
Igor Wiedler
49752f104b [Locale] support for E (day of week) 2011-02-23 14:20:39 +01:00
Igor Wiedler
d4c1357f11 [Locale] support for D (day of year) 2011-02-23 14:20:39 +01:00
Igor Wiedler
5ffce2d6a2 [Locale] add support for h 2011-02-23 14:20:39 +01:00
Igor Wiedler
3b9f52ae9a [Locale] use assertSame instead of assertEquals 2011-02-23 14:20:39 +01:00
Igor Wiedler
ae3ee5d896 [Locale] add support for L, which is the same as M 2011-02-23 14:20:38 +01:00
Igor Wiedler
b702ce86b5 [Locale] support for G and Q placeholders in StubIntlDateFormatter::format 2011-02-23 14:20:38 +01:00
Igor Wiedler
69f56dbbd9 [Locale] move intl bugs to skipped tests 2011-02-23 14:20:38 +01:00
Igor Wiedler
8c1146974f [Locale] add support for escaping, give specifics on implementation used in tests 2011-02-23 14:20:38 +01:00
Igor Wiedler
55ac407458 [Locale] first implementation of StubIntlDateFormatter 2011-02-23 14:20:37 +01:00
Bernhard Schussek
a40e2dd77b [Form] Deleted obsolete Field classes, ported some more to FormFactory and fixed lots of failing tests 2011-02-23 14:11:18 +01:00
Bernhard Schussek
7492873186 [Form] Fixed a couple of unit tests, refactored PasswordField to FormFactory 2011-02-23 14:11:18 +01:00
Bernhard Schussek
fee0885256 [Form] Moved options from Field and Form to FormFactory. Tests fail now 2011-02-23 14:11:18 +01:00
Bernhard Schussek
7a48c0a5c5 [Form] Refactored logic from ChoiceField into ChoicePlugin and SelectMultipleNamePlugin 2011-02-23 14:11:18 +01:00
Bernhard Schussek
f7dc71ef59 [Form] Refactored id and name generation to renderer plugins 2011-02-23 14:11:17 +01:00
Bernhard Schussek
813ec54fa1 [Form] Refactored parts of the choice fields into ChoiceList instances 2011-02-23 14:11:17 +01:00
Eriksen Costa
b649843e00 [Locale] added implementation to StubNumberFormatter::getLocale(), matching StubIntlDateFormatter::getLocale() 2011-02-23 13:26:05 +01:00
Eriksen Costa
b58e25cc83 [Locale] added static constructor 2011-02-23 13:26:05 +01:00
Eriksen Costa
69b0e09d6a [Locale] added stub implementations of Locale and NumberFormatter classes
Updated update-data.php script to extract locales, countries names, languages and currencies
from ICU to be used by the stub implementations
2011-02-23 13:26:05 +01:00
Kris Wallsmith
fb005396dc [HttpKernel] fixed another test where an explicit cache-control header is necessary 2011-02-21 21:53:04 -08:00
Kris Wallsmith
3e131f5b70 [HttpKernel] fixed invalid test
According to ResponseHeaderBag::computeCacheControlValue(), a response with an ETag but no explicit Cache-Control header should have a sensible Cache-Control of "private, must-revalidate" set. According to Response::isCacheable(), a response that includes a private Cache-Controls is not considered cacheable. Therefore, in order for this test response to be cacheable and stored, it requires an explicit Cache-Control of public.
2011-02-21 20:09:50 -08:00
Kris Wallsmith
a0bae94f88 [HttpFoundation] updated ResponseHeaderBag to compute Cache-Control whenever any of the headers it considers changes 2011-02-21 19:57:05 -08:00
Fabien Potencier
fc372bc217 [HttpKernel] changed core.view event to use notifyUntil() instead of filter() -- as soon as a listener returns a Response, we are done 2011-02-21 18:24:55 +01:00
Fabien Potencier
bf20238178 fixed a bug in Response content-type auto-detection
Without this patch, if you call __toString() on a Response,
the content-type auto-detection would never be trigerred
as __toString() changes the default content-type.
2011-02-21 16:57:25 +01:00
Fabien Potencier
9619c7dade [Routing] removing the routing hack where we add a / at the beginning if it does not exist 2011-02-21 10:25:22 +01:00
Matthew Lewinski
c56bcd9ff4 Fix unit test breakage from ProfilerStorageInterface change. 2011-02-20 20:06:36 -06:00
yclian
092403909e [DependencyInjection] Test for Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass. 2011-02-20 20:23:40 +08:00
yclian
3275820a6f [DependencyInjection] Add Symfony\Tests\Component\DependencyInjection\ContainerBuilderTest::testAddGetCompilerPass(). 2011-02-20 20:23:32 +08:00
Yuen-Chi Lian
a0e00ff159 [DependencyInjection] Aesthetic changes on ContainerTest, consequence of not using a formatter. 2011-02-19 19:50:57 +01:00
Yuen-Chi Lian
c42f38523f [DependencyInjection] Test coverage improvements and corrections on Container. 2011-02-19 19:49:26 +01:00
Ryan Weaver
026ab6c6ce [Config] Adding an ignoreExtraKeys options, which allows you to let options simply be ignore without throwing a validation exception.
I had thought that this was unnecessary - when would you ever want to just let "extra" options fail silently?

But, the SecurityExtension takes advantage of this by creating two separate config trees. The first tree looks for just one particular value on the configuration array and ignores the rest. So, there *is* a use-case for allowing all extra fields to simply be ignored, though this should not be the norm.
2011-02-18 13:31:14 -06:00
Ryan Weaver
d2971e0f5f [Config] Reverting some meaningless changes that are no longer needed to minimize the true diff of the changes. Increasing the test precision. 2011-02-18 13:08:53 -06:00
Ryan Weaver
6f17b6d58e [Config] Reverting the preventExtraKeys option. This is a revert of functionality that would have allowed "unnamed" children to be added to an array node.
We decided that this is not necessary and that it's leaving too many things wide open. Instead, in these cases where we have an array with unknown items, a prototype should be used.

Further functionality will need to be added later to allow you to specify a few nodes that you *do* know about under an array and then also specify a prototype to catch everything else.
2011-02-18 12:59:27 -06:00
Ryan Weaver
6d24d37b16 [Config] Moving the removal of the key attribute on ArrayNode onto the setKeyAttribute() method per Johannes.
This is more consistent with how this was handled elsewhere, and it really is an "option" on the keyAttribute idea.
2011-02-18 08:41:30 -06:00
Ryan Weaver
48459e9082 [Config] Renaming the key attribute removal property for consistency per Johannes' recommendation. Also fixing a PHPDoc typo per Stof. 2011-02-18 08:38:09 -06:00
Ryan Weaver
d6617f6fba [Config] Renaming NodeBuilder::nodeBuilder() to NodeBuilder::builder() due to the fact that PHP can get confused when you have a __construct() method *and* a method that has the same name as the class (looks like two constructors to PHP). 2011-02-18 07:31:00 -06:00
Ryan Weaver
ea768fe6fc [Config] Making the option to remove a key attribute optional.
This is *usually* what you want (and is defaulted this way). If you have an entry in an array *just* so it can become the key to that entry later, then you shouldn't normally still need it in the resulting array.

The importance of this comes in with validation. Since we're throwing an exception if you have any unrecognized options, the presence of the "key" field in the resulting array will cause issues when it's not needed.
2011-02-18 07:15:59 -06:00
Ryan Weaver
7a9243a220 [Config] Making changes per the recent movement of the Config builder into the Config component. 2011-02-18 06:59:35 -06:00
Ryan Weaver
e7c098e8a2 [DependencyInjection] Renaming allowUnnamedChildren to preventExtraKeys. Also moved the place where validation of extra configs occurs. 2011-02-18 06:52:44 -06:00
Ryan Weaver
fd5cdfc18f [DependencyInjection] Being sure to remove XML-remapped singular options and key attribute options after processing.
This prevents these keys from being validated as extra fields.
2011-02-18 06:52:44 -06:00
Ryan Weaver
bd15ddda96 [DependencyInjection] Adding a NodeBuilder::addNodeBuilder() method that helps achieve a fluid interface when a pre-built NodeBuilder needs to be added. 2011-02-18 06:51:56 -06:00
Ryan Weaver
f5b1cb18e1 [DependencyInjection] Initial implementation of an allowUnnamedChildren method on NodeBuilder. Also added an "extra field" exception.
This allows for an array node, which has any number of child values not represented by nodes.
2011-02-18 06:51:56 -06:00
hhamon
f985da5a9c [HttpFoundation] fix Cache-Control header when forcing the Response to have an Expires header field. The RFC2616 Bis indicates that if the Response has both max-age (or s-maxage) and Expires header field, the Cache-Control maxage wins over Expires. The previous code in ResponseHeaderBag always returned "private, max-age=0, must-revalidate" even if the Expires header field was forced.
This commit breaks functional tests in Symfony\Component\HttpKernel\HttpCache\HttpCacheTest.php. I tried to fix functional tests but I didn\'t manage to. For your information, the "try { } catch" block in the HttpKernel\HttpCache::lookup() method seems strange because I suspect line 274 to never leverage any exception...
2011-02-18 12:34:33 +01:00
hhamon
b687e52835 [DomCrawler] fix Form::getUri() when the form action attribute contains only a sharp (#) character. 2011-02-17 19:37:25 +01:00
Fabien Potencier
6b12c21261 moved DependencyInjection\Configuration to Config\Definition 2011-02-17 16:03:48 +01:00
Ryan Weaver
c5e4dfb5a6 [DependencyInjection] Adding to InvalidArgumentException messages to clarify when a service is given an invalid "tags" value. 2011-02-17 15:59:39 +01:00
Victor Berchet
0a33cbb403 [Finder] Add support for relative path 2011-02-17 07:23:55 +01:00
Bernhard Schussek
9569262635 [Form] Fixed date handling classes to use server timezone by default 2011-02-16 23:05:22 +01:00
Bernhard Schussek
0a260b96fb [Form] Fixed error handling in DateTimeToArrayTransformer 2011-02-16 23:05:22 +01:00
Bernhard Schussek
df011ed1ef [Form] Fixed isXXXWithinRange() methods in TimeField and DateField to ignore empty dropdowns 2011-02-16 23:05:22 +01:00
Bernhard Schussek
14c3518c6e [Form] Fixed: If a DateField or TimeField is displayed with select boxes, either all or no select box must have a value selected 2011-02-16 23:05:22 +01:00
Bernhard Schussek
40acc6ac79 [Form] Fixed ChoiceField::isChoiceSelected() to differentiate between zero and empty 2011-02-16 23:05:21 +01:00
Bernhard Schussek
1593d6f75d [Form] Added method FieldInterface::isEmpty() 2011-02-16 23:05:21 +01:00
Johannes M. Schmitt
53f3ff8258 [Security] adds a chain user provider 2011-02-16 23:00:27 +01:00
Victor Berchet
bad3a97ad6 [Finder] tweak code 2011-02-16 22:51:06 +01:00
Fabien Potencier
a29a413c48 made DIC extensions members of the Container instead of static members 2011-02-15 22:22:32 +01:00
Fabien Potencier
62e3053769 refactored previous commit, fixed tests
How to upgrade?

For XML configuration files:

 * All extensions should now use the config tag (this is just a convention as
   the YAML configurations files do not use it anymore):

 * The previous change means that the doctrine and security bundles now are
   wrapped under a main "config" tag:

        <doctrine:config>
            <doctrine:orm />
            <doctrine:dbal />
        </doctrine:config>

        <security:config>
            <security:acl />
            ...
        </security:config>

For YAML configuration files:

 * The main keys have been renamed as follows:

        * assetic:config -> assetic
        * app:config -> framework
        * webprofiler:config -> web_profiler
        * doctrine_odm.mongodb -> doctrine_mongo_db
        * doctrine:orm -> doctrine: { orm: ... }
        * doctrine:dbal -> doctrine: { dbal: ... }
        * security:config -> security
        * security:acl -> security: { acl: ... }
        * twig.config -> twig
        * zend.config -> zend
2011-02-15 22:22:28 +01:00
Pablo Godel
02492d2ab3 renamed SQLiteProfilerStorage to SqliteProfilerStorage 2011-02-15 21:57:09 +01:00
Pablo Godel
f6a1c2d195 renamed SQLiteProfilerStorage to SqliteProfilerStorage 2011-02-15 21:57:09 +01:00
Pablo Godel
c3649882f6 renamed file 2011-02-15 21:57:08 +01:00
Pablo Godel
05f651ae87 renamed file 2011-02-15 21:57:08 +01:00
Jeremy Mikola
cc4eb6b40f [Security] Add providerKey to PreAuthenticatedToken tokens constructed by PreAuthenticatedAuthenticationProvider 2011-02-15 21:55:24 +01:00
Kris Wallsmith
ba239905d7 [HttpFoundation] removed unknown constructor arg from tests 2011-02-15 21:51:21 +01:00
Jeremy Mikola
b8d574087f [Security] Allow authentication tokens to hold attributes 2011-02-15 21:50:02 +01:00
Bernhard Schussek
7dbc09ed8b [Form] Fixed reference handling in forms. Sometimes data wasn't written into the domain object, resulting in failed validation. 2011-02-15 21:39:32 +01:00
John Wards
73cd26e2ca [Serializer] added the ability to add attributes to nodes using an array key begining with @
Example:

array(
	'foo-bar' => array(
		'@id' => 1,
		'@name' => 'Bar'
	),
	Foo' => array(
		'Bar' => "Test",
		'@Type' => 'test'
	)
)

Parse XML now creates @ attribites for the array.

$rss = array(
   "channel" => array(
     "title" => "Test RSS",
     "description" => "Test description",
     "item" => array(
       0 => array(
         "title" => "Test Title 1",
         "link" => "http://foo.com"
       ),
       1 => array(
         "title" => "Test Title 2",
         "link" => "http://bar.com"
       )
     )
   )
);

<channel>
    <title>Test RSS</title>
    <description>Test description</description>
    <item>
        <title>Test Title 1</title>
        <link>http://foo.com</link>
    </item>
    <item>
        <title>Test Title 2</title>
        <link>http://bar.com</title>
    </item>
</channel>
2011-02-14 22:20:03 +01:00
Victor Berchet
8588d55c11 [Config] Improve the component 2011-02-14 22:05:56 +01:00
Victor Berchet
af81bcabf0 [Templating] Refactor the component 2011-02-14 21:11:44 +01:00
Johannes M. Schmitt
44b89e5ac3 [Security] fixes a bug when clearing cookies on logout 2011-02-14 20:55:07 +01:00
Johannes Schmitt
5c7fe8f866 [Security] simplified encoder factory implementation 2011-02-14 20:55:06 +01:00
Fabien Potencier
5c905beb13 moved common configuration classes to a new Config component 2011-02-13 22:31:50 +01:00
Jordi Boggiano
f5f41696ec [Serializer] Allow for more flexible element names 2011-02-13 17:47:22 +01:00
Jordi Boggiano
8216a6ef3d [Serializer] Added XmlEncoder::setRootNodeName 2011-02-13 17:47:22 +01:00
Johannes M. Schmitt
d4d2d60f7b [DependencyInjection] minor interface change 2011-02-13 10:38:10 +01:00
Christophe Coevoet
cb0fa406aa Added unit tests 2011-02-12 21:56:22 +01:00
Fabian Vogler
9bf845bc51 Test for SimpleXML encode 2011-02-12 21:54:27 +01:00
Johannes Schmitt
19bbafc441 [Security] Refactored security context, moved getUser() implementation to templating 2011-02-12 21:53:04 +01:00
Johannes Schmitt
66fbbd6b17 [Security] removed __toString() from AccountInterface 2011-02-12 21:53:04 +01:00
hhamon
beaaa6d457 [BrowserKit] fix Response::__toString() method to take care of multiple headers, for example when setting more than one cookie. 2011-02-12 21:52:33 +01:00
Kris Wallsmith
36ff9abe67 [Console] fixed new ArgvInput method 2011-02-12 21:51:34 +01:00
Jordi Boggiano
5bf593353f [Routing] Added optional trailing slash support to ApacheMatcherDumper 2011-02-10 23:46:23 +01:00
Jordi Boggiano
2ed0b975f1 [Routing] Added tests for PhpMatcherDumper changes 2011-02-10 23:46:23 +01:00
Fabien Potencier
b91f082be5 Revert "moved Resource to the Config component"
This reverts commit f53080860a.

Revert "[Router] config fixes"

This reverts commit 51beecc6f2.

Revert "moved duplicated files to a new Config component"

This reverts commit a8ec9b27f0.
2011-02-10 16:14:12 +01:00
Fabien Potencier
f53080860a moved Resource to the Config component 2011-02-10 16:07:42 +01:00
Fabien Potencier
a8ec9b27f0 moved duplicated files to a new Config component 2011-02-10 03:43:36 +01:00
Fabien Potencier
e58a84eb09 added a FileLocator to DIC so that we can load resources like @BundleName/Resources/... 2011-02-10 00:44:02 +01:00
Bernhard Schussek
f51dafca3f [Form] Fixed: "data_constructor" option is used even if "data_class" option is not set 2011-02-08 04:14:56 +01:00
Bernhard Schussek
5b95805340 [Form] Added option "data_constructor" to Form. When a Form is initialized with NULL, an object is automatically created using this constructor. If no constructor is given but the option "data_class" is set, an object of that class is created with the default constructor instead. 2011-02-08 04:14:56 +01:00
Bernhard Schussek
09a50c3c55 [Form] Fixed: "by_reference" option is ignored if reading from/writing to an array 2011-02-08 04:14:55 +01:00
Kris Wallsmith
ef43b22546 [HttpFoundation] fixed test cleanup 2011-02-08 04:14:39 +01:00
pborreli
41bf849a63 [HttpFoundation] Request coverage 2011-02-07 02:49:14 +01:00
Marc Weistroff
bebdcb242d [HttpKernel] Added response cache-control modification if page is composed of ESIs.
Rules are :
- If one of the ESI has validation cache strategy, the whole page will be
forced to validate.
- In none of the ESI has validation, the response will feature a Cache-Control
directive with s-maxage value equals to the smallest TTL of ESIs.
2011-02-07 01:34:14 +01:00
pborreli
7ad4f99153 [HttpFoundation] File/UploadedFile, MimeTest, Exception full coverage 2011-02-06 21:53:36 +01:00
Johannes M. Schmitt
2b256a0804 [DependencyInjection] allow null for scalar nodes 2011-02-06 20:50:03 +01:00
Johannes M. Schmitt
c7ef8d98d6 [DependencyInjection] append new elements for prototype nodes without a key attribute 2011-02-06 20:11:08 +01:00
Johannes Schmitt
0b8fef2347 [Security/DependencyInjection] adds support for merging security configurations
The merging is done in three steps:

    1. Normalization:
    =================
    All passed config arrays will be transformed into the same structure
    regardless of what format they come from.

    2. Merging:
    ===========
    This is the step when the actual merging is performed. Starting at the root
    the configs will be passed along the tree until a node has no children, or
    the merging of sub-paths of the current node has been specifically disabled.

       Left-Side       Right-Side      Merge Result
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       -nothing-       array           Right-Side will be taken.
       scalar          scalar          Right-Side will be taken.
       array           false           Right-Side will be taken if ->canBeUnset()
                                       was called on the array node.
       false           array           Right-Side will be taken.
       array           array           Each value in the array will be passed to
                                       the specific child node, or the prototype
                                       node (whatever is present).

    3. Finalization:
    ================
    The normalized, and merged config will be passed through the config tree to
    perform final validation on the submitted values, and set default values
    where this has been requested.

You can influence this process in various ways, here is a list with some examples.
All of these methods must be called on the node on which they should be applied.

  * isRequired(): Node must be present in at least one config file.
  * requiresAtLeastOneElement(): PrototypeNode must have at least one element.
  * treatNullLike($value): Replaces null with $value during normalization.
  * treatTrueLike($value): Same as above just for true
  * treatFalseLike($value): Same as above just for false
  * defaultValue($value): Sets a default value for this node (only for scalars)
  * addDefaultsIfNotSet(): Whether to add default values of an array which has not
                           been defined in any configuration file.
  * disallowNewKeysInSubsequentConfigs(): All keys for this array must be defined
                                          in one configuration file, subsequent
                                          configurations may only overwrite these.
  * fixXmlConfig($key, $plural = null): Transforms XML config into same structure
                                        as YAML, and PHP configurations.
  * useAttributeAsKey($name): Defines which XML attribute to use as array key.
  * cannotBeOverwritten(): Declares a certain sub-path as non-overwritable. All
                           configuration for this path must be defined in the same
                           configuration file.
  * cannotBeEmpty(): If value is set, it must be non-empty.
  * canBeUnset(): If array values should be unset if false is specified.

Architecture:
=============
The configuration consists basically out of two different sets of classes.

  1. Builder classes: These classes provide the fluent interface and
                      are used to construct the config tree.

  2. Node classes: These classes contain the actual logic for normalization,
                   merging, and finalizing configurations.

After you have added all the metadata to your builders, the call to
->buildTree() will convert this metadata to actual node classes. Most of the
time, you will not have to interact with the config nodes directly, but will
delegate this to the Processor class which will call the respective methods
on the config node classes.
2011-02-06 20:11:08 +01:00
ornicar
c5fb96b86b [HttpKernel] Add more unit tests for Kernel 2011-02-06 20:05:49 +01:00
Bernhard Schussek
74d0ac82f7 [Form] Cleaned up ValueTransformerInterface
This commit removes CollectionToStringTransformer. Transformers should never change the state of the outside world, otherwise hard-to-track bugs might creap in.

This functionality needs to be implemented as a custom FieldType (see EntityChoiceField).
2011-02-06 19:46:29 +01:00
Bernhard Schussek
bd3e6c6b49 [Form] Fixed: Form::bind() throws an exception if form is anonymous 2011-02-06 19:46:28 +01:00
Bernhard Schussek
6ff4120784 [Form] Added Form option "by_reference" so that objects received from parent forms are modified by reference when this option is true (the default)
The implication is that set<Reference>() in the object of the parent form will not be called (and thus not has to be implemented/public).

If you want to suppress this behaviour, manually set "by_reference" to false.
2011-02-06 19:46:28 +01:00
ornicar
9ba2943aff [HttpKernel] Add unit tests for Kernel. Also slightly modify Kernel to make it more testable. 2011-02-06 16:17:35 +01:00
John Kary
c251a36935 [HttpFoundation] Add tests for Cookie 2011-02-06 16:16:05 +01:00
ornicar
bd97471954 [HttpKernel] Add test coverage for cache warming 2011-02-05 23:54:09 +01:00
pborreli
f56a6efbf5 [HttpFoundation] File/File full coverage 2011-02-05 23:24:00 +01:00
Fabien Potencier
e5403490e7 removed the need to define getNamespace() and getPath() in bundles 2011-02-05 22:40:30 +01:00
Jeremy Mikola
743f25a287 [DependencyInjection] Create explicit factoryClass property for Definitions
Previously, the Definition class was used both for type inference and factory construction (if factoryService was absent). This is fine for cases where classes create instances of themselves (e.g. getInstance() or create()), but leads to ambiguity when we have a separate factory class.
2011-02-05 20:39:42 +01:00
ornicar
575b75a9df [DependencyInjection] Fix fixture class loaded twice during dumper tests 2011-02-05 20:27:47 +01:00
Fabien Potencier
199e6bf893 [BrowserKit] removed annotation in a unit test to fix coverage 2011-02-05 16:02:59 +01:00
Martijn Evers
1e3dc1479c [Testing][HttpKernel] Added possibility to functional test raw body data 2011-02-04 13:07:13 +01:00
Victor Berchet
3ed47114d6 [Bundle] Make getPath() less error prone by allowing both backward and forward slashes 2011-02-04 12:12:19 +01:00
Bernhard Schussek
2276b98fc1 [Form] Fixed: ChoiceFields never validated 2011-02-04 11:30:49 +01:00
Daniel Holmes
f4282eea98 [Routing] added support for non-standard port numbers in absolute urls 2011-02-04 00:25:25 +01:00
Fabien Potencier
b6f400a2bc [DependencyInjection] made an optimization on dumped DIC
When dumping a Container, and if it is frozen, we use a plain
PHP array for parameters instead of a ParameterBag.
2011-02-04 00:17:51 +01:00
Bernhard Schussek
a725415440 [Form] Fixed RepeatedField not to trigger NotNull/NotBlank errors if any of the fields was filled in 2011-02-03 13:28:29 +01:00
Bernhard Schussek
39c148197f [Form] Fixed form validation
Separated validation of data and form had serious drawbacks. When a form had nested form whose data was not connected to the data of the root form, this data would not be validated.

The new implementation validates the whole object graph at once. Class Form has a new method validateData(), that manually passes the data to the GraphWalker of the Validator and overrides the Default group with the groups set in the form.
2011-02-03 13:21:44 +01:00
Bernhard Schussek
1a34743990 [Validator] Fixed: Collections annotated with @Valid may contain scalar values. These values are ignored by the GraphWalker 2011-02-03 13:21:37 +01:00
Bernhard Schussek
50955a3919 [Validator] Fixed PropertyPath to read array indices with special characters 2011-02-03 11:28:51 +01:00
Bernhard Schussek
5ed4d91bb8 [Validator] Implemented Execute constraint 2011-02-03 11:00:03 +01:00
Bernhard Schussek
7c9c7af863 [Form] Fixed arrays not to be passed to the validator 2011-02-02 17:32:24 +01:00
Bernhard Schussek
5e3fab214e [Form] The form is now validated seperatedly from its data. The form is validated in group "Default", the data in the group set in option "validation_groups" 2011-02-02 15:25:05 +01:00
Bernhard Schussek
c923af2879 [Form] Adapted constructor of CollectionField to match the constructors of the other fields. The field prototype is now optional. 2011-02-02 14:46:33 +01:00
Bernhard Schussek
4f0283a508 [Form] Removed Form::isBound(). Form::bind() is only a shortcut method now, use Form::isSubmitted() if you want to find out whether a form was submitted. 2011-02-02 14:46:33 +01:00
Bernhard Schussek
628a4d1fd8 [Form] Refactored validation logic into validate() method. Removed bindGlobals() to reduce API clutter 2011-02-02 14:46:33 +01:00
Thomas
e6dc155e89 fix validator class metadata warning 2011-02-02 11:37:41 +01:00
Jeremy Mikola
4e0db56810 [Form] Fix getValidator() to reference the "validator" option instead of property 2011-02-02 11:34:18 +01:00
Johannes Schmitt
b484763a7a [DependencyInjection] added first version of the config normalizer
This is mainly intended for complex configurations to ease the work you
have with normalizing different configuration formats (YAML, XML, and PHP).

First, you have to set-up a config tree:

    $treeBuilder = new TreeBuilder();
    $tree = $treeBuilder
        ->root('security_config', 'array')
            ->node('access_denied_url', 'scalar')->end()
            ->normalize('encoder')
            ->node('encoders', 'array')
                ->key('class')
                ->prototype('array')
                    ->before()->ifString()->then(function($v) { return array('algorithm' => $v); })->end()
                    ->node('algorithm', 'scalar')->end()
                    ->node('encode_as_base64', 'scalar')->end()
                    ->node('iterations', 'scalar')->end()
                ->end()
            ->end()
        ->end()
        ->buildTree()
    ;

This tree and the metadata attached to the different nodes is then used
to intelligently transform the passed config array:

    $normalizedConfig = $tree->normalize($config);
2011-02-01 16:07:04 +01:00
Bernhard Schussek
a28151a8af [Form] Removed FormFactory and improved the form instantiation process
With the form factory there was no reasonable way to implement instantiation of custom form classes. So the implementation was changed to let the classes instantiate themselves. A FormContext instance with default settings has to be passed to the creation method. This context is by default configured in the DI container.

	$context = $this->get('form.context');
	// or
	$context = FormContext::buildDefault();
	$form = MyFormClass::create($context, 'author');

If you want to circumvent this process, you can also create a form manually. Remember that the services stored in the default context won't be available then unless you pass them explicitely.

	$form = new MyFormClass('author');
2011-02-01 15:27:12 +01:00
Bernhard Schussek
fb1f99137d [Form] Changed semantics of a "bound" form
A form now always has to be bound, independent of whether the request is a POST request or not. The bind() method detects itself whether the request was a post request or not and reads its data accordingly. The "old" bind()/isBound() methods were renamed to submit()/isSubmitted().

	$form = new Form('author');
	$form->bind($request, $author);

	if ($form->isValid()) {
		// isValid() implies isSubmitted(), non-submitted forms can
		// never be valid
		// do something with author now
	}

Alternatively, you can only bind global variables, if you don't have a request object.

	$form->bindGlobals($author);

Note that the $author object is in both cases optional. You can also pass no object at all and read the data using $form->getData(), but then no validation will occur. You can also prefill the form with an object during instantiation.

	$form = new Form('author', array('data' => $author));
	$form->bind($request);

	// etc.
2011-02-01 15:27:12 +01:00
Bernhard Schussek
e5ed98c324 [Form] Added option 'data' to Field for populating a field with a fixed value 2011-02-01 15:27:12 +01:00
Bernhard Schussek
fdbc064f06 [Form] Removed automatic distribution of the locale in the Form component. This leads to more problems than it solves. 2011-02-01 15:27:12 +01:00
Bernhard Schussek
c468db5c5b [Form] Merged classes FieldGroup and Form for simplicity 2011-02-01 15:27:12 +01:00
Bernhard Schussek
4fcb98547c [Form] Simplified Form::bind(), added convenience methods Form::bindRequest() and Form::bindGlobals() 2011-02-01 15:27:12 +01:00
Bernhard Schussek
57cbd57265 [Form] Fields may now be anonymous, but anonymous fields must not be added to groups. They can only be used as prototypes 2011-02-01 15:27:12 +01:00
Bernhard Schussek
d152b5e265 [Form] Moved Doctrine2 specific files 2011-02-01 15:27:12 +01:00
Bernhard Schussek
347c069e8d [DoctrineBundle][Form] Implemented EntityChoiceField 2011-02-01 15:27:12 +01:00
Fabien Potencier
2c4355460e [HttpKernel] added a StoreInterface 2011-01-31 14:15:12 +01:00
Victor Berchet
f470c5605e [Request] Fix getting mime type 2011-01-30 20:14:40 +01:00
Jordi Boggiano
571c984625 [Validator] Skip tests that rely on Doctrine being present if its not 2011-01-30 09:18:18 +01:00
Victor Berchet
5e5b6f0cf8 [HttpKernel] made sure that parent bundles are registered before their descendants 2011-01-29 16:38:06 +01:00
Victor Berchet
65eb70d3b6 [Kernel] Tweak bundle management 2011-01-29 10:15:25 +01:00
Bulat Shakirzyanov
5252d3aef0 [Serializer] switched to setEncoder, to be consistent with getEncoder 2011-01-28 18:24:34 +01:00
Bernhard Schussek
ebd2ca6cfe [Form] Moved option 'empty_value' to ChoiceField. An empty value is displayed if the field is not required. 2011-01-28 09:22:06 +01:00
Bernhard Schussek
ce61baf717 [Form] ChoiceField now accepts closures in the 'choices' option 2011-01-28 09:20:41 +01:00
Bernhard Schussek
0c3ca26e6e [Validator] Implemented traversing of \Traversable objects using the @Valid constraint. Can be disabled by setting the @Valid option 'traverse' to false 2011-01-28 09:19:32 +01:00
Johannes Schmitt
803dd58002 add definition inheritance support 2011-01-28 09:12:29 +01:00
Fabien Potencier
98c1056fbf renamed Request::fromGlobals() to Request::createFromGlobals() (for consistency with the existing create() method) 2011-01-27 21:20:08 +01:00
Kris Wallsmith
224e66f77b [HttpFoundation] added static Request::fromGlobals()
The Request constructor no longer uses values from PHP's super globals. If you want a Request populated with these values you must use the new static method Request::fromGlobals().

Your front controllers (i.e. web/app.php, web/app_dev.php ...) will need to be updated:

    // old
    $kernel->handle(new Request())->send();

    // new
    $kernel->handle(Request::fromGlobals())->send();
2011-01-27 21:12:55 +01:00
Fabien Potencier
95e10b3ed9 moved ClassLoaderCollection class to the ClassLoader component 2011-01-27 14:11:54 +01:00
Fabien Potencier
6997fbac0d fixed previous commit 2011-01-27 13:58:21 +01:00
Johannes M. Schmitt
cf64d2cfe7 namespace changes
Symfony\Component\Security -> Symfony\Component\Security\Core
Symfony\Component\Security\Acl remains unchanged
Symfony\Component\HttpKernel\Security -> Symfony\Component\Security\Http
2011-01-26 22:23:20 +01:00
Fabien Potencier
75404e6bd6 renamed HttpKernel/Cache/ namespace to HttpKernel/HttpCache/ 2011-01-26 21:44:54 +01:00
Fabien Potencier
e645090423 moved security related things to a new SecurityBundle (the Security component is left unchanged) 2011-01-26 19:10:54 +01:00
Johannes Schmitt
e0fe42d050 removed isAuthenticated() from SecurityContext 2011-01-26 16:38:54 +01:00
Johannes Schmitt
57ae50e894 [Security] many improvements, and fixes 2011-01-26 16:38:54 +01:00
Fabien Potencier
db2f2b1315 refactored template name parser to occur independently of the loaders 2011-01-26 14:53:12 +01:00
Fabien Pennequin
c392f2518d [Form][Validator] Fixed indentation 2011-01-26 10:36:10 +01:00
Fabien Potencier
8b62df7247 changed the EventDispatcher and Event interfaces
The three notification methods do not return the Event instance anymore.

notify() does not return anything
notifyUntil() returns the returned value of the event that has processed the event
filter() returns the filtered value

Upgrading your listeners:
Listeners for notify() and filter() events: nothing to change
Listeners for notifyUntil() events:

Before:

    $event->setReturnValue('foo');
    return true;

After:

    $event->setProcessed();
    return 'foo';

If you notify events, the processing also need to be changed:

For filter() notifications: the filtered value is now available as
the returned value of the filter() method.

For notifyUntil() notifications:

Before:

    $event = $dispatcher->notifyUntil($event);
    if ($event->isProcessed()) {
        $ret = $event->getReturnValue();

        // do something with $ret
    }

After:

    $ret = $dispatcher->notifyUntil($event);
    if ($event->isProcessed()) {
        // do something with $ret
    }
2011-01-26 08:41:59 +01:00
Fabien Potencier
fb4e7fb5c5 added KernelInterface 2011-01-25 17:10:47 +01:00
Johannes Schmitt
40dec8831f adds helper method to normalize keys 2011-01-25 15:59:51 +01:00
Bernhard Schussek
d017970867 [Form] Implemented FormFactory::buildDefault() to ease the use of the new CSRF implementation without the DIC 2011-01-25 11:31:04 +01:00
Bernhard Schussek
7848a7ca63 [Form] Refactored CSRF implementation to be reusable and to work correctly with the session service 2011-01-25 11:31:04 +01:00
Ryan Weaver
d341e8bccb [Form] Adding PHPDoc to many Field objects and making other small changes:
* Added empty_value option on CountryField, LanguageField, LocaleField, TimezoneField
 * Added missing date_pattern to DateTimeField
 * Made the currency option on MoneyField required.
2011-01-25 11:10:25 +01:00
Johannes Schmitt
f29a5f74a1 made the DI config validation more strict to catch errors early 2011-01-24 21:15:48 +01:00
Fabien Pennequin
242562a361 [HttpFoundation] added test for processed array in sub-requests 2011-01-24 18:22:48 +01:00
Johannes M. Schmitt
e55f150fb7 adds hasTag() to Definition 2011-01-24 17:46:22 +01:00
Johannes M. Schmitt
0144dd86da adds synthetic attribute to definitions
This attribute can be used to hint that the service is being injected
dynamically at runtime, and not constructed by the DIC.
2011-01-23 21:11:50 +01:00
Fabien Potencier
1c11d81611 made all event listeners lazy loaded
* The register() method on all listeners has been removed
 * Instead, the information is now put directly in the DIC tag

For instance, a listener on core.request had this method:

   public function register(EventDispatcher $dispatcher, $priority = 0)
   {
       $dispatcher->connect('core.response', array($this, 'filter'), $priority);
   }

And this tag in the DIC configuration:

  <tag name="kernel.listener" />

Now, it only has the following configuration:

  <tag name="kernel.listener" event="core.response" method="filter" priority="0" />

The event and method attributes are now mandatory.
2011-01-23 18:07:05 +01:00
Jordi Boggiano
005c1d9df8 [Serializer] Added initial version of the Serializer component 2011-01-23 12:34:47 +01:00
Bulat Shakirzyanov
271e757f27 [HttFoundation] extracted FileBag, ServerBag, fixed HeaderBag::add(), updated Request test 2011-01-23 07:40:31 +01:00
Johannes M. Schmitt
1d5b6ed908 adds scope to the DI container 2011-01-22 15:20:50 +01:00
Fabien Potencier
bd6bc4db62 [HttpKernel] changed Kernel::locateResource() to also work with directories 2011-01-21 16:42:57 +01:00
Fabien Potencier
d2e24a9cae added a missing file for unit tests 2011-01-21 15:06:38 +01:00
Fabien Potencier
82d29d2a76 [HttpKernel] added a unit tests for previous commit 2011-01-21 11:54:34 +01:00
Fabien Potencier
e6f1248151 [HttpKernel] added back Bundle::getName() as it is quite useful 2011-01-21 09:45:37 +01:00
Fabien Potencier
6d1e91a1fa refactored bundle management
Before I explain the changes, let's talk about the current state.

Before this patch, the registerBundleDirs() method returned an ordered (for
resource overloading) list of namespace prefixes and the path to their
location. Here are some problems with this approach:

 * The paths set by this method and the paths configured for the autoloader
   can be disconnected (leading to unexpected behaviors);

 * A bundle outside these paths worked, but unexpected behavior can occur;

 * Choosing a bundle namespace was limited to the registered namespace
   prefixes, and their number should stay low enough (for performance reasons)
   -- moreover the current Bundle\ and Application\ top namespaces does not
   respect the standard rules for namespaces (first segment should be the
   vendor name);

 * Developers must understand the concept of "namespace prefixes" to
   understand the overloading mechanism, which is one more thing to learn,
   which is Symfony specific;

 * Each time you want to get a resource that can be overloaded (a template for
   instance), Symfony would have tried all namespace prefixes one after the
   other until if finds a matching file. But that can be computed in advance
   to reduce the overhead.

Another topic which was not really well addressed is how you can reference a
file/resource from a bundle (and take into account the possibility of
overloading). For instance, in the routing, you can import a file from a
bundle like this:

  <import resource="FrameworkBundle/Resources/config/internal.xml" />

Again, this works only because we have a limited number of possible namespace
prefixes.

This patch addresses these problems and some more.

First, the registerBundleDirs() method has been removed. It means that you are
now free to use any namespace for your bundles. No need to have specific
prefixes anymore. You are also free to store them anywhere, in as many
directories as you want. You just need to be sure that they are autoloaded
correctly.

The bundle "name" is now always the short name of the bundle class (like
FrameworkBundle or SensioCasBundle). As the best practice is to prefix the
bundle name with the vendor name, it's up to the vendor to ensure that each
bundle name is unique. I insist that a bundle name must be unique. This was
the opposite before as two bundles with the same name was how Symfony2 found
inheritance.

A new getParent() method has been added to BundleInterface. It returns the
bundle name that the bundle overrides (this is optional of course). That way,
there is no ordering problem anymore as the inheritance tree is explicitely
defined by the bundle themselves.

So, with this system, we can easily have an inheritance tree like the
following:

FooBundle < MyFooBundle < MyCustomFooBundle

MyCustomFooBundle returns MyFooBundle for the getParent() method, and
MyFooBundle returns FooBundle.

If two bundles override the same bundle, an exception is thrown.

Based on the bundle name, you can now reference any resource with this
notation:

    @FooBundle/Resources/config/routing.xml
    @FooBundle/Controller/FooController.php

This notation is the input of the Kernel::locateResource() method, which
returns the location of the file (and of course it takes into account
overloading).

So, in the routing, you can now use the following:

    <import resource="@FrameworkBundle/Resources/config/internal.xml" />

The template loading mechanism also use this method under the hood.

As a bonus, all the code that converts from internal notations to file names
(controller names: ControllerNameParser, template names: TemplateNameParser,
resource paths, ...) is now contained in several well-defined classes. The
same goes for the code that look for templates (TemplateLocator), routing
files (FileLocator), ...

As a side note, it is really easy to also support multiple-inheritance for a
bundle (for instance if a bundle returns an array of bundle names it extends).
However, this is not implemented in this patch as I'm not sure we want to
support that.

How to upgrade:

 * Each bundle must now implement two new mandatory methods: getPath() and
   getNamespace(), and optionally the getParent() method if the bundle extends
   another one. Here is a common implementation for these methods:

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return 'MyFrameworkBundle';
    }

    /**
     * {@inheritdoc}
     */
    public function getNamespace()
    {
        return __NAMESPACE__;
    }

    /**
     * {@inheritdoc}
     */
    public function getPath()
    {
        return strtr(__DIR__, '\\', '/');
    }

 * The registerBundleDirs() can be removed from your Kernel class;

 * If your code relies on getBundleDirs() or the kernel.bundle_dirs parameter,
   it should be upgraded to use the new interface (see Doctrine commands for
   many example of such a change);

 * When referencing a bundle, you must now always use its name (no more \ or /
   in bundle names) -- this transition was already done for most things
   before, and now applies to the routing as well;

 * Imports in routing files must be changed:
    Before: <import resource="Sensio/CasBundle/Resources/config/internal.xml" />
    After:  <import resource="@SensioCasBundle/Resources/config/internal.xml" />
2011-01-20 18:42:47 +01:00
Fabien Potencier
24ff22af07 [HttpFoundation] added a directory fallback for when the class is not found in registered namespaces and class prefixes 2011-01-20 10:20:14 +01:00
Johannes M. Schmitt
84fa4b50db adds setArgument to Definition 2011-01-19 21:48:56 +01:00
Bernhard Schussek
bdd2c91abd [Form] Fixed failing test 2011-01-19 17:51:07 +01:00
Jordi Boggiano
d928632583 [Form] Made RepeatedField sub-field names configurable 2011-01-19 16:36:57 +01:00
Bernhard Schussek
d327a90ff2 [Validator] Added namespace prefix support for XML and YAML loaders 2011-01-19 16:25:50 +01:00
Bernhard Schussek
2d7c47e488 [Validator] Each object is now only validated once for a given group 2011-01-19 16:25:50 +01:00
Bernhard Schussek
eed3c9a48c [Validator] Added abstract method Constraint::targets() to define whether constraints can be put onto properties, classes or both 2011-01-19 16:25:50 +01:00
Bernhard Schussek
6ad22fd702 [Validator] Added ValidatorFactory for programmatically creating validators 2011-01-19 16:25:50 +01:00
Bernhard Schussek
8f8f53d631 [Form][FrameworkBundle] Implemented FormFactory and added it to the DI container 2011-01-19 16:25:50 +01:00
Bernhard Schussek
fea37a3e95 [Validator] Added tests for AssertTypeValidator 2011-01-19 16:25:50 +01:00
Victor Berchet
3e8f8ea6af [ProfilerStorage] Make write() returns a status (Boolean) 2011-01-19 07:38:46 +01:00
Victor Berchet
5030255021 [SQLiteProfilerStorage] Add a unit test 2011-01-19 07:36:27 +01:00
Victor Berchet
2740e105e1 [Profiler] Fix a typo 2011-01-19 07:33:36 +01:00
Bulat Shakirzyanov
267a7e6956 [HttpKernel] fixed Cache, to respect the variable and trigger error handling 2011-01-19 07:31:27 +01:00
Kris Wallsmith
8d6da86016 [DependencyInjection] moved loading stack from static to object scope 2011-01-19 07:28:42 +01:00
Lukas Kahwe Smith
ddea635a51 fixes else -> } else 2011-01-19 07:20:23 +01:00
Dominique Bongiraud
64fb94c725 normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
Fabien Potencier
c5f2ec8d2d made DIC tags only available during "compilation"
Now that we have a compilation phase for the DIC, using tags after compilation
is not needed anymore.

Tags were introduced to allow several independant bundles to be able to
interact which each others (remember that each extension knows nothing about
the others).

But during the compilation phase, the container has been merged ans so, all
the information from all bundles are available. This is then the right place
to deal with tags. That way, less work is needed at runtime and the DIC class
in the cache is also much smaller.

For simple cases, it means that you need to process the tag in a compiler pass
and store the information you need in a DIC parameter (have a look at the
TranslatorPass for a very simple example).

So, the PHP dumper does not add tags to the dumped PHP class anymore (it does
not implements TaggedContainerInterface anymore). But tags are still available
on ContainerBuilder instances.
2011-01-17 11:40:04 +01:00
Fabien Potencier
be35aa1d6a [HttpKernel] added the possibility to add non-namespaced classes to the compiled class cache 2011-01-16 11:32:14 +01:00
Fabien Potencier
d5c9f37982 [DependencyInjection] added compiler passes as resources 2011-01-16 10:20:10 +01:00
Fabien Potencier
5c64ca8a30 renamed Container::freeze() to Container::compile() 2011-01-16 08:12:36 +01:00
Johannes M. Schmitt
98b52b607c better support for cookie handling, use native PHP function to set cookies 2011-01-15 20:47:29 +01:00
hhamon
e2dc7f47cb [HttpFoundation] use pathinfo() native function to determine file extension. Change File::move() and UploadedFile::move() methods to accept a second argument allowing to move the file with a new name instead of moving it with its original name. 2011-01-15 15:44:50 +01:00
Fabien Potencier
055b6e4d6e made a big refactoring of the templating sub-framework
* better separation of concerns
 * made TwigBundle independant of the PHP Engine from FrameworkBundle (WIP)
 * removed one layer of abstraction in the Templating component (renderers)
 * made it easier to create a new Engine for any templating library
 * made engines lazy-loaded (PHP engine for instance is not started if you only use Twig)
 * reduces memory footprint (if you only use one engine)
 * reduces size of compiled classes.php cache file
2011-01-15 07:43:05 +01:00
Martin Hason
6011073e7c [DependencyInjection] fixed XmlDumper (corrected validity) 2011-01-14 18:16:11 +01:00
Jeremy Bush
4460b49802 Add support for base tag for Link and Form, Fixes #9422 2011-01-14 17:26:24 +01:00
Martin Hason
5ee48c4963 [DependencyInjection] fix XML entities in XmlDumper 2011-01-14 16:56:44 +01:00
Fabien Potencier
1535fa2ad7 [HttpKernel] fixed a unit test 2011-01-14 08:31:58 +01:00
Martin Hason
2a3d94a6d0 [DependencyInjection] added support for anonymous services in XmlDumper 2011-01-14 08:25:18 +01:00
Fabien Potencier
c38c0c303e refactored Templating
* made the renderer argument of Storage ctor mandatory
 * refactored the Engine class to avoid code duplication
 * simplified the check for a template that extends another one but with a different renderer
2011-01-13 11:16:45 +01:00
Fabien Potencier
6dd1d6172f fixed some routing patterns 2011-01-12 07:10:57 +01:00
Victor Berchet
1537c1f2d1 [InterfaceInjector] Fix a typo in the tests 2011-01-11 20:29:17 +01:00
Fabien Potencier
b63de46374 [Routing] moved from :var to {var}
This follows the "URI template" notation:

http://code.google.com/p/uri-templates/
http://tools.ietf.org/html/draft-gregorio-uritemplate-04

You need to change all your route definitions from something like:

    /article/:id

to something like:

    /article/{id}
2011-01-11 19:13:16 +01:00
Martin Hason
f41654fd60 [Console] added rendering previous exceptions 2011-01-11 14:52:32 +01:00
Johannes Schmitt
f1e41a9671 [DependencyInjection] made some improvments to the container compiler
- inline private services which are references multiple times, but where all references originate from the same definition
- bug fix for non-shared services which were considered shared within the scope in which they were inlined
2011-01-09 19:58:51 +01:00
Johannes Schmitt
d1a2a65d19 [DependencyInjection] performance improvement, better analysis tools 2011-01-09 19:58:42 +01:00
Johannes Schmitt
e85546ef7d [DependencyInjection] made some improvments to the container compiler
- added generic repeated pass
- better optimization of services
- started adding some integration tests
2011-01-09 19:58:39 +01:00
umpirsky
bdada47fad [Translation] Added CsvFileLoader to support csv translation resources. 2011-01-08 15:24:01 +01:00
Martin Hason
a11619973b [DependencyInjection] fix xml validation for extension in phar archive 2011-01-07 16:00:28 +01:00
Johannes Schmitt
3785a99b94 adds visibility to aliases 2011-01-07 15:58:48 +01:00
umpirsky
0faf067acb Fixed FileTest::testRename to work for windows file system. 2011-01-07 15:36:05 +01:00
Fabien Potencier
bc2ca8f1cf made PHP renderer optional in Templating 2011-01-07 15:29:56 +01:00
Lukas Kahwe Smith
f2ac2a4c8a changed templating to use setter injection for renderers 2011-01-07 15:08:35 +01:00
Jeremy Mikola
554c86c589 [DependencyInjection] Add hasInterfaceInjectorForClass(), which is helpful for extension loader methods
Additionally, doc blocks were added for the Container's InterfaceInjector methods, and the test case was modified to cover both add() methods
2011-01-07 14:33:06 +01:00
Jordi Boggiano
025f3b1565 Fixed filesystem test failing on windows 2011-01-07 14:31:16 +01:00