Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Removed deprecations in Filesystem component #14145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Removed deprecations in Filesystem component
  • Loading branch information
dosten committed May 3, 2015
commit f3cc72547a0922d03d8c7d383e96ac88158d10b1
7 changes: 1 addition & 6 deletions 7 src/Symfony/Component/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,10 @@ public function isAbsolutePath($file)
*
* @param string $filename The file to be written to.
* @param string $content The data to write into the file.
* @param null|int $mode The file mode (octal). If null, file permissions are not modified
* Deprecated since version 2.3.12, to be removed in 3.0.
*
* @throws IOException If the file cannot be written to.
*/
public function dumpFile($filename, $content, $mode = 0666)
public function dumpFile($filename, $content)
{
$dir = dirname($filename);

Expand All @@ -479,9 +477,6 @@ public function dumpFile($filename, $content, $mode = 0666)
}

$this->rename($tmpFile, $filename, true);
if (null !== $mode) {
$this->chmod($filename, $mode);
}
}

/**
Expand Down
17 changes: 1 addition & 16 deletions 17 src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -959,22 +959,7 @@ public function testDumpFile()
{
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt';

$this->filesystem->dumpFile($filename, 'bar', 0753);

$this->assertFileExists($filename);
$this->assertSame('bar', file_get_contents($filename));

// skip mode check on Windows
if ('\\' !== DIRECTORY_SEPARATOR) {
$this->assertFilePermissions(753, $filename);
}
}

public function testDumpFileWithNullMode()
{
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt';

$this->filesystem->dumpFile($filename, 'bar', null);
$this->filesystem->dumpFile($filename, 'bar');

$this->assertFileExists($filename);
$this->assertSame('bar', file_get_contents($filename));
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.