Skip to content

Commit

Permalink
changed the default directory for the upload temp dir, made the dir m…
Browse files Browse the repository at this point in the history
…andatory
  • Loading branch information
fabpot committed Apr 23, 2011
1 parent 02c66e6 commit 8cc5caf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml
Expand Up @@ -13,8 +13,6 @@
<parameter key="form.validation_groups">Default</parameter>
<parameter key="file.temporary_storage.class">Symfony\Component\HttpFoundation\File\SessionBasedTemporaryStorage</parameter>
<parameter key="file.temporary_storage.secret">abcdef</parameter>
<parameter key="file.temporary_storage.directory"></parameter>

</parameters>

<services>
Expand Down Expand Up @@ -66,7 +64,7 @@
<service id="file.temporary_storage" class="%file.temporary_storage.class%">
<argument type="service" id="session" />
<argument>%file.temporary_storage.secret%</argument>
<argument>%file.temporary_storage.directory%</argument>
<argument>%kernel.cache_dir%/upload</argument>
</service>

<!-- CoreExtension -->
Expand Down
Expand Up @@ -18,7 +18,7 @@
*/
class SessionBasedTemporaryStorage extends TemporaryStorage
{
public function __construct(Session $session, $secret, $directory = null)
public function __construct(Session $session, $secret, $directory)
{
parent::__construct($secret, $directory);

Expand Down
Expand Up @@ -22,12 +22,8 @@ class TemporaryStorage
private $directory;
private $secret;

public function __construct($secret, $directory = null)
public function __construct($secret, $directory)
{
if (empty($directory)) {
$directory = sys_get_temp_dir();
}

$this->directory = realpath($directory);
$this->secret = $secret;
}
Expand Down

0 comments on commit 8cc5caf

Please sign in to comment.