Merge branch '2.3'

* 2.3: (33 commits)
  Revert "[Console] ensure exit code between 0-254"
  Added missing galician (gl) translations
  fix many-to-many Propel1 ModelChoiceList
  [Console] ensure exit code between 0-254
  Added Greek translation
  [DomCrawler] Fixed a fatal error when setting a value in a malformed field name.
  [FrameworkBundle] Fixed OutOfBoundException when session handler_id is null
  [DependencyInjection] Add support for aliases of aliases + regression test
  [Console] fix status code when Exception::getCode returns something like 0.1
  Fixed doc block on Filesystem::rename
  Fixed exit code for exceptions with error code 0
  [DependencyInjection] Rename ContainerBuilder::$aliases to avoid conflicting with the parent class
  [DependencyInjection] Remove get*Alias*Service methods from compiled containers
  [DependencyInjection] Fix aliased access of shared services, fixes #8096
  instantiate valid commands only
  bumped Symfony version to -DEV
  updated VERSION for 2.3.0
  updated CHANGELOG for 2.3.0
  [Config] Added tests for the FileResource and DirectoryResource.
  [Config] Fixed @covers annotation which ignored some of the methods from the code coverage.
  ...

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
This commit is contained in:
Fabien Potencier 2013-06-11 09:15:38 +02:00
commit 35bdf823c4
41 changed files with 1296 additions and 487 deletions

View File

@ -1,293 +0,0 @@
CHANGELOG for 2.1.x
===================
This changelog references the relevant changes (bug and security fixes) done
in 2.1 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.1.0...v2.1.1
* 2.1.10 (2013-05-06)
* 5b7e1e6: added a missing check for the provider key
* bcb5400: [Form] Fixed transform()/reverseTransform() to always throw TransformationFailedExceptions
* 7b2ebbf: [Form] Fixed: String validation groups are never interpreted as callbacks
* 0610750: if the repository method returns an array ensure that it's internal poin...
* 2b554d7: remove validation related headers when needed
* 2a531d7: Fix getPort() returning 80 instead of 443 when X-FORWARDED-PROTO is set to https
* 10dea94: [Filesystem] copy() is not working when open_basedir is set
* 8757ad4: [Process] Fix #5594 : `termsig` must be used instead of `stopsig` in exceptions when a process is signaled
* 06e21ff: Filesystem::touch() not working with different owners (utime/atime issue)
* 36d057b: [HttpFoundation][BrowserKit] fixed path when converting a cookie to a string
* 495d0e3: [HttpFoundation] fixed empty domain= in Cookie::__toString()
* c2bc707: fixed detection of secure cookies received over https
* 54bcf5c: [Translator] added additional conversion for encodings other than utf-8
* 8a434ed: fix a DI circular reference recognition bug
* 5abf887: Fix default value handling for multi-value options
* da156d3: fix overwriting of request's locale if attribute _locale is missing
* d552e4c: [HttpFoundation] do not use server variable PATH_INFO because it is already decoded and thus symfony is fragile to double encoding of the path
* 047212a: [Yaml] fixed handling an empty value
* 94a9cdc: [Routing][XML Loader] Add a possibility to set a default value to null
* 0f0c29c: [HttpFoundation] Fixed bug in key searching for NamespacedAttributeBag
* 7fc429f: [Form] DateTimeToRfc3339Transformer use proper transformation exteption in reverse transformation
* 9fcd2f6: [HttpFoundation] fixed the creation of sub-requests under some circumstances for IIS
* a3826ab: #7531: [HttpKernel][Config] FileLocator adds NULL as global resource path
* 9d71ebe: Fix autocompletion of command names when namespaces conflict
* bec8ff1: Fix timeout in Process::stop method
* bf4a9b0: Round stream_select fifth argument up.
* 3780fdb: Fix Process timeout
* 375ded4: [FrameworkBundle] fixed the discovery of the PHPUnit configuration file when using aggregate options like in -vc app/ (closes #7562)
* 673fd9b: idAsIndex should be true with a smallint or bigint id field.
* 64a1d39: Fixed long multibyte parameter logging in DbalLogger:startQuery
* 4cf06c1: Keep the file extension in the temporary copy and test that it exists (closes #7482)
* c4da2d9: [HttpFoundation] getClientIp is fixed.
* 2.1.9 (2013-03-26)
* 9875c4b: Added '@@' escaping strategy for YamlFileLoader and YamlDumper
* bbcdfe2: [Yaml] fixed bugs with folded scalar parsing
* 5afea04: [Form] made DefaultCsrfProvider using session_status() when available
* c928ddc: [HttpFoudantion] fixed Request::getPreferredLanguage()
* e6b7515: [DomCrawler] added support for query string with slash
* 17dc2ff: [HttpRequest] fixes Request::getLanguages() bug
* e51432a: sub-requests are now created with the same class as their parent
* ef53456: [DoctrineBridge] Avoids blob values to be logged by doctrine
* 6575df6: [Security] use current request attributes to generate redirect url?
* 7216cb0: [Validator] fix showing wrong max file size for upload errors
* c423f16: [2.1][TwigBridge] Fixes Issue #7342 in TwigBridge
* 7d87ecd: [FrameworkBundle] fixed cahe:clear command's warmup
* fe4cc24: [TwigBridge] fixed fixed scope & trans_default_domain node visitor
* fc47589: [BrowserKit] added ability to ignored malformed set-cookie header
* 5bc30bb: [Translation] added xliff loader/dumper with resname support
* 7241be9: [Finder] fixed a potential issue on Solaris where INF value is wrong (refs #7269)
* 1d3da29: [FrameworkBundle] avoids cache:clear to break if new/old folders already exist
* b9cdb9a: [HttpKernel] Fixed possible profiler token collision (closes #7272, closes #7171)
* d1f5d25: [FrameworkBundle] Fixes invalid serialized objects in cache
* c82c754: RedisProfilerStorage wrong db-number/index-number selected
* e86fefa: Unset loading[$id] in ContainerBuilder on exception
* 73bead7: [ClassLoader] made DebugClassLoader idempotent
* a4ec677: [DomCrawler] Fix relative path handling in links
* 6681df0: [Console] fixed StringInput binding
* 5b19c89: [Console] fixed unparsed StringInput tokens
* bae83c7: [TwigBridge] fixed trans twig extractor
* 8f8ba38: [DomCrawler] fix handling of schemes by Link::getUri()
* 83382bc: [TwigBridge] fixed the translator extractor that were not trimming the text in trans tags (closes #7056)
* b1ea8e5: Fixed handling absent href attribute in base tag
* 8d9cd42: Routing issue with installation in a sub-directory ref: https://github.com/symfony/symfony/issues/7129
* 0690709: added a DebuClassLoader::findFile() method to make the wrapping less invasive
* 635b1fc: StringInput resets the given options.
* 2.1.8 (2013-02-23)
* b2080c4: [HttpFoundation] Remove Cache-Control when using https download via IE<9 (fixes #6750)
* b7bd630: [Form] Fixed TimeType not to render a "size" attribute in select tags
* 368f62f: Expanded fault-tolerance for unusual cookie dates
* cb03074: [DomCrawler] lowered parsed protocol string (fixes #6986)
* 3e40c17: [HttpKernel] fixed locale management when exiting sub-requests
* 179cd58: [Process] Fix regression introduced in #6620 / 880da01c49a9255f5022ab7e18bca38c18f56370, fixes #7082
* 18b139d: [FrameworkBundle] tweaked reference dumper command (see #7093)
* 0eff68f: Fix REMOTE_ADDR for cached subrequests
* 5e8d844: [Process] Warn user with a useful message when tmpfile() failed
* 42d3c4c: added support for the X-Forwarded-For header (closes #6982, closes #7000)
* 6a9c510: fixed the IP address in HttpCache when calling the backend
* 87f3db7: [EventDispathcer] Fix removeListener
* e0637fa: [DependencyInjection] Add clone for resources which were introduced in 2.1
* bd0ad92: [DependencyInjection] Allow frozen containers to be dumped to graphviz
* 83e9558: Fix 'undefined index' error, when entering scope recursively
* 3615e19: [Security] fixed session creation on login (closes #7011)
* a12744e: Add dot character `.` to legal mime subtype regular expression
* e50d333: [HttpKernel] fixed the creation of the Profiler directory
* ddf4678: [HttpFoundation] fixed the creation of sub-requests under some circumstancies (closes #6923, closes #6936)
* 8ca00c5: [Security] fixed session creation when none is needed (closes #6917)
* 74f2fcf: fixed a circular call (closes #6864)
* 6f71948: [Yaml] fixed wrong merge (indentation default is 4 as of 2.1)
* 4119caf: [DependencyInjection] fixed the creation of synthetic services in ContainerBuilder
* 11aaa2e: Added an error message in the DebugClassLoader when using / instead of \.
* ce38069: [FrameworkBundle] fixed Client::doRequest that must call its parent method (closes #6737)
* 53ccc2c: [Yaml] fixed ignored text when parsing an inlined mapping or sequence (closes #6786)
* ab0385c: [Yaml] fixed #6773
* fea20b7: [Yaml] fixed #6770
* 2.1.7 (2013-01-17)
* e17e232: [Yaml] fixed default value
* 3c87e2e: Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes.
* ba6e315: added a way to enable/disable object support when parsing/dumping
* ac756bf: added a way to enable/disable PHP support when parsing a YAML input via Yaml::parse()
* 785d365: fixes a bug when output/error output contains a % character
* dc2cc6b: [Console] fixed input bug when the value of an option is empty (closes #6649, closes #6689)
* 9257b03: [Profiler] [Redis] Fix sort of profiler rows.
* c7bfce9: Fix version_compare() calls for PHP 5.5.
* 880da01: [Process] In edge cases `getcwd()` can return `false`, then `proc_open()` should get `null` to use default value (the working dir of the current PHP process)
* 34def9f: Handle the deprecation of IntlDateFormatter::setTimeZoneId() in PHP 5.5.
* b33d5bc: removed the .gitattributes files (closes #6605, reverts #5674)
* eb93e66: [Console] Fix style escaping parsing
* 8ca1b80: [Console] Make style formatter matching less greedy to avoid having to escape when not needed
* 55aa012: [Form] Fixed EntityChoiceList when loading objects with negative integer IDs
* 1d362b8: [DependencyInjection] fixed a bug where the strict flag on references were lost (closes #6607)
* 3195122: [HttpFoundation] Check if required shell functions for `FileBinaryMimeTypeGuesser` are not disabled
* dbafc2c: [CssSelector] added css selector with empty string
* 1e2fb64: [DependencyInjection] refactored code to avoid logic duplication
* d786e09: [Console] made Application::getTerminalDimensions() public
* 8f21f89: [2.1] [Console] Added getTerminalDimensions() with fix for osx/freebsd
* 33e9d00: [Form] Deleted references in FormBuilder::getFormConfig() to improve performance
* ba2d035: Restrict Monolog version to be in version <1.3
* 4abd5bf: Restrict Monolog version to be in version `<1.3`. Because of conflict between `HttpKernel/Log/LoggerInterface` and `Psr\Log\LoggerInterface` (PSR-3)
* e0923ae: [DependencyInjection] fixed PhpDumper optimizations when an inlined service depends on the current one indirectly
* cd15390: [DependencyInjection] fixed PhpDumper when an inlined service definition has some properties
* fa6fb6f: [Process] Do not reset stdout/stderr pipes on Interrupted system call
* 73d9cef: [Locale] Adjust `StubIntlDateFormatter` to have new methods added in PHP 5.5
* d601b13: use the right RequestMatcherInterface
* 913b564: [Locale] Fix failing `StubIntlDateFormatter` in PHP 5.5
* 8ae773b: [Form] Fix failing `MonthChoiceList` in PHP 5.5
* c526ad9: [Form] Fixed inheritance of "error_bubbling" in RepeatedType
* 6c5e615: [Form] Fixed DateType when used with the intl extension disabled.
* 10b01c9: [HttpFoundation] fix return types and handling of zero in Response
* 75952af: [HttpFoundation] better fix for non-parseable Expires header date
* 87b6cc2: Fix Expires when the header is -1
* c282a2b: [DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
* 2fc41a1: [Console] fixed unitialized properties (closes #5935)
* a5aeb21: [Process] Prevented test from failing when pcntl extension is not enabled.
* 1d395ad: Revert "[DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option"
* ef6f241: [Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.
* bfccd28: HttpUtils must handle RequestMatcher too
* 05fca6d: use preferred_choices in favor of preferred_query
* 6855cff: add preferred_query option to ModelType
* 8beee64: [Form] Fix for `DateTimeToStringTransformer`
* 2.1.6 (2012-12-21)
* b8e5689: [FrameworkBundle] fixed ESI calls
* ce536cd: [FrameworkBundle] fixed ESI calls
* 2.1.5 (2012-12-20)
* 532cc9a: [FrameworkBundle] added support for URIs as an argument to HttpKernel::render()
* 1f8c501: [FrameworkBundle] restricted the type of controllers that can be executed by InternalController
* 2cd43da: [Process] Allow non-blocking start with PhpProcess
* 8b2c17f: fix double-decoding in the routing system
* 098b593: [Session] Added exception to save method
* ad29df5: [Form] Fixed DateTimeToStringTransformer parsing on PHP < 5.3.8
* 773d818: [FrameworkBundle] Added a check on file mime type for CodeHelper::fileExcerpt()
* f24e3d7: [HttpKernel] Revise MongoDbProfilerStorage::write() return value
* 78c5273: [Session] Document Mongo|MongoClient argument type instead of "object"
* de19a81: [HttpKernel] Support MongoClient and Mongo connection classes
* b28af77: [Session] Support MongoClient and Mongo connection classes
* 20e93bf: [Session] Utilize MongoDB::selectCollection()
* b20c5ca: [Form] Fixed reverse transformation of values in DateTimeToStringTransformer
* d2231d8: [Console] Add support for parsing terminal width/height on localized windows, fixes #5742
* 03b880f: [Form] Fixed treatment of countables and traversables in Form::isEmpty()
* 21a59ca: [Form] Fixed FileType not to throw an exception when bound empty
* eac14b5: Check if key # is defined in $value
* a0e2391: [FrameworkBundle] used the new method for trusted proxies
* d6a402a: [Security] fixed path info encoding (closes #6040, closes #5695)
* 47dfb9c: [HttpFoundation] added some tests for the previous merge and removed dead code (closes #6037)
* 1ab4923: Improved Cache-Control header when no-cache is sent
* 4e909bd: Fix to allow null values in labels array
* 9e46819: Fixed: HeaderBag::parseCacheControl() not parsing quoted zero correctly
* 8bb3208: [Config] Loader::import must return imported data
* ca5d9ac: [DoctrineBridge] Fixed caching in DoctrineType when "choices" or "preferred_choices" is passed
* 6e7e08f: [Form] Fixed the default value of "format" in DateType to DateType::DEFAULT_FORMAT if "widget" is not "single_text"
* 447ff91: [HttpFoundation] changed UploadedFile::move() to use move_uploaded_file() when possible (closes #5878, closes #6185)
* 0489799: [HttpFoundation] added a check for the host header value
* b604eb7: [DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option
* 99321cb: [DoctrineBridge] Fixed: Exception is thrown if the entity class is not known to Doctrine
* 2ed30e7: Fixed DefaultValue for session.auto_start in NodeDefinition
* ae3d531: [TwigBundle] Moved the registration of the app global to the environment
* 2.1.4 (2012-11-29)
* e5536f0: replaced magic strings by proper constants
* 6a3ba52: fixed the logic in Request::isSecure() (if the information comes from a source that we trust, don't check other ones)
* 67e12f3: added a way to configure the X-Forwarded-XXX header names and a way to disable trusting them
* b45873a: fixed algorithm used to determine the trusted client IP
* 254b110: removed the non-standard Client-IP HTTP header
* 06ee53b: [Form] improve error message with a "hasser" hint for PropertyAccessDeniedException
* ac77c5b: [Form] Updated checks for the ICU version from 4.5+ to 4.7+ due to test failures with ICU 4.6
* 2fe04e1: Update src/Symfony/Component/Form/Extension/Core/Type/FileType.php
* bbeff54: Xliff with other node than source or target are ignored
* 29bfa13: small fix of #5984 when the container param is not set
* f211b19: Filesystem Component mirror symlinked directory fix
* 64b54dc: Use better default ports in urlRedirectAction
* e7401a2: Update src/Symfony/Component/DomCrawler/Tests/FormTest.php
* b0e468f: Update src/Symfony/Component/DomCrawler/Form.php
* 1daefa5: [Routing] made it compatible with older PCRE version (pre 8)
* f2cbea3: [Security] remove escape charters from username provided by Digest DigestAuthenticationListener
* 82334d2: Force loader to be null or a EntityLoaderInterface
* 694697d: [Security] Fixed digest authentication
* c067586: [Security] Fixed digest authentication
* d2920c9: Added HttpCache\Store::generateContentDigest() + changed visibility
* e12bd12: [HttpFoundation] Make host & methods really case insensitive in the RequestMacther
* c659e78: Make YamlFileLoader and XmlFileLoader file loading extensible
* 0f75586: [Form] Removed an exception that prevented valid formats from being passed, e.g. "h" for the hour, "L" for the month etc.
* 84b760b: [HttpKernel] fixed Client when using StreamedResponses (closes #5370)
* 67e697f: fixed PDO session handler for Oracle (closes #5829)
* c2a8a0b: [HttpFoundation] fixed PDO session handler for Oracle (closes #5829)
* a30383d: [Locale] removed a check that is done too early (and it is done twice anyways)
* 84635bd: [Form] allowed no type guesser to be registered
* 8377146: Adding new localized strings for farsi validation.
* e34fb41: [HttpFoundation] moved the HTTP protocol check from StreamedResponse to Response (closes #5937)
* 4909bc3: [Form] Fixed forms not to be marked invalid if their children are already marked invalid
* dc80385: [Form] Fixed NumberToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible
* 208e134: [FrameworkBundle] Router skip defaults resolution for arrays
* a0af8bf: [Form] Adapted HTML5 format in DateTimeType as response to a closed ICU ticket
* 6b42c8c: The exception message should say which field is not mapped
* 9872d26: [HttpFoundation] Fix name sanitization after perfoming move
* 2d9a6fc: Use Norm Data instead of Data
* a094f7e: Add check to Store::unlock to ensure file exists
* 2.1.3 (2012-10-30)
* 6f15c47: [ClassLoader] fixed unbracketed namespaces (closes #5747)
* 20898e5: Add to DateFormats 'D M d H:i:s Y T' (closes #5830)
* b844d6b: [Form] Fixed DoctrineOrmTypeGuesser to guess the "required" option for to-one associations
* 965734e: fixed fallback locale
* bda29b3: [Form] Fixed error message in PropertyPath to not advice to use a non-existing feature
* bf3e358: [Form] Fixed creation of multiple money fields with different currencies
* 8f81f07: [Form] Fixed setting the "data" option to an object in "choice" and "entity" type
* 53c43bf: Fixed Serbian plural translations.
* 959c1df: Fixed IPv6 Check in RequestMatcher
* cf1e02d: [Console] Fix error when mode is not in PATH
* 6b66bc3: [2.1] Added missing error return codes in commands
* e0a3fc1: Made the router lazy when setting the context
* 89f7b5e: [HttpFoundation] fixed empty path when using Request::create() (closes #5729)
* 8c6b7a4: Fixed the handling of the intl locale when setting the default locale
* 673f74b: [HttpFoundation] Fixed #5697 - Request::createFromGlobals, Request::getContentType Changed checking CONTENT_TYPE from server to headers variable
* 1566f9f: [Routing] fix handling of whitespace and synch between collection prefix and route pattern
* b439d13: fixed DomCrwaler/Form to handle <button> when submitted
* a4f3ea9: [2.1][DependencyInjection] Incomplete error handling in the container
* 90145d2: [Routing] fix handling of two starting slashes in the pattern
* cf422bf: [Validator] Updated swedish translation
* 132ba25: Update src/Symfony/Component/Validator/Resources/translations/validators.de.xlf
* 6a6b4ae: Updated lithuanian validation translation
* 74d10d6: [DomCrawler] Allows using multiselect through Form::setValues().
* a6ae6f6: [Translation] forced the catalogue to be regenerated when a resource is added (closes symfony/Translation#1)
* 2568432: [Form] Hardened code of ViolationMapper against errors
* 6c59fbd: [HttpFoundation] Fixed #5611 - Request::splitHttpAcceptHeader incorrect result order.
* 2d41229: [Form] Fixed negative index access in PropertyPathBuilder
* ed1cf54: Update src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf
* 47d7531: [2.1] Fix SessionHandlerInterface autoloading
* 1a53b12: [2.0][http-foundation] Fix Response::getDate method
* 3cc3c67: [DoctrineBridge] Require class option for DoctrineType
* 4e3ea22: [HttpFoundation] fixed the path to the SensioHandlerInterface class in composer.json
* 7444cb9: Support the new Microsoft URL Rewrite Module for IIS 7.0
* c120c4d: Added Base64 encoding, decoding to MongoDBProfilerStorage
* 335aa86: Update src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf
* 27b2df9: [Process] Fixed bug introduced by 7bafc69f38a3512eb15aad506959a4e7be162e52.
* d7623ae: [DomCrawler] Added test for supported encodings by mbstring
* c812b9d: [Config] Fixed preserving keys in associative arrays
* c869a65: [Console] Fixed return value for Command::run
* 2ceebdc: fixed stringification of array objects in RequestDataCollector (closes #5295)
* b8a2f8c: [HttpFoundation] removed the username and password from generated URL as generated by the Request class (closes #5555)
* c4429af: [Console] fixed default argument display (closes #5563)
* 2.1.2 (2012-09-20)
* 7bafc69: Add a Sigchild compatibility mode (set to false by default)
* 8dd19d8: fix Fatal error: Cannot access private property
* 3269014: Added Bulgarian translation
* de6658b: [Profiler]Use the abstract method to get client IP
* 2.1.1 (2012-09-11)
* fix Composer configuration

View File

@ -7,6 +7,71 @@ in 2.2 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.2.0...v2.2.1
* 2.2.2 (2013-06-02)
* 2038329: [Form] [Validator] Fixed post_max_size = 0 bug (Issue #8065)
* 169c0b9: [Finder] Fix iteration fails with non-rewindable streams
* 45b68e0: [Finder] Fix unexpected duplicate sub path related AppendIterator issue
* 5321600: Fixed two bugs in HttpCache
* 5c317b7: [Console] fix and refactor exit code handling
* 1469953: [CssSelector] Fix :nth-last-child() translation
* 91b8490: Fix Crawler::children() to not trigger a notice for childless node
* 0a4837d: Fixed XML syntax.
* a5441b2: Fixed parsing of leading blank lines in folded scalars. Closes #7989.
* ef87ba7: [Form] Fixed a method name.
* e8d5d16: Fixed Loader import
* 60edc58: Fixed fatal error in normalize/denormalizeObject.
* 05b987f: [Process] Cleanup tests & prevent assertion that kills randomly Travis-CI
* e4913f8: [Filesystem] Fix regression introduced in 10dea948
* 5b7e1e6: added a missing check for the provider key
* b0e3ea5: [Validator] fixed wrong URL for XSD
* 59b78c7: [Validator] Fixed: $traverse and $deep is passed to the visitor from Validator::validate()
* bcb5400: [Form] Fixed transform()/reverseTransform() to always throw TransformationFailedExceptions
* 7b2ebbf: [Form] Fixed: String validation groups are never interpreted as callbacks
* 0610750: if the repository method returns an array ensure that it's internal poin...
* dcced01: [Form] Improved multi-byte handling of NumberToLocalizedStringTransformer
* 2b554d7: remove validation related headers when needed
* 2a531d7: Fix getPort() returning 80 instead of 443 when X-FORWARDED-PROTO is set to https
* 10dea94: [Filesystem] copy() is not working when open_basedir is set
* 8757ad4: [Process] Fix #5594 : `termsig` must be used instead of `stopsig` in exceptions when a process is signaled
* be34917: [Console] find command even if its name is a namespace too (closes #7860)
* 3c97004: Reset all catalogues when adding resource to fallback locale (#7715, #7819)
* 0fb35a4: Added reloading of fallback catalogues when calling addResource() (#7715)
* 9e49bc8: Re-added context information to log list
* 06e21ff: Filesystem::touch() not working with different owners (utime/atime issue)
* d98118a: [Config] #7644 add tests for passing number looking attributes as strings
* 36d057b: [HttpFoundation][BrowserKit] fixed path when converting a cookie to a string
* 495d0e3: [HttpFoundation] fixed empty domain= in Cookie::__toString()
* c2bc707: fixed detection of secure cookies received over https
* af819a7: [2.2] Pass ESI header to subrequests
* 54bcf5c: [Translator] added additional conversion for encodings other than utf-8
* 67b5797: fixed source messages to accept pluralized messages [Validator][translation][japanese] add messages for new validator
* 8a434ed: fix a DI circular reference recognition bug
* 22bf965: [DependencyInjection] fixed wrong exception class
* 5abf887: Fix default value handling for multi-value options
* da156d3: fix overwriting of request's locale if attribute _locale is missing
* 1adbe3c: [HttpKernel] truncate profiler token to 6 chars (see #7665)
* d552e4c: [HttpFoundation] do not use server variable PATH_INFO because it is already decoded and thus symfony is fragile to double encoding of the path
* 4c51ec7: Fix download over SSL using IE < 8 and binary file response
* 46909fa: [Console] Fix merging of application definition, fixes #7068, replaces #7158
* 972bde7: [HttpKernel] fixed the Kernel when the ClassLoader component is not available (closes #7406)
* f163226: fixed output of bag values
* 047212a: [Yaml] fixed handling an empty value
* 94a9cdc: [Routing][XML Loader] Add a possibility to set a default value to null
* 302d44f: [Console] fixed handling of "0" input on ask
* 383a84b: fixed handling of "0" input on ask
* 0f0c29c: [HttpFoundation] Fixed bug in key searching for NamespacedAttributeBag
* 7fc429f: [Form] DateTimeToRfc3339Transformer use proper transformation exteption in reverse transformation
* 9fcd2f6: [HttpFoundation] fixed the creation of sub-requests under some circumstances for IIS
* 8a9e898: Fix finding ACLs from ObjectIdentity's with different types
* a3826ab: #7531: [HttpKernel][Config] FileLocator adds NULL as global resource path
* 9d71ebe: Fix autocompletion of command names when namespaces conflict
* bec8ff1: Fix timeout in Process::stop method
* 3780fdb: Fix Process timeout
* 99256e4: [HttpKernel] Remove args from 5.3 stack traces to avoid filling log files, fixes #7259
* e8cae94: fix overwriting of request's locale if attribute _locale is missing
* c4da2d9: [HttpFoundation] getClientIp is fixed.
* 2.2.1 (2013-04-06)
* 751abe1: Doctrine cannot handle bare random non-utf8 strings

View File

@ -7,6 +7,25 @@ in 2.3 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.3.0...v2.3.1
* 2.3.0 (2013-06-03)
* e93fc7a: [FrameworkBundle] set the dispatcher in the console application
* 2038329: [Form] [Validator] Fixed post_max_size = 0 bug (Issue #8065)
* 554ab9f: [Console] renamed ConsoleForExceptionEvent into ConsoleExceptionEvent
* fd151fd: [Security] Fixed the check if an interface exists.
* c8e5503: [FrameworkBundle] removed HttpFoundation classes from HttpKernel cache
* 169c0b9: [Finder] Fix iteration fails with non-rewindable streams
* 45b68e0: [Finder] Fix unexpected duplicate sub path related AppendIterator issue
* 13ba4ea: fix logger in regards to DebugLoggerInterface
* 97b38ed: Added type of return value in VoterInterface.
* 79a842a: [Console] Add namespace support back in to list command
* 5321600: Fixed two bugs in HttpCache
* 435012f: [Config] Adding the previous exception message into the FileLoaderLoadException so it's more easily seen
* 5c317b7: [Console] fix and refactor exit code handling
* 1469953: [CssSelector] Fix :nth-last-child() translation
* 2d9027d: [CssSelector] Fix :nth-last-child() translation
* 91b8490: Fix Crawler::children() to not trigger a notice for childless node
* 2.3.0-RC1 (2013-05-16)
* 95f356b: remove check for PHP bug #50731

View File

@ -15,7 +15,7 @@ Symfony2 is the result of the work of many people who made the code better
- Pascal Borreli (pborreli)
- Karma Dordrak (drak)
- Lukas Kahwe Smith (lsmith)
- Ryan Weaver
- Ryan Weaver (weaverryan)
- Joseph Bielawski (stloyd)
- Jeremy Mikola (jmikola)
- Igor Wiedler (igorw)
@ -24,9 +24,9 @@ Symfony2 is the result of the work of many people who made the code better
- Hugo Hamon (hhamon)
- Eriksen Costa (eriksencosta)
- Martin Hasoň (hason)
- Jakub Zalas (jakubzalas)
- Jonathan Wage (jwage)
- William Durand (couac)
- Jakub Zalas (jakubzalas)
- Alexandre Salomé (alexandresalome)
- ornicar
- stealth35 (stealth35)
@ -35,11 +35,11 @@ Symfony2 is the result of the work of many people who made the code better
- Francis Besset (francisbesset)
- Henrik Bjørnskov (henrikbjorn)
- Miha Vrhovnik
- Bilal Amarni (bamarni)
- Romain Neutron (romain)
- Florin Patan (florinpatan)
- Konstantin Kudryashov (everzet)
- Saša Stamenković (umpirsky)
- Florin Patan (florinpatan)
- Bilal Amarni (bamarni)
- Arnaud Le Blanc (arnaud-lb)
- Eric Clemmons (ericclemmons)
- Dariusz Górecki (canni)
@ -50,9 +50,9 @@ Symfony2 is the result of the work of many people who made the code better
- Arnout Boks (aboks)
- Hidenori Goto (hidenorigoto)
- Fran Moreno (franmomu)
- Andrej Hudec (pulzarraider)
- Lee McDermott
- Brandon Turner
- Andrej Hudec (pulzarraider)
- Daniel Holmes (dholmes)
- Brikou Carré (brikou)
- John Wards (johnwards)
@ -99,12 +99,12 @@ Symfony2 is the result of the work of many people who made the code better
- Pablo Godel (pgodel)
- Helmer Aaviksoo
- Clément JOBEILI (dator)
- Hiromi Hishida (77web)
- Julien Brochet (mewt)
- Rafael Dohms (rdohms)
- Benjamin Dulau (dbenjamin)
- Andreas Hucks (meandmymonkey)
- Noel Guilbert (noel)
- Hiromi Hishida (77web)
- Guilherme Blanco (guilhermeblanco)
- Martin Schuhfuß (usefulthink)
- Thomas Rabaix (rande)
@ -122,6 +122,7 @@ Symfony2 is the result of the work of many people who made the code better
- Clemens Tolboom
- Justin Hileman (bobthecow)
- Sven Paulus (subsven)
- Dmitrii Chekaliuk (lazyhammer)
- Xavier Perez
- Rui Marinho (ruimarinho)
- Dorian Villet (gnutix)
@ -141,12 +142,14 @@ Symfony2 is the result of the work of many people who made the code better
- Adrien Brault (adrienbrault)
- jules boussekeyt (gordonslondon)
- Jan Sorgalla (jsor)
- Ait Boudad Abdellatif (aitboudad)
- jdhoek
- geoffrey
- Wodor Wodorski
- Elnur Abdurrakhimov (elnur)
- Matthew Lewinski (lewinski)
- Kim Hemsø Rasmussen
- Wouter De Jong (wouterj)
- Dirk Pahl (dirkaholic)
- Wouter Van Hecke
- Gyula Sallai (salla)
@ -154,6 +157,7 @@ Symfony2 is the result of the work of many people who made the code better
- Yaroslav Kiliba
- Sebastian Bergmann
- arjen
- Matthias Pigulla (mpdude)
- sun (sun)
- Manuel Kiessling (manuelkiessling)
- Sergey Linnik
@ -165,7 +169,6 @@ Symfony2 is the result of the work of many people who made the code better
- Grégoire Passault (gregwar)
- Uwe Jäger (uwej711)
- Aurelijus Valeiša (aurelijus)
- Ait Boudad Abdellatif (aitboudad)
- Gustavo Piltcher
- Stepan Tanasiychuk (stfalcon)
- Albert Jessurum (ajessu)
@ -180,15 +183,15 @@ Symfony2 is the result of the work of many people who made the code better
- Ricard Clau (ricardclau)
- Niklas Fiekas
- Konstantin Myakshin (koc)
- Wouter De Jong (wouterj)
- Erin Millard
- Manuel Reinhard (sprain)
- Francesco Levorato
- Michele Orselli (orso)
- Tom Van Looy (tvlooy)
- Brouznouf
- Peter Kruithof (pkruithof)
- Dmitrii Chekaliuk
- Matthias Pigulla (mpdude)
- Kristen Gilden (kgilden)
- hossein zolfi (ocean)
- Greg Thornton (xdissent)
- Lars Strojny
- Costin Bereveanu (schniper)
@ -210,13 +213,13 @@ Symfony2 is the result of the work of many people who made the code better
- Oscar Cubo Medina (ocubom)
- Karel Souffriau
- Christophe L. (christophelau)
- Thomas Tourlourat (armetiz)
- Michael Ridgway
- Pavel Campr (pcampr)
- janschoenherr
- Emanuele Gaspari (inmarelibero)
- Brian King
- Jan Schumann
- Erin Millard
- Antonio J. García Lagar (ajgarlag)
- Olivier Dolbeau (odolbeau)
- Robert Kiss (kepten)
@ -224,29 +227,32 @@ Symfony2 is the result of the work of many people who made the code better
- Javier López (loalf)
- Chris Heng (gigablah)
- Christoph Mewes (xrstf)
- Vitaliy Tverdokhlib (vitaliytv)
- Jonas Flodén (flojon)
- Shigenibu Nishikawa
- Marcin Sikoń (marphi)
- Miquel Rodríguez Telep (mrtorrent)
- Filippo Tessarotto
- Kristen Gilden (kgilden)
- Adam Harvey
- Laurent Bachelier (laurentb)
- Fabian Lange (codingfabian)
- Yoshio HANAWA
- Tiago Brito (blackmx)
- hossein zolfi (ocean)
- Kevin McBride
- Pablo Díez (pablodip)
- Michael Piecko (michael.piecko)
- Sebastian Krebs
- Manuel de Ruiter (manuel)
- Iker Ibarguren (ikerib)
- Ricardo Oliveira (ricardolotr)
- ondrowan
- Roman Marintsenko (inori)
- Stéphane PY (steph_py)
- mcben
- Christian Flothmann (xabbuh)
- Maks Slesarenko
- Vicent Soria Durá (vicentgodella)
- alexpods
- Erik Trapman (eriktrapman)
- De Cock Xavier (xdecock)
- Matthijs van den Bos
@ -273,7 +279,6 @@ Symfony2 is the result of the work of many people who made the code better
- Zach Badgett (zachbadgett)
- Aurélien Fredouelle
- Karoly Negyesi (chx)
- Thomas Tourlourat (armetiz)
- jamogon
- Miha Vrhovnik
- Geoffrey Tran (geoff)
@ -282,6 +287,7 @@ Symfony2 is the result of the work of many people who made the code better
- Christian Schaefer (caefer)
- Elliot Anderson (elliot)
- Patrick Kaufmann
- Marco Pivetta (ocramius)
- Ben Ramsey (ramsey)
- Christian Jul Jensen
- Chris Jones (leek)
@ -292,6 +298,7 @@ Symfony2 is the result of the work of many people who made the code better
- Ruben Gonzalez (rubenrua)
- Sinan Eldem
- DerManoMann
- alquerci
- Nahuel Cuesta (ncuesta)
- Chris Boden (cboden)
- Roumen Damianoff (roumen)
@ -307,6 +314,7 @@ Symfony2 is the result of the work of many people who made the code better
- Rostyslav Kinash
- jfcixmedia
- Vincent Simonin
- Stefan Warman
- yktd26
- Jakub Kucharovic
- umpirski
@ -354,8 +362,6 @@ Symfony2 is the result of the work of many people who made the code better
- cgonzalez
- matt foster
- Evan S Kaufman (evanskaufman)
- Iker Ibarguren (ikerib)
- Ricardo Oliveira (ricardolotr)
- Jayson Xu (superjavason)
- Jan Prieser
- James Michael DuPont
@ -368,10 +374,12 @@ Symfony2 is the result of the work of many people who made the code better
- Luis Cordova (cordoval)
- Philipp Kräutli (pkraeutli)
- Stefano Sala (stefano.sala)
- Vitaliy Zakharov (zakharovvi)
- frost-nzcr4
- Abhoryo
- Fabian Vogler (fabian)
- Maksim Kotlyar (makasim)
- Tugdual Saunier (tucksaun)
- Neil Ferreira
- Tony Malzhacker
- Cyril Quintin (cyqui)
@ -398,7 +406,6 @@ Symfony2 is the result of the work of many people who made the code better
- Thibault Duplessis
- Marc Abramowitz
- Martijn Evers
- alexpods
- Mathias Rohnstock (drmonty)
- Harry Walter (haswalt)
- Michael Roterman (wtfzdotnet)
@ -444,6 +451,7 @@ Symfony2 is the result of the work of many people who made the code better
- julien.galenski
- Sébastien Lavoie
- Per Sandström (per)
- Lin Clark
- Troy McCabe
- Ville Mattila
- Sescandell (sescandell)
@ -451,7 +459,6 @@ Symfony2 is the result of the work of many people who made the code better
- Max Beutel
- Marcos Quesada (marcos_quesada)
- Dan Finnie
- Vitaliy Tverdokhlib (vitaliytv)
- Martijn Evers
- Benjamin Paap (benjaminpaap)
- Sergii Smertin (nfx)
@ -512,6 +519,8 @@ Symfony2 is the result of the work of many people who made the code better
- George Giannoulopoulos
- Chris Wilkinson (thewilkybarkid)
- Ilya Biryukov
- Jason Desrosiers
- m.chwedziak
- Lance McNearney
- Alberto Pirovano (geezmo)
- Gabor Toth (tgabi333)
@ -519,11 +528,13 @@ Symfony2 is the result of the work of many people who made the code better
- Evan Kaufman
- Romain Geissler
- Marcus Stöhr (dafish)
- Eduardo Oliveira (entering)
- Carsten Nielsen (phreaknerd)
- Jay Severson
- René Kerner
- Adrien Samson (adriensamson)
- Samuel Gordalina (gordalina)
- Timothy Anido (xanido)
- Martin Eckhardt
- Michael Dowling (mtdowling)
- Robert Queck
@ -545,10 +556,10 @@ Symfony2 is the result of the work of many people who made the code better
- Benoit Lévêque (benoit_leveque)
- jskvara
- Mephistofeles
- Hoffmann András
- pscheit
- Ramon Kleiss (akathos)
- Nicolas Badey (nico-b)
- Vitaliy Zakharov (zakharovvi)
- Gunnar Lium
- povilas
- Lars Strojny
@ -586,6 +597,7 @@ Symfony2 is the result of the work of many people who made the code better
- Bob den Otter (bopp)
- Simone Fumagalli (hpatoio)
- Alessio Baglio (ioalessio)
- John Bafford (jbafford)
- Jérôme Macias (jeromemacias)
- Jordi Llonch (jordillonch)
- Cédric Dugat (ph3nol)
@ -613,7 +625,6 @@ Symfony2 is the result of the work of many people who made the code better
- Dan Patrick (mdpatrick)
- Rares Vlaseanu (raresvla)
- tante kinast (tante)
- Tugdual Saunier (tucksaun)
- Alexander Zogheb
- Florian Pfitzer
- Linnik Sergey
@ -669,6 +680,7 @@ Symfony2 is the result of the work of many people who made the code better
- Jimmy Leger (redpanda)
- Baptiste Clavié (talus)
- Yanick Witschi
- ramonornela
- Till Klampaeckel
- srsbiz
- Nicolas A. Bérard-Nault
@ -683,6 +695,7 @@ Symfony2 is the result of the work of many people who made the code better
- Wotre
- goohib
- Xavier HAUSHERR
- Myke79
- Brian Debuire
- Lars Vierbergen
- Sylvain Lorinet
@ -694,6 +707,7 @@ Symfony2 is the result of the work of many people who made the code better
- Johannes
- Jörg Rühl
- patrick-mcdougle
- Giacomo Gallico
- andreabreu98
- Michael Schneider
- Jerome Tamarelle
@ -727,6 +741,7 @@ Symfony2 is the result of the work of many people who made the code better
- parhs
- Oncle Tom
- Xavier Amado
- Andreas Forsblom
- Christian Stocker
- dorkitude
- tirnanog06
@ -762,6 +777,7 @@ Symfony2 is the result of the work of many people who made the code better
- Philipp Hoffmann (philipphoffmann)
- Alex Carol (picard89)
- Daniel Perez Pinazo (pitiflautico)
- Rich Sage (richsage)
- Ruud Kamphuis (ruudk)
- Sarah Khalil (saro0h)
- Sebastian Busch (sebu)
@ -781,6 +797,7 @@ Symfony2 is the result of the work of many people who made the code better
- Michael
- Xavier REN
- max
- Mohamed Karnichi (amiral)
- Muharrem Demirci (mdemirci)
- Evgeny Z (meze)
- Nicolas de Marqué (nicola)
@ -788,4 +805,3 @@ Symfony2 is the result of the work of many people who made the code better
- Erik Saunier (snickers)
- Tony Piper (tonypiper)
- Vladislav Vlastovskiy (vlastv)
- Christian Flothmann (xabbuh)

View File

@ -255,14 +255,14 @@ class ModelChoiceList extends ObjectChoiceList
*/
public function getIndicesForChoices(array $models)
{
$indices = array();
if (!$this->loaded) {
// Optimize performance for single-field identifiers. We already
// know that the IDs are used as indices
// Attention: This optimization does not check choices for existence
if ($this->identifierAsIndex) {
$indices = array();
foreach ($models as $model) {
if ($model instanceof $this->class) {
// Make sure to convert to the right format
@ -276,7 +276,30 @@ class ModelChoiceList extends ObjectChoiceList
$this->load();
}
return parent::getIndicesForChoices($models);
/*
* Overwriting default implementation.
*
* The two objects may represent the same entry in the database,
* but if they originated from different queries, there are not the same object within the code.
*
* This happens when using m:n relations with either sides model as data_class of the form.
* The choicelist will retrieve the list of available related models with a different query, resulting in different objects.
*/
$choices = $this->fixChoices($models);
foreach ($this->getChoices() as $i => $choice) {
foreach ($choices as $j => $givenChoice) {
if ($this->getIdentifierValues($choice) === $this->getIdentifierValues($givenChoice)) {
$indices[] = $i;
unset($choices[$j]);
if (0 === count($choices)) {
break 2;
}
}
}
}
return $indices;
}
/**

View File

@ -185,4 +185,18 @@ class ModelChoiceListTest extends Propel1TestCase
$this->assertEquals(array(1, 2), $choiceList->getValuesForChoices(array($item1, $item2)));
$this->assertEquals(array(1, 2), $choiceList->getIndicesForChoices(array($item1, $item2)));
}
public function testDifferentEqualObjectsAreChoosen()
{
$item = new Item(1, 'Foo');
$choiceList = new ModelChoiceList(
self::ITEM_CLASS,
'value',
array($item)
);
$choosenItem = new Item(1, 'Foo');
$this->assertEquals(array(1), $choiceList->getIndicesForChoices(array($choosenItem)));
}
}

View File

@ -319,7 +319,7 @@ class FrameworkExtension extends Extension
if (null == $config['handler_id']) {
// Set the handler class to be null
$container->getDefinition('session.storage.native')->replaceArgument(1, null);
$container->getDefinition('session.storage.php_bridge')->replaceArgument(1, null);
$container->getDefinition('session.storage.php_bridge')->replaceArgument(0, null);
} else {
$container->setAlias('session.handler', $config['handler_id']);
}

View File

@ -0,0 +1,7 @@
<?php
$container->loadFromExtension('framework', array(
'session' => array(
'handler_id' => null,
),
));

View File

@ -0,0 +1,12 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<framework:config>
<framework:session handler-id="null"/>
</framework:config>
</container>

View File

@ -0,0 +1,3 @@
framework:
session:
handler_id: null

View File

@ -114,6 +114,15 @@ abstract class FrameworkExtensionTest extends TestCase
$this->assertEquals('/path/to/sessions', $container->getParameter('session.save_path'));
}
public function testNullSessionHandler()
{
$container = $this->createContainerFromFile('session');
$this->assertTrue($container->hasDefinition('session'), '->registerSessionConfiguration() loads session.xml');
$this->assertNull($container->getDefinition('session.storage.native')->getArgument(1));
$this->assertNull($container->getDefinition('session.storage.php_bridge')->getArgument(0));
}
public function testTemplating()
{
$container = $this->createContainerFromFile('full');

View File

@ -0,0 +1,138 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Config\Tests;
use Symfony\Component\Config\ConfigCache;
use Symfony\Component\Config\Resource\FileResource;
class ConfigTest extends \PHPUnit_Framework_TestCase
{
private $resourceFile = null;
private $cacheFile = null;
private $metaFile = null;
public function setUp()
{
$this->resourceFile = tempnam(sys_get_temp_dir(), '_resource');
$this->cacheFile = tempnam(sys_get_temp_dir(), 'config_');
$this->metaFile = $this->cacheFile.'.meta';
$this->makeCacheFresh();
$this->generateMetaFile();
}
public function tearDown()
{
$files = array($this->cacheFile, $this->metaFile, $this->resourceFile);
foreach ($files as $file) {
if (file_exists($file)) {
unlink($file);
}
}
}
public function testToString()
{
$cache = new ConfigCache($this->cacheFile, true);
$this->assertSame($this->cacheFile, (string) $cache);
}
public function testCacheIsNotFreshIfFileDoesNotExist()
{
unlink($this->cacheFile);
$cache = new ConfigCache($this->cacheFile, false);
$this->assertFalse($cache->isFresh());
}
public function testCacheIsAlwaysFreshIfFileExistsWithDebugDisabled()
{
$this->makeCacheStale();
$cache = new ConfigCache($this->cacheFile, false);
$this->assertTrue($cache->isFresh());
}
public function testCacheIsNotFreshWithoutMetaFile()
{
unlink($this->metaFile);
$cache = new ConfigCache($this->cacheFile, true);
$this->assertFalse($cache->isFresh());
}
public function testCacheIsFreshIfResourceIsFresh()
{
$cache = new ConfigCache($this->cacheFile, true);
$this->assertTrue($cache->isFresh());
}
public function testCacheIsNotFreshIfOneOfTheResourcesIsNotFresh()
{
$this->makeCacheStale();
$cache = new ConfigCache($this->cacheFile, true);
$this->assertFalse($cache->isFresh());
}
public function testWriteDumpsFile()
{
unlink($this->cacheFile);
unlink($this->metaFile);
$cache = new ConfigCache($this->cacheFile, false);
$cache->write('FOOBAR');
$this->assertFileExists($this->cacheFile, 'Cache file is created');
$this->assertSame('FOOBAR', file_get_contents($this->cacheFile));
$this->assertFileNotExists($this->metaFile, 'Meta file is not created');
}
public function testWriteDumpsMetaFileWithDebugEnabled()
{
unlink($this->cacheFile);
unlink($this->metaFile);
$metadata = array(new FileResource($this->resourceFile));
$cache = new ConfigCache($this->cacheFile, true);
$cache->write('FOOBAR', $metadata);
$this->assertFileExists($this->cacheFile, 'Cache file is created');
$this->assertFileExists($this->metaFile, 'Meta file is created');
$this->assertSame(serialize($metadata), file_get_contents($this->metaFile));
}
private function makeCacheFresh()
{
touch($this->resourceFile, filemtime($this->cacheFile) - 3600);
}
private function makeCacheStale()
{
touch($this->cacheFile, time() - 3600);
}
private function generateMetaFile()
{
file_put_contents($this->metaFile, serialize(array(new FileResource($this->resourceFile))));
}
}

View File

@ -18,7 +18,7 @@ use Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceExceptio
class FileLoaderTest extends \PHPUnit_Framework_TestCase
{
/**
* @covers Symfony\Component\Config\Loader\FileLoader::import
* @covers Symfony\Component\Config\Loader\FileLoader
*/
public function testImport()
{

View File

@ -50,13 +50,11 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
rmdir($directory);
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::getResource
*/
public function testGetResource()
{
$resource = new DirectoryResource($this->directory);
$this->assertEquals($this->directory, $resource->getResource(), '->getResource() returns the path to the resource');
$this->assertSame($this->directory, $resource->getResource(), '->getResource() returns the path to the resource');
$this->assertSame($this->directory, (string) $resource, '->__toString() returns the path to the resource');
}
public function testGetPattern()
@ -65,9 +63,6 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('bar', $resource->getPattern());
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh
*/
public function testIsFresh()
{
$resource = new DirectoryResource($this->directory);
@ -78,9 +73,6 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the resource does not exist');
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh
*/
public function testIsFreshUpdateFile()
{
$resource = new DirectoryResource($this->directory);
@ -88,9 +80,6 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if an existing file is modified');
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh
*/
public function testIsFreshNewFile()
{
$resource = new DirectoryResource($this->directory);
@ -98,9 +87,6 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if a new file is added');
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh
*/
public function testIsFreshDeleteFile()
{
$resource = new DirectoryResource($this->directory);
@ -108,9 +94,6 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if an existing file is removed');
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh
*/
public function testIsFreshDeleteDirectory()
{
$resource = new DirectoryResource($this->directory);
@ -118,9 +101,6 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the whole resource is removed');
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh
*/
public function testIsFreshCreateFileInSubdirectory()
{
$subdirectory = $this->directory.'/subdirectory';
@ -133,9 +113,6 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if a new file in a subdirectory is added');
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh
*/
public function testIsFreshModifySubdirectory()
{
$resource = new DirectoryResource($this->directory);
@ -147,9 +124,6 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if a subdirectory is modified (e.g. a file gets deleted)');
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh
*/
public function testFilterRegexListNoMatch()
{
$resource = new DirectoryResource($this->directory, '/\.(foo|xml)$/');
@ -158,9 +132,6 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($resource->isFresh(time() + 10), '->isFresh() returns true if a new file not matching the filter regex is created');
}
/**
* @covers Symfony\Component\Config\Resource\DirectoryResource::isFresh
*/
public function testFilterRegexListMatch()
{
$resource = new DirectoryResource($this->directory, '/\.(foo|xml)$/');
@ -168,4 +139,14 @@ class DirectoryResourceTest extends \PHPUnit_Framework_TestCase
touch($this->directory.'/new.xml', time() + 20);
$this->assertFalse($resource->isFresh(time() + 10), '->isFresh() returns false if an new file matching the filter regex is created ');
}
public function testSerializeUnserialize()
{
$resource = new DirectoryResource($this->directory, '/\.(foo|xml)$/');
$unserialized = unserialize(serialize($resource));
$this->assertSame($this->directory, $resource->getResource());
$this->assertSame('/\.(foo|xml)$/', $resource->getPattern());
}
}

View File

@ -30,17 +30,16 @@ class FileResourceTest extends \PHPUnit_Framework_TestCase
unlink($this->file);
}
/**
* @covers Symfony\Component\Config\Resource\FileResource::getResource
*/
public function testGetResource()
{
$this->assertEquals(realpath($this->file), $this->resource->getResource(), '->getResource() returns the path to the resource');
$this->assertSame(realpath($this->file), $this->resource->getResource(), '->getResource() returns the path to the resource');
}
public function testToString()
{
$this->assertSame(realpath($this->file), (string) $this->resource);
}
/**
* @covers Symfony\Component\Config\Resource\FileResource::isFresh
*/
public function testIsFresh()
{
$this->assertTrue($this->resource->isFresh(time() + 10), '->isFresh() returns true if the resource has not changed');
@ -49,4 +48,11 @@ class FileResourceTest extends \PHPUnit_Framework_TestCase
$resource = new FileResource('/____foo/foobar'.rand(1, 999999));
$this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if the resource does not exist');
}
public function testSerializeUnserialize()
{
$unserialized = unserialize(serialize($this->resource));
$this->assertSame($this->file, $this->resource->getResource());
}
}

View File

@ -129,9 +129,16 @@ class Application
} else {
$this->renderException($e, $output);
}
$exitCode = $e->getCode();
$exitCode = $exitCode ? (is_numeric($exitCode) ? (int) $exitCode : 1) : 0;
$exitCode = $e->getCode();
if (is_numeric($exitCode)) {
$exitCode = (int) $exitCode;
if (0 === $exitCode) {
$exitCode = 1;
}
} else {
$exitCode = 1;
}
}
if ($this->autoExit) {

View File

@ -573,6 +573,21 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertSame(4, $exitCode, '->run() returns integer exit code extracted from raised exception');
}
public function testRunReturnsExitCodeOneForExceptionCodeZero()
{
$exception = new \Exception('', 0);
$application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
$application->setAutoExit(false);
$application->expects($this->once())
->method('doRun')
->will($this->throwException($exception));
$exitCode = $application->run(new ArrayInput(array()), new NullOutput());
$this->assertSame(1, $exitCode, '->run() returns exit code 1 when exception code is 0');
}
/**
* @expectedException \LogicException
* @dataProvider getAddingAlreadySetDefinitionElementData

View File

@ -69,6 +69,7 @@ class Container implements IntrospectableContainerInterface
protected $services;
protected $methodMap;
protected $aliases;
protected $scopes;
protected $scopeChildren;
protected $scopedServices;
@ -253,6 +254,12 @@ class Container implements IntrospectableContainerInterface
{
$id = strtolower($id);
// resolve aliases
if (isset($this->aliases[$id])) {
$id = $this->aliases[$id];
}
// re-use shared service instance if it exists
if (array_key_exists($id, $this->services)) {
return $this->services[$id];
}
@ -264,6 +271,7 @@ class Container implements IntrospectableContainerInterface
if (isset($this->methodMap[$id])) {
$method = $this->methodMap[$id];
} elseif (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')) {
// $method is set to the right value, proceed
} else {
if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
if (!$id) {

View File

@ -57,7 +57,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
/**
* @var Alias[]
*/
private $aliases = array();
private $aliasDefinitions = array();
/**
* @var ResourceInterface[]
@ -404,7 +404,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
$this->obsoleteDefinitions[$id] = $this->definitions[$id];
}
unset($this->definitions[$id], $this->aliases[$id]);
unset($this->definitions[$id], $this->aliasDefinitions[$id]);
parent::set($id, $service, $scope);
@ -438,7 +438,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
{
$id = strtolower($id);
return isset($this->definitions[$id]) || isset($this->aliases[$id]) || parent::has($id);
return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
}
/**
@ -475,8 +475,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
throw new LogicException(sprintf('The service "%s" has a circular reference to itself.', $id), 0, $e);
}
if (!$this->hasDefinition($id) && isset($this->aliases[$id])) {
return $this->get($this->aliases[$id]);
if (!$this->hasDefinition($id) && isset($this->aliasDefinitions[$id])) {
return $this->get($this->aliasDefinitions[$id]);
}
try {
@ -640,7 +640,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
public function getServiceIds()
{
return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliases), parent::getServiceIds()));
return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds()));
}
/**
@ -666,7 +666,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
public function setAliases(array $aliases)
{
$this->aliases = array();
$this->aliasDefinitions = array();
$this->addAliases($aliases);
}
@ -697,7 +697,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
unset($this->definitions[$alias]);
$this->aliases[$alias] = $id;
$this->aliasDefinitions[$alias] = $id;
}
/**
@ -709,7 +709,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
public function removeAlias($alias)
{
unset($this->aliases[strtolower($alias)]);
unset($this->aliasDefinitions[strtolower($alias)]);
}
/**
@ -723,7 +723,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
public function hasAlias($id)
{
return isset($this->aliases[strtolower($id)]);
return isset($this->aliasDefinitions[strtolower($id)]);
}
/**
@ -735,7 +735,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
public function getAliases()
{
return $this->aliases;
return $this->aliasDefinitions;
}
/**
@ -757,7 +757,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
throw new InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $id));
}
return $this->aliases[$id];
return $this->aliasDefinitions[$id];
}
/**
@ -837,7 +837,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
$id = strtolower($id);
unset($this->aliases[$id]);
unset($this->aliasDefinitions[$id]);
return $this->definitions[$id] = $definition;
}

View File

@ -594,39 +594,6 @@ EOF;
return $code;
}
/**
* Adds a service alias.
*
* @param string $alias
* @param string $id
*
* @return string
*/
private function addServiceAlias($alias, $id)
{
$name = Container::camelize($alias);
$type = 'Object';
if ($this->container->hasDefinition($id)) {
$class = $this->container->getDefinition($id)->getClass();
$type = 0 === strpos($class, '%') ? 'Object' : $class;
}
return <<<EOF
/**
* Gets the $alias service alias.
*
* @return $type An instance of the $id service
*/
protected function get{$name}Service()
{
return {$this->getServiceCall($id)};
}
EOF;
}
/**
* Adds multiple services
*
@ -634,7 +601,7 @@ EOF;
*/
private function addServices()
{
$publicServices = $privateServices = $aliasServices = $synchronizers = '';
$publicServices = $privateServices = $synchronizers = '';
$definitions = $this->container->getDefinitions();
ksort($definitions);
foreach ($definitions as $id => $definition) {
@ -647,13 +614,7 @@ EOF;
$synchronizers .= $this->addServiceSynchronizer($id, $definition);
}
$aliases = $this->container->getAliases();
ksort($aliases);
foreach ($aliases as $alias => $id) {
$aliasServices .= $this->addServiceAlias($alias, $id);
}
return $publicServices.$aliasServices.$synchronizers.$privateServices;
return $publicServices.$synchronizers.$privateServices;
}
/**
@ -799,6 +760,9 @@ EOF;
$code .= " \$this->scopeChildren = ".$this->dumpValue($this->container->getScopeChildren()).";\n";
}
$code .= $this->addMethodMap();
$code .= $this->addAliases();
$code .= <<<EOF
}
@ -846,19 +810,8 @@ EOF;
$code .= " \$this->scopeChildren = array();\n";
}
// build method map
$code .= " \$this->methodMap = array(\n";
$definitions = $this->container->getDefinitions();
ksort($definitions);
foreach ($definitions as $id => $definition) {
$code .= ' '.var_export($id, true).' => '.var_export('get'.Container::camelize($id).'Service', true).",\n";
}
$aliases = $this->container->getAliases();
ksort($aliases);
foreach ($aliases as $alias => $id) {
$code .= ' '.var_export($alias, true).' => '.var_export('get'.Container::camelize($id).'Service', true).",\n";
}
$code .= " );\n";
$code .= $this->addMethodMap();
$code .= $this->addAliases();
$code .= <<<EOF
}
@ -868,6 +821,50 @@ EOF;
return $code;
}
/**
* Adds the methodMap property definition
*
* @return string
*/
private function addMethodMap()
{
if (!$definitions = $this->container->getDefinitions()) {
return '';
}
$code = " \$this->methodMap = array(\n";
ksort($definitions);
foreach ($definitions as $id => $definition) {
$code .= ' '.var_export($id, true).' => '.var_export('get'.Container::camelize($id).'Service', true).",\n";
}
return $code . " );\n";
}
/**
* Adds the aliases property definition
*
* @return string
*/
private function addAliases()
{
if (!$aliases = $this->container->getAliases()) {
return '';
}
$code = " \$this->aliases = array(\n";
ksort($aliases);
foreach ($aliases as $alias => $id) {
$id = (string) $id;
while (isset($aliases[$id])) {
$id = (string) $aliases[$id];
}
$code .= ' '.var_export($alias, true).' => '.var_export($id, true).",\n";
}
return $code . " );\n";
}
/**
* Adds default parameters method.
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
/**
@ -182,10 +183,10 @@ class XmlDumper extends Dumper
* Adds a service alias.
*
* @param string $alias
* @param string $id
* @param Alias $id
* @param \DOMElement $parent
*/
private function addServiceAlias($alias, $id, \DOMElement $parent)
private function addServiceAlias($alias, Alias $id, \DOMElement $parent)
{
$service = $this->document->createElement('service');
$service->setAttribute('id', $alias);
@ -213,7 +214,11 @@ class XmlDumper extends Dumper
$this->addService($definition, $id, $services);
}
foreach ($this->container->getAliases() as $alias => $id) {
$aliases = $this->container->getAliases();
foreach ($aliases as $alias => $id) {
while (isset($aliases[(string) $id])) {
$id = $aliases[(string) $id];
}
$this->addServiceAlias($alias, $id, $services);
}
$parent->appendChild($services);

View File

@ -182,7 +182,11 @@ class YamlDumper extends Dumper
$code .= $this->addService($id, $definition);
}
foreach ($this->container->getAliases() as $alias => $id) {
$aliases = $this->container->getAliases();
foreach ($aliases as $alias => $id) {
while (isset($aliases[(string) $id])) {
$id = $aliases[(string) $id];
}
$code .= $this->addServiceAlias($alias, $id);
}

View File

@ -120,6 +120,20 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase
}
}
public function testAliases()
{
$container = include self::$fixturesPath.'/containers/container9.php';
$container->compile();
$dumper = new PhpDumper($container);
eval('?>'.$dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Aliases')));
$container = new \Symfony_DI_PhpDumper_Test_Aliases();
$container->set('foo', $foo = new \stdClass);
$this->assertSame($foo, $container->get('foo'));
$this->assertSame($foo, $container->get('alias_for_foo'));
$this->assertSame($foo, $container->get('alias_for_alias'));
}
public function testOverrideServiceWhenUsingADumpedContainer()
{
require_once self::$fixturesPath.'/php/services9.php';

View File

@ -43,6 +43,7 @@ $container->getParameterBag()->add(array(
'foo' => 'bar',
));
$container->setAlias('alias_for_foo', 'foo');
$container->setAlias('alias_for_alias', 'alias_for_foo');
$container->
register('method_call1', 'FooClass')->
setFile(realpath(__DIR__.'/../includes/foo.php'))->

View File

@ -24,6 +24,23 @@ class ProjectServiceContainer extends Container
public function __construct()
{
parent::__construct(new ParameterBag($this->getDefaultParameters()));
$this->methodMap = array(
'bar' => 'getBarService',
'baz' => 'getBazService',
'depends_on_request' => 'getDependsOnRequestService',
'factory_service' => 'getFactoryServiceService',
'foo' => 'getFooService',
'foo.baz' => 'getFoo_BazService',
'foo_bar' => 'getFooBarService',
'foo_with_inline' => 'getFooWithInlineService',
'inlined' => 'getInlinedService',
'method_call1' => 'getMethodCall1Service',
'request' => 'getRequestService',
);
$this->aliases = array(
'alias_for_alias' => 'foo',
'alias_for_foo' => 'foo',
);
}
/**
@ -198,16 +215,6 @@ class ProjectServiceContainer extends Container
throw new RuntimeException('You have requested a synthetic service ("request"). The DIC does not know how to construct this service.');
}
/**
* Gets the alias_for_foo service alias.
*
* @return FooClass An instance of the foo service
*/
protected function getAliasForFooService()
{
return $this->get('foo');
}
/**
* Updates the 'request' service.
*/

View File

@ -44,7 +44,10 @@ class ProjectServiceContainer extends Container
'foo_with_inline' => 'getFooWithInlineService',
'method_call1' => 'getMethodCall1Service',
'request' => 'getRequestService',
'alias_for_foo' => 'getFooService',
);
$this->aliases = array(
'alias_for_alias' => 'foo',
'alias_for_foo' => 'foo',
);
}
@ -217,16 +220,6 @@ class ProjectServiceContainer extends Container
throw new RuntimeException('You have requested a synthetic service ("request"). The DIC does not know how to construct this service.');
}
/**
* Gets the alias_for_foo service alias.
*
* @return FooClass An instance of the foo service
*/
protected function getAliasForFooService()
{
return $this->get('foo');
}
/**
* Updates the 'request' service.
*/

View File

@ -74,5 +74,6 @@
</call>
</service>
<service id="alias_for_foo" alias="foo"/>
<service id="alias_for_alias" alias="foo"/>
</services>
</container>

View File

@ -69,3 +69,4 @@ services:
- [setRequest, ['@?request']]
alias_for_foo: @foo
alias_for_alias: @foo

View File

@ -204,8 +204,12 @@ class FormFieldRegistry
{
if (preg_match('/^(?P<base>[^[]+)(?P<extra>(\[.*)|$)/', $name, $m)) {
$segments = array($m['base']);
while (preg_match('/^\[(?P<segment>.*?)\](?P<extra>.*)$/', $m['extra'], $m)) {
$segments[] = $m['segment'];
while (!empty($m['extra'])) {
if (preg_match('/^\[(?P<segment>.*?)\](?P<extra>.*)$/', $m['extra'], $m)) {
$segments[] = $m['segment'];
} else {
throw new \InvalidArgumentException(sprintf('Malformed field path "%s"', $name));
}
}
return $segments;

View File

@ -292,6 +292,18 @@ class FormTest extends \PHPUnit_Framework_TestCase
}
}
public function testSetValueOnMultiValuedFieldsWithMalformedName()
{
$form = $this->createForm('<form><input type="text" name="foo[bar]" value="bar" /><input type="text" name="foo[baz]" value="baz" /><input type="submit" /></form>');
try {
$form['foo[bar'] = 'bar';
$this->fail('->offsetSet() throws an \InvalidArgumentException exception if the name is malformed.');
} catch (\InvalidArgumentException $e) {
$this->assertTrue(true, '->offsetSet() throws an \InvalidArgumentException exception if the name is malformed.');
}
}
public function testOffsetUnset()
{
$form = $this->createForm('<form><input type="text" name="foo" value="foo" /><input type="submit" /></form>');

View File

@ -234,13 +234,13 @@ class Filesystem
}
/**
* Renames a file.
* Renames a file or a directory.
*
* @param string $origin The origin filename
* @param string $target The new filename
* @param string $origin The origin filename or directory
* @param string $target The new filename or directory
* @param Boolean $overwrite Whether to overwrite the target if it already exists
*
* @throws IOException When target file already exists
* @throws IOException When target file or directory already exists
* @throws IOException When origin cannot be renamed
*/
public function rename($origin, $target, $overwrite = false)

View File

@ -189,7 +189,7 @@ abstract class Bundle extends ContainerAware implements BundleInterface
$ns .= '\\'.strtr($relativePath, '/', '\\');
}
$r = new \ReflectionClass($ns.'\\'.$file->getBasename('.php'));
if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract()) {
if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) {
$application->add($r->newInstance());
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command;
use Symfony\Component\Console\Command\Command;
/**
* This command has a required parameter on the constructor and will be ignored by the default Bundle implementation.
*
* @see Symfony\Component\HttpKernel\Bundle\Bundle::registerCommands
*/
class BarCommand extends Command
{
public function __construct($example, $name = 'bar')
{
}
}

View File

@ -49,7 +49,7 @@ class AnonymousAuthenticationListener implements ListenerInterface
$this->context->setToken(new AnonymousToken($this->key, 'anon.', array()));
if (null !== $this->logger) {
$this->logger->info(sprintf('Populated SecurityContext with an anonymous Token'));
$this->logger->info('Populated SecurityContext with an anonymous Token');
}
}
}

View File

@ -59,4 +59,21 @@ class AnonymousAuthenticationListenerTest extends \PHPUnit_Framework_TestCase
$listener = new AnonymousAuthenticationListener($context, 'TheKey');
$listener->handle($this->getMock('Symfony\Component\HttpKernel\Event\GetResponseEvent', array(), array(), '', false));
}
public function testHandledEventIsLogged()
{
if (!interface_exists('Psr\Log\LoggerInterface')) {
$this->markTestSkipped('The "LoggerInterface" is not available');
}
$context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger->expects($this->once())
->method('info')
->with('Populated SecurityContext with an anonymous Token')
;
$listener = new AnonymousAuthenticationListener($context, 'TheKey', $logger);
$listener->handle($this->getMock('Symfony\Component\HttpKernel\Event\GetResponseEvent', array(), array(), '', false));
}
}

View File

@ -195,4 +195,18 @@ class BasicAuthenticationListenerTest extends \PHPUnit_Framework_TestCase
$listener->handle($event);
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage $providerKey must not be empty
*/
public function testItRequiresProviderKey()
{
new BasicAuthenticationListener(
$this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'),
$this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'),
'',
$this->getMock('Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface')
);
}
}

View File

@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Security\Http\Firewall\ContextListener;
@ -48,6 +49,32 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase
unset($this->securityContext);
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage $contextKey must not be empty
*/
public function testItRequiresContextKey()
{
new ContextListener(
$this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'),
array(),
''
);
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage User provider "stdClass" must implement "Symfony\Component\Security\Core\User\UserProviderInterface
*/
public function testUserProvidersNeedToImplementAnInterface()
{
new ContextListener(
$this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'),
array(new \stdClass()),
'key123'
);
}
public function testOnKernelResponseWillAddSession()
{
$session = $this->runSessionOnKernelResponse(
@ -131,9 +158,7 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
$request = $this->getMock('Symfony\Component\HttpFoundation\Request');
$session = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Session')
->disableOriginalConstructor()
->getMock();
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface');
$event->expects($this->any())
->method('getRequest')
@ -147,7 +172,7 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase
$session->expects($this->any())
->method('get')
->with('_security_key123')
->will($this->returnValue(serialize($token)));
->will($this->returnValue($token));
$context->expects($this->once())
->method('setToken')
->with(null);
@ -159,11 +184,53 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase
public function provideInvalidToken()
{
return array(
array(new \__PHP_Incomplete_Class()),
array(null),
array(serialize(new \__PHP_Incomplete_Class())),
array(serialize(null)),
array(null)
);
}
public function testHandleAddsKernelResponseListener()
{
$context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$event = $this->getMockBuilder('Symfony\Component\HttpKernel\Event\GetResponseEvent')
->disableOriginalConstructor()
->getMock();
$listener = new ContextListener($context, array(), 'key123', null, $dispatcher);
$event->expects($this->any())
->method('getRequestType')
->will($this->returnValue(HttpKernelInterface::MASTER_REQUEST));
$event->expects($this->any())
->method('getRequest')
->will($this->returnValue($this->getMock('Symfony\Component\HttpFoundation\Request')));
$dispatcher->expects($this->once())
->method('addListener')
->with(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'));
$listener->handle($event);
}
public function testHandleRemovesTokenIfNoPreviousSessionWasFound()
{
$request = $this->getMock('Symfony\Component\HttpFoundation\Request');
$request->expects($this->any())->method('hasPreviousSession')->will($this->returnValue(false));
$event = $this->getMockBuilder('Symfony\Component\HttpKernel\Event\GetResponseEvent')
->disableOriginalConstructor()
->getMock();
$event->expects($this->any())->method('getRequest')->will($this->returnValue($request));
$context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
$context->expects($this->once())->method('setToken')->with(null);
$listener = new ContextListener($context, array(), 'key123');
$listener->handle($event);
}
protected function runSessionOnKernelResponse($newToken, $original = null)
{
$session = new Session(new MockArraySessionStorage());
@ -189,4 +256,5 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase
$listener->onKernelResponse($event);
return $session;
}}
}
}

View File

@ -0,0 +1,175 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Tests\Http\Firewall;
use Symfony\Component\Security\Http\Firewall\SwitchUserListener;
class SwitchUserListenerTest extends \PHPUnit_Framework_TestCase
{
private $securityContext;
private $userProvider;
private $userChecker;
private $accessDecisionManager;
private $request;
private $event;
protected function setUp()
{
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) {
$this->markTestSkipped('The "HttpKernel" component is not available');
}
$this->securityContext = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
$this->userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
$this->userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface');
$this->accessDecisionManager = $this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface');
$this->request = $this->getMock('Symfony\Component\HttpFoundation\Request');
$this->request->server = $this->getMock('Symfony\Component\HttpFoundation\ServerBag');
$this->event = $this->getEvent($this->request);
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage $providerKey must not be empty
*/
public function testProviderKeyIsRequired()
{
new SwitchUserListener($this->securityContext, $this->userProvider, $this->userChecker, '', $this->accessDecisionManager);
}
public function testEventIsIgnoredIfUsernameIsNotPassedWithTheRequest()
{
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue(null));
$this->event->expects($this->never())->method('setResopnse');
$this->securityContext->expects($this->never())->method('setToken');
$listener = new SwitchUserListener($this->securityContext, $this->userProvider, $this->userChecker, 'provider123', $this->accessDecisionManager);
$listener->handle($this->event);
}
/**
* @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException
*/
public function testExitUserThrowsAuthenticationExceptionIfOriginalTokenCannotBeFound()
{
$token = $this->getToken(array($this->getMock('Symfony\Component\Security\Core\Role\RoleInterface')));
$this->securityContext->expects($this->any())->method('getToken')->will($this->returnValue($token));
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue('_exit'));
$listener = new SwitchUserListener($this->securityContext, $this->userProvider, $this->userChecker, 'provider123', $this->accessDecisionManager);
$listener->handle($this->event);
}
public function testExitUserUpdatesToken()
{
$originalToken = $this->getToken();
$role = $this->getMockBuilder('Symfony\Component\Security\Core\Role\SwitchUserRole')
->disableOriginalConstructor()
->getMock();
$role->expects($this->any())->method('getSource')->will($this->returnValue($originalToken));
$this->securityContext->expects($this->any())
->method('getToken')
->will($this->returnValue($this->getToken(array($role))));
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue('_exit'));
$this->request->expects($this->any())->method('getUri')->will($this->returnValue('/'));
$this->request->server->expects($this->once())->method('set')->with('QUERY_STRING', '');
$this->securityContext->expects($this->once())
->method('setToken')->with($originalToken);
$this->event->expects($this->once())
->method('setResponse')->with($this->isInstanceOf('Symfony\Component\HttpFoundation\RedirectResponse'));
$listener = new SwitchUserListener($this->securityContext, $this->userProvider, $this->userChecker, 'provider123', $this->accessDecisionManager);
$listener->handle($this->event);
}
/**
* @expectedException \Symfony\Component\Security\Core\Exception\AccessDeniedException
*/
public function testSwitchUserIsDissallowed()
{
$token = $this->getToken(array($this->getMock('Symfony\Component\Security\Core\Role\RoleInterface')));
$this->securityContext->expects($this->any())->method('getToken')->will($this->returnValue($token));
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue('kuba'));
$this->accessDecisionManager->expects($this->once())
->method('decide')->with($token, array('ROLE_ALLOWED_TO_SWITCH'))
->will($this->returnValue(false));
$listener = new SwitchUserListener($this->securityContext, $this->userProvider, $this->userChecker, 'provider123', $this->accessDecisionManager);
$listener->handle($this->event);
}
public function testSwitchUser()
{
$token = $this->getToken(array($this->getMock('Symfony\Component\Security\Core\Role\RoleInterface')));
$user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$user->expects($this->any())->method('getRoles')->will($this->returnValue(array()));
$this->securityContext->expects($this->any())->method('getToken')->will($this->returnValue($token));
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue('kuba'));
$this->request->expects($this->any())->method('getUri')->will($this->returnValue('/'));
$this->request->server->expects($this->once())->method('set')->with('QUERY_STRING', '');
$this->accessDecisionManager->expects($this->once())
->method('decide')->with($token, array('ROLE_ALLOWED_TO_SWITCH'))
->will($this->returnValue(true));
$this->userProvider->expects($this->once())
->method('loadUserByUsername')->with('kuba')
->will($this->returnValue($user));
$this->userChecker->expects($this->once())
->method('checkPostAuth')->with($user);
$this->securityContext->expects($this->once())
->method('setToken')->with($this->isInstanceOf('Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken'));
$listener = new SwitchUserListener($this->securityContext, $this->userProvider, $this->userChecker, 'provider123', $this->accessDecisionManager);
$listener->handle($this->event);
}
private function getEvent($request)
{
$event = $this->getMockBuilder('Symfony\Component\HttpKernel\Event\GetResponseEvent')
->disableOriginalConstructor()
->getMock();
$event->expects($this->any())
->method('getRequest')
->will($this->returnValue($request));
return $event;
}
private function getToken(array $roles = array())
{
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
$token->expects($this->any())
->method('getRoles')
->will($this->returnValue($roles));
return $token;
}
}

View File

@ -12,8 +12,10 @@
namespace Symfony\Component\Security\Tests\Http;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\HttpUtils;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Http\HttpUtils;
class HttpUtilsTest extends \PHPUnit_Framework_TestCase
{
@ -28,21 +30,27 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase
}
}
public function testCreateRedirectResponse()
public function testCreateRedirectResponseWithPath()
{
$utils = new HttpUtils($this->getUrlGenerator());
// absolute path
$response = $utils->createRedirectResponse($this->getRequest(), '/foobar');
$this->assertTrue($response->isRedirect('http://localhost/foobar'));
$this->assertEquals(302, $response->getStatusCode());
}
// absolute URL
public function testCreateRedirectResponseWithAbsoluteUrl()
{
$utils = new HttpUtils($this->getUrlGenerator());
$response = $utils->createRedirectResponse($this->getRequest(), 'http://symfony.com/');
$this->assertTrue($response->isRedirect('http://symfony.com/'));
// route name
$this->assertTrue($response->isRedirect('http://symfony.com/'));
}
public function testCreateRedirectResponseWithRouteName()
{
$utils = new HttpUtils($urlGenerator = $this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface'));
$urlGenerator
->expects($this->any())
->method('generate')
@ -54,25 +62,29 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase
->method('getContext')
->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext')))
;
$response = $utils->createRedirectResponse($this->getRequest(), 'foobar');
$this->assertTrue($response->isRedirect('http://localhost/foo/bar'));
}
public function testCreateRequest()
public function testCreateRequestWithPath()
{
$utils = new HttpUtils($this->getUrlGenerator());
// absolute path
$request = $this->getRequest();
$request->server->set('Foo', 'bar');
$utils = new HttpUtils($this->getUrlGenerator());
$subRequest = $utils->createRequest($request, '/foobar');
$this->assertEquals('GET', $subRequest->getMethod());
$this->assertEquals('/foobar', $subRequest->getPathInfo());
$this->assertEquals('bar', $subRequest->server->get('Foo'));
}
// route name
public function testCreateRequestWithRouteName()
{
$utils = new HttpUtils($urlGenerator = $this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface'));
$urlGenerator
->expects($this->once())
->method('generate')
@ -83,14 +95,54 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase
->method('getContext')
->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext')))
;
$subRequest = $utils->createRequest($this->getRequest(), 'foobar');
$this->assertEquals('/foo/bar', $subRequest->getPathInfo());
// absolute URL
$subRequest = $utils->createRequest($this->getRequest(), 'foobar');
$this->assertEquals('/foo/bar', $subRequest->getPathInfo());
}
public function testCreateRequestWithAbsoluteUrl()
{
$utils = new HttpUtils($this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface'));
$subRequest = $utils->createRequest($this->getRequest(), 'http://symfony.com/');
$this->assertEquals('/', $subRequest->getPathInfo());
}
public function testCreateRequestPassesSessionToTheNewRequest()
{
$request = $this->getRequest();
$request->setSession($session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface'));
$utils = new HttpUtils($this->getUrlGenerator());
$subRequest = $utils->createRequest($request, '/foobar');
$this->assertSame($session, $subRequest->getSession());
}
/**
* @dataProvider provideSecurityContextAttributes
*/
public function testCreateRequestPassesSecurityContextAttributesToTheNewRequest($attribute)
{
$request = $this->getRequest();
$request->attributes->set($attribute, 'foo');
$utils = new HttpUtils($this->getUrlGenerator());
$subRequest = $utils->createRequest($request, '/foobar');
$this->assertSame('foo', $subRequest->attributes->get($attribute));
}
public function provideSecurityContextAttributes()
{
return array(
array(SecurityContextInterface::AUTHENTICATION_ERROR),
array(SecurityContextInterface::ACCESS_DENIED_ERROR),
array(SecurityContextInterface::LAST_USERNAME)
);
}
public function testCheckRequestPath()
{
$utils = new HttpUtils($this->getUrlGenerator());
@ -102,26 +154,66 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($utils->checkRequestPath($this->getRequest('/foo+bar'), '/foo+bar'));
// Checking unicode
$this->assertTrue($utils->checkRequestPath($this->getRequest(urlencode('/вход')), '/вход'));
}
public function testCheckRequestPathWithUrlMatcherAndResourceNotFound()
{
$urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
$urlMatcher
->expects($this->any())
->method('match')
->with('/')
->will($this->throwException(new ResourceNotFoundException()))
;
$utils = new HttpUtils(null, $urlMatcher);
$this->assertFalse($utils->checkRequestPath($this->getRequest(), 'foobar'));
}
public function testCheckRequestPathWithUrlMatcherAndMethodNotAllowed()
{
$request = $this->getRequest();
$urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface');
$urlMatcher
->expects($this->any())
->method('matchRequest')
->with($request)
->will($this->throwException(new MethodNotAllowedException(array())))
;
$utils = new HttpUtils(null, $urlMatcher);
$this->assertFalse($utils->checkRequestPath($request, 'foobar'));
}
public function testCheckRequestPathWithUrlMatcherAndResourceFoundByUrl()
{
$urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
$urlMatcher
->expects($this->any())
->method('match')
->with('/foo/bar')
->will($this->returnValue(array('_route' => 'foobar')))
;
$utils = new HttpUtils(null, $urlMatcher);
$this->assertTrue($utils->checkRequestPath($this->getRequest('/foo/bar'), 'foobar'));
}
public function testCheckRequestPathWithUrlMatcherAndResourceFoundByRequest()
{
$request = $this->getRequest();
$urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface');
$urlMatcher
->expects($this->any())
->method('matchRequest')
->with($request)
->will($this->returnValue(array('_route' => 'foobar')))
;
$utils = new HttpUtils(null, $urlMatcher);
$this->assertTrue($utils->checkRequestPath($request, 'foobar'));
}
/**
* @expectedException \RuntimeException
*/
@ -133,20 +225,37 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase
->method('match')
->will($this->throwException(new \RuntimeException()))
;
$utils = new HttpUtils(null, $urlMatcher);
$utils->checkRequestPath($this->getRequest(), 'foobar');
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Matcher must either implement UrlMatcherInterface or RequestMatcherInterface
*/
public function testUrlMatcher()
{
new HttpUtils($this->getUrlGenerator(), new \stdClass());
}
public function testGenerateUriRemovesQueryString()
{
$method = new \ReflectionMethod('Symfony\Component\Security\Http\HttpUtils', 'generateUri');
$method->setAccessible(true);
$utils = new HttpUtils($this->getUrlGenerator());
$this->assertEquals('/foo/bar', $method->invoke($utils, new Request(), 'route_name'));
$utils = new HttpUtils($this->getUrlGenerator('/foo/bar'));
$this->assertEquals('/foo/bar', $utils->generateUri(new Request(), 'route_name'));
$utils = new HttpUtils($this->getUrlGenerator('/foo/bar?param=value'));
$this->assertEquals('/foo/bar', $method->invoke($utils, new Request(), 'route_name'));
$this->assertEquals('/foo/bar', $utils->generateUri(new Request(), 'route_name'));
}
/**
* @expectedException \LogicException
* @expectedExceptionMessage You must provide a UrlGeneratorInterface instance to be able to use routes.
*/
public function testUrlGeneratorIsRequiredToGenerateUrl()
{
$utils = new HttpUtils();
$utils->generateUri(new Request(), 'route_name');
}
private function getUrlGenerator($generatedUrl = '/foo/bar')

View File

@ -0,0 +1,283 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>This value should be false.</source>
<target>Αυτή η τιμή πρέπει να είναι ψευδής.</target>
</trans-unit>
<trans-unit id="2">
<source>This value should be true.</source>
<target>Αυτή η τιμή πρέπει να είναι αληθής.</target>
</trans-unit>
<trans-unit id="3">
<source>This value should be of type {{ type }}.</source>
<target>Αυτή η τιμή πρέπει να είναι τύπου {{ type }}.</target>
</trans-unit>
<trans-unit id="4">
<source>This value should be blank.</source>
<target>Αυτή η τιμή πρέπει να είναι κενή.</target>
</trans-unit>
<trans-unit id="5">
<source>The value you selected is not a valid choice.</source>
<target>Η τιμή που επιλέχθηκε δεν αντιστοιχεί σε έγκυρη επιλογή.</target>
</trans-unit>
<trans-unit id="6">
<source>You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.</source>
<target>Πρέπει να επιλέξετε τουλάχιστον {{ limit }} επιλογή.|Πρέπει να επιλέξετε τουλάχιστον {{ limit }} επιλογές.</target>
</trans-unit>
<trans-unit id="7">
<source>You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.</source>
<target>Πρέπει να επιλέξετε το πολύ {{ limit }} επιλογή.|Πρέπει να επιλέξετε το πολύ {{ limit }} επιλογές.</target>
</trans-unit>
<trans-unit id="8">
<source>One or more of the given values is invalid.</source>
<target>Μια ή περισσότερες τιμές δεν είναι έγκυρες.</target>
</trans-unit>
<trans-unit id="9">
<source>The fields {{ fields }} were not expected.</source>
<target>Τα πεδία {{ fields }} δεν ήταν αναμενόμενα.</target>
</trans-unit>
<trans-unit id="10">
<source>The fields {{ fields }} are missing.</source>
<target>Τα πεδία {{ fields }} απουσιάζουν.</target>
</trans-unit>
<trans-unit id="11">
<source>This value is not a valid date.</source>
<target>Η τιμή δεν αντιστοιχεί σε έγκυρη ημερομηνία.</target>
</trans-unit>
<trans-unit id="12">
<source>This value is not a valid datetime.</source>
<target>Η τιμή δεν αντιστοιχεί σε έγκυρη ημερομηνία και ώρα.</target>
</trans-unit>
<trans-unit id="13">
<source>This value is not a valid email address.</source>
<target>Η τιμή δεν αντιστοιχεί σε έγκυρο email.</target>
</trans-unit>
<trans-unit id="14">
<source>The file could not be found.</source>
<target>Το αρχείο δε μπορεί να βρεθεί.</target>
</trans-unit>
<trans-unit id="15">
<source>The file is not readable.</source>
<target>Το αρχείο δεν είναι αναγνώσιμο.</target>
</trans-unit>
<trans-unit id="16">
<source>The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.</source>
<target>Το αρχείο είναι πολύ μεγάλο ({{ size }} {{ suffix }}). Το μέγιστο επιτρεπτό μέγεθος είναι {{ limit }} {{ suffix }}.</target>
</trans-unit>
<trans-unit id="17">
<source>The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.</source>
<target>Ο τύπος mime του αρχείου δεν είναι έγκυρος ({{ type }}). Οι έγκρυοι τύποι mime είναι {{ types }}.</target>
</trans-unit>
<trans-unit id="18">
<source>This value should be {{ limit }} or less.</source>
<target>Αυτή η τιμή θα έπρεπε να είναι {{ limit }} ή λιγότερο.</target>
</trans-unit>
<trans-unit id="19">
<source>This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.</source>
<target>Αυτή η τιμή είναι πολύ μεγάλη. Θα έπρεπε να έχει {{ limit }} χαρακτήρα ή λιγότερο.|Αυτή η τιμή είναι πολύ μεγάλη. Θα έπρεπε να έχει {{ limit }} χαρακτήρες ή λιγότερο.</target>
</trans-unit>
<trans-unit id="20">
<source>This value should be {{ limit }} or more.</source>
<target>Αυτή η τιμή θα έπρεπε να είναι {{ limit }} ή περισσότερο.</target>
</trans-unit>
<trans-unit id="21">
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
<target>Αυτή η τιμή είναι πολύ μικρή. Θα έπρεπε να έχει {{ limit }} χαρακτήρα ή περισσότερο.|Αυτή η τιμή είναι πολύ μικρή. Θα έπρεπε να έχει {{ limit }} χαρακτήρες ή περισσότερο.</target>
</trans-unit>
<trans-unit id="22">
<source>This value should not be blank.</source>
<target>Αυτή η τιμή δεν πρέπει να είναι κενή.</target>
</trans-unit>
<trans-unit id="23">
<source>This value should not be null.</source>
<target>Αυτή η τιμή δεν πρέπει να είναι μηδενική.</target>
</trans-unit>
<trans-unit id="24">
<source>This value should be null.</source>
<target>Αυτή η τιμή πρέπει να είναι μηδενική.</target>
</trans-unit>
<trans-unit id="25">
<source>This value is not valid.</source>
<target>Αυτή η τιμή δεν είναι έκγυρη.</target>
</trans-unit>
<trans-unit id="26">
<source>This value is not a valid time.</source>
<target>Αυτή η τιμή δεν αντιστοιχεί σε έγκυρη ώρα.</target>
</trans-unit>
<trans-unit id="27">
<source>This value is not a valid URL.</source>
<target>Αυτή η τιμή δεν αντιστοιχεί σε έγκυρο URL.</target>
</trans-unit>
<trans-unit id="31">
<source>The two values should be equal.</source>
<target>Οι δύο τιμές θα πρέπει να είναι ίδιες.</target>
</trans-unit>
<trans-unit id="32">
<source>The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.</source>
<target>Το αρχείο είναι πολύ μεγάλο. Το μέγιστο επιτρεπτό μέγεθος είναι {{ limit }} {{ suffix }}.</target>
</trans-unit>
<trans-unit id="33">
<source>The file is too large.</source>
<target>Το αρχείο είναι πολύ μεγάλο.</target>
</trans-unit>
<trans-unit id="34">
<source>The file could not be uploaded.</source>
<target>Το αρχείο δε μπορεί να ανέβει.</target>
</trans-unit>
<trans-unit id="35">
<source>This value should be a valid number.</source>
<target>Αυτή η τιμή θα πρέπει να είναι ένας έγκυρος αριθμός.</target>
</trans-unit>
<trans-unit id="36">
<source>This file is not a valid image.</source>
<target>Το αρχείο δεν αποτελεί έγκυρη εικόνα.</target>
</trans-unit>
<trans-unit id="37">
<source>This is not a valid IP address.</source>
<target>Αυτό δεν είναι μια έκγυρη διεύθυνση IP.</target>
</trans-unit>
<trans-unit id="38">
<source>This value is not a valid language.</source>
<target>Αυτή η τιμή δεν αντιστοιχεί σε μια έκγυρη γλώσσα.</target>
</trans-unit>
<trans-unit id="39">
<source>This value is not a valid locale.</source>
<target>Αυτή η τιμή δεν αντιστοιχεί σε έκγυρο κωδικό τοποθεσίας.</target>
</trans-unit>
<trans-unit id="40">
<source>This value is not a valid country.</source>
<target>Αυτή η τιμή δεν αντιστοιχεί σε μια έκγυρη χώρα.</target>
</trans-unit>
<trans-unit id="41">
<source>This value is already used.</source>
<target>Αυτή η τιμή χρησιμοποιείται ήδη.</target>
</trans-unit>
<trans-unit id="42">
<source>The size of the image could not be detected.</source>
<target>Το μέγεθος της εικόνας δεν ήταν δυνατό να ανιχνευθεί.</target>
</trans-unit>
<trans-unit id="43">
<source>The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.</source>
<target>Το πλάτος της εικόνας είναι πολύ μεγάλο ({{ width }}px). Το μέγιστο επιτρεπτό πλάτος είναι {{ max_width }}px.</target>
</trans-unit>
<trans-unit id="44">
<source>The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.</source>
<target>Το πλάτος της εικόνας είναι πολύ μικρό ({{ width }}px). Το ελάχιστο επιτρεπτό πλάτος είναι {{ min_width }}px.</target>
</trans-unit>
<trans-unit id="45">
<source>The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.</source>
<target>Το ύψος της εικόνας είναι πολύ μεγάλο ({{ height }}px). Το μέγιστο επιτρεπτό ύψος είναι {{ max_height }}px.</target>
</trans-unit>
<trans-unit id="46">
<source>The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.</source>
<target>Το ύψος της εικόνας είναι πολύ μικρό ({{ height }}px). Το ελάχιστο επιτρεπτό ύψος είναι {{ min_height }}px.</target>
</trans-unit>
<trans-unit id="47">
<source>This value should be the user current password.</source>
<target>Αυτή η τιμή θα έπρεπε να είναι ο τρέχων κωδικός.</target>
</trans-unit>
<trans-unit id="48">
<source>This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.</source>
<target>Αυτή η τιμή θα έπρεπε να έχει ακριβώς {{ limit }} χαρακτήρα.|Αυτή η τιμή θα έπρεπε να έχει ακριβώς {{ limit }} χαρακτήρες.</target>
</trans-unit>
<trans-unit id="49">
<source>The file was only partially uploaded.</source>
<target>Το αρχείο δεν ανέβηκε ολόκληρο.</target>
</trans-unit>
<trans-unit id="50">
<source>No file was uploaded.</source>
<target>Δεν ανέβηκε κανένα αρχείο.</target>
</trans-unit>
<trans-unit id="51">
<source>No temporary folder was configured in php.ini.</source>
<target>Κανένας προσωρινός φάκελος δεν έχει ρυθμιστεί στο php.ini.</target>
</trans-unit>
<trans-unit id="52">
<source>Cannot write temporary file to disk.</source>
<target>Αδυναμία εγγραφής προσωρινού αρχείου στο δίσκο.</target>
</trans-unit>
<trans-unit id="53">
<source>A PHP extension caused the upload to fail.</source>
<target>Μια επέκταση PHP προκάλεσε αδυναμία ανεβάσματος.</target>
</trans-unit>
<trans-unit id="54">
<source>This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.</source>
<target>Αυτή η συλλογή θα πρέπει να περιέχει {{ limit }} στοιχείο ή περισσότερα.|Αυτή η συλλογή θα πρέπει να περιέχει {{ limit }} στοιχεία ή περισσότερα.</target>
</trans-unit>
<trans-unit id="55">
<source>This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.</source>
<target>Αυτή η συλλογή θα πρέπει να περιέχει {{ limit }} στοιχείo ή λιγότερα.|Αυτή η συλλογή θα πρέπει να περιέχει {{ limit }} στοιχεία ή λιγότερα.</target>
</trans-unit>
<trans-unit id="56">
<source>This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.</source>
<target>Αυτή η συλλογή θα πρέπει να περιέχει ακριβώς {{ limit }} στοιχείo.|Αυτή η συλλογή θα πρέπει να περιέχει ακριβώς {{ limit }} στοιχεία.</target>
</trans-unit>
<trans-unit id="57">
<source>Invalid card number.</source>
<target>Μη έγκυρος αριθμός κάρτας.</target>
</trans-unit>
<trans-unit id="58">
<source>Unsupported card type or invalid card number.</source>
<target>Μη υποστηριζόμενος τύπος κάρτας ή μη έγκυρος αριθμός κάρτας.</target>
</trans-unit>
<trans-unit id="59">
<source>This is not a valid International Bank Account Number (IBAN).</source>
<target>Αυτό δεν αντιστοιχεί σε έκγυρο διεθνή αριθμό τραπεζικού λογαριασμού (IBAN).</target>
</trans-unit>
<trans-unit id="60">
<source>This value is not a valid ISBN-10.</source>
<target>Αυτό δεν είναι έγκυρος κωδικός ISBN-10.</target>
</trans-unit>
<trans-unit id="61">
<source>This value is not a valid ISBN-13.</source>
<target>Αυτό δεν είναι έγκυρος κωδικός ISBN-13.</target>
</trans-unit>
<trans-unit id="62">
<source>This value is neither a valid ISBN-10 nor a valid ISBN-13.</source>
<target>Αυτό δεν είναι ούτε έγκυρος κωδικός ISBN-10 ούτε έγκυρος κωδικός ISBN-13.</target>
</trans-unit>
<trans-unit id="63">
<source>This value is not a valid ISSN.</source>
<target>Αυτό δεν είναι έγκυρος κωδικός ISSN.</target>
</trans-unit>
<trans-unit id="64">
<source>This value is not a valid currency.</source>
<target>Αυτό δεν αντιστοιχεί σε έγκυρο νόμισμα.</target>
</trans-unit>
<trans-unit id="65">
<source>This value should be equal to {{ compared_value }}.</source>
<target>Αυτή η τιμή θα πρέπει να είναι ίση με {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="66">
<source>This value should be greater than {{ compared_value }}.</source>
<target>Αυτή η τιμή θα πρέπει να είναι μεγαλύτερη από {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="67">
<source>This value should be greater than or equal to {{ compared_value }}.</source>
<target>Αυτή η τιμή θα πρέπει να είναι μεγαλύτερη ή ίση με {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="68">
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>Αυτή η τιμή θα πρέπει να είναι πανομοιότυπη με {{ compared_value_type }} {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="69">
<source>This value should be less than {{ compared_value }}.</source>
<target>Αυτή η τιμή θα πρέπει να είναι μικρότερη από {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="70">
<source>This value should be less than or equal to {{ compared_value }}.</source>
<target>Αυτή η τιμή θα πρέπει να είναι μικρότερη ή ίση με {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="71">
<source>This value should not be equal to {{ compared_value }}.</source>
<target>Αυτή η τιμή δεν θα πρέπει να είναι ίση με {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="72">
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>Αυτή η τιμή δεν πρέπει να είναι πανομοιότυπη με {{ compared_value_type }} {{ compared_value }}.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -222,6 +222,62 @@
<source>Unsupported card type or invalid card number.</source>
<target>Tipo de tarxeta non soportado ou número de tarxeta non válido.</target>
</trans-unit>
<trans-unit id="59">
<source>This is not a valid International Bank Account Number (IBAN).</source>
<target>Este valor non é un International Bank Account Number (IBAN) válido.</target>
</trans-unit>
<trans-unit id="60">
<source>This value is not a valid ISBN-10.</source>
<target>Este valor non é un ISBN-10 válido.</target>
</trans-unit>
<trans-unit id="61">
<source>This value is not a valid ISBN-13.</source>
<target>Este valor non é un ISBN-13 válido.</target>
</trans-unit>
<trans-unit id="62">
<source>This value is neither a valid ISBN-10 nor a valid ISBN-13.</source>
<target>Este valor non é nin un ISBN-10 válido nin un ISBN-13 válido.</target>
</trans-unit>
<trans-unit id="63">
<source>This value is not a valid ISSN.</source>
<target>Este valor non é un ISSN válido.</target>
</trans-unit>
<trans-unit id="64">
<source>This value is not a valid currency.</source>
<target>Este valor non é unha moeda válida.</target>
</trans-unit>
<trans-unit id="65">
<source>This value should be equal to {{ compared_value }}.</source>
<target>Este valor debería ser igual a {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="66">
<source>This value should be greater than {{ compared_value }}.</source>
<target>Este valor debería ser maior que {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="67">
<source>This value should be greater than or equal to {{ compared_value }}.</source>
<target>Este valor debería ser maior ou igual que {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="68">
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>Este valor debería ser identico a {{ compared_value_type }} {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="69">
<source>This value should be less than {{ compared_value }}.</source>
<target>Este valor debería ser menor que {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="70">
<source>This value should be less than or equal to {{ compared_value }}.</source>
<target>Este valor debería ser menor ou igual que {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="71">
<source>This value should not be equal to {{ compared_value }}.</source>
<target>Este valor non debería ser igual a {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="72">
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>Este valor non debería ser identico a {{ compared_value_type }} {{ compared_value }}.</target>
</trans-unit>
</body>
</file>
</xliff>