Skip to content

Commit 9f13a21

Browse files
authored
Merge pull request #30 from uWaterloo/fopen-append
Use append-only mode in fopen()
2 parents e211938 + 2fb3919 commit 9f13a21

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Writer/Drupal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function rewrite($version, $timestamp, $core = null, $project = null)
4040
foreach ($this->paths as $info_file) {
4141
// Don't write to files that already contain version information.
4242
if (!$this->hasVersionInfo($info_file)) {
43-
$file = fopen($info_file, 'a+');
43+
$file = fopen($info_file, 'a');
4444
$coreToWrite = $this->hasCoreVersionRequirement($info_file) ? null : $core;
4545
fwrite($file, $this->formatInfo($version, $timestamp, $coreToWrite, $project));
4646
fclose($file);

tests/DrupalInfoTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function testRollbackRewrite()
221221
timestamp: 1234
222222
EOL;
223223
foreach ($files as $file) {
224-
$handle = fopen($file, 'a+');
224+
$handle = fopen($file, 'a');
225225
fwrite($handle, $info_pattern);
226226
fclose($handle);
227227
$this->assertContains($info_pattern, file_get_contents($file));

0 commit comments

Comments
 (0)