Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[Filesystem] fixed exception message when not a able to write to a directory #8587

Closed
wants to merge 2 commits into from

3 participants

@deeky666
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

This simply fixes an exception message in the Filesystem Component when a directory is not writable while dumping a file via dumpFile().

src/Symfony/Component/Filesystem/Filesystem.php
@@ -456,7 +456,7 @@ public function dumpFile($filename, $content, $mode = 0666)
if (!is_dir($dir)) {
$this->mkdir($dir);
} elseif (!is_writable($dir)) {
- throw new IOException(sprintf('Unable to write in the %s directory\n', $dir));
+ throw new IOException(sprintf('Unable to write to directory "%s".', $dir));
@jakzal Collaborator
jakzal added a note

How about "Unable to write to the "%s" directory"? It reads better imho.

@hacfi
hacfi added a note

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@fabpot fabpot referenced this pull request from a commit
@fabpot fabpot merged branch deeky666/fix-filesystem-exception-message (PR #8587)
This PR was squashed before being merged into the master branch (closes #8587).

Discussion
----------

[Filesystem] fixed exception message when not a able to write to a directory

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This simply fixes an exception message in the Filesystem Component when a directory is not writable while dumping a file via `dumpFile()`.

Commits
-------

8b32a4b [Filesystem] fixed exception message when not a able to write to a directory
728d194
@fabpot fabpot closed this pull request from a commit
@fabpot fabpot merged branch deeky666/fix-filesystem-exception-message (PR #8587)
This PR was squashed before being merged into the master branch (closes #8587).

Discussion
----------

[Filesystem] fixed exception message when not a able to write to a directory

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This simply fixes an exception message in the Filesystem Component when a directory is not writable while dumping a file via `dumpFile()`.

Commits
-------

8b32a4b [Filesystem] fixed exception message when not a able to write to a directory
728d194
@fabpot fabpot closed this in 728d194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 26, 2013
  1. @deeky666
Commits on Jul 28, 2013
  1. @deeky666
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/Symfony/Component/Filesystem/Filesystem.php
View
2  src/Symfony/Component/Filesystem/Filesystem.php
@@ -456,7 +456,7 @@ public function dumpFile($filename, $content, $mode = 0666)
if (!is_dir($dir)) {
$this->mkdir($dir);
} elseif (!is_writable($dir)) {
- throw new IOException(sprintf('Unable to write in the %s directory\n', $dir));
+ throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir));
}
$tmpFile = tempnam($dir, basename($filename));
Something went wrong with that request. Please try again.