From 9d6357c35b9e38eeab303a9b6bff045bf2ab27a7 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 14 Jun 2011 18:21:04 +0200 Subject: [PATCH] [HttpFoundation] Document the changes to the File classes --- UPDATE.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/UPDATE.md b/UPDATE.md index 5a3f08ecce..c2f464d472 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -9,6 +9,36 @@ timeline closely anyway. beta4 to beta5 -------------- +* The File classes from `HttpFoundation` have been refactored: + + * `Symfony\Component\HttpFoundation\File\File` has a new API: + + * It now extends `\splFileInfo`: + + * former `getName()` equivalent is `getBasename()`, + * former `getDirectory()` equivalent is `getPath()`, + * former `getPath()` equivalent is `getRealPath()`. + + * the `move()` method now creates the target directory when it does not exist, + + * `getExtension()` and `guessExtension()` do not return the extension + with a leading `.` anymore + + * `Symfony\Component\HttpFoundation\File\UploadedFile` has a new API: + + * The constructor has a new Boolean parameter that must be set to true + in test mode only in order to be able to move the file. This parameter + is not intended to be set to true from outside of the core files. + + * `getMimeType()` now always returns the mime type of the underlying file. + Use `getClientMimeType()` to get the mime type from the request. + + * `getSize()` now always returns the size of the underlying file. + Use `getClientSize()` to get the file size from the request. + + * Use `getClientOriginalName()` to retrieve the original name from the + request. + * The `extensions` setting for Twig has been removed. There is now only one way to register Twig extensions, via the `twig.extension` tag. @@ -28,9 +58,6 @@ beta4 to beta5 * The file input is now rendered as any other input field. -* The `Symfony\Component\HttpFoundation\File\File::getExtension()` and - `guessExtension()` methods do not return the extension with a `.` anymore. - * The `em` option of the Doctrine `EntityType` class now takes the entity manager name instead of the EntityManager instance. If you don't pass this option, the default Entity Manager will be used as before.