Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 6bb9fdf

Browse files
committed
FirefoxProfile: clean up temporary files
during profile setup, some temporary files/folders are created. these temporary files/folders can grow quite large, so clean them up after the profile has been constructed to prevent disk space issues.
1 parent 266e4bd commit 6bb9fdf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/Firefox/FirefoxProfile.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ public function encode() {
9898
$zip->close();
9999

100100
$profile = base64_encode(file_get_contents($temp_zip));
101+
102+
// clean up
103+
rmdir($temp_dir);
104+
unlink($temp_zip);
105+
101106
return $profile;
102107
}
103108

@@ -122,6 +127,10 @@ private function installExtension($extension, $profile_dir) {
122127
mkdir($ext_dir, 0777, true);
123128

124129
$this->extractTo($extension, $ext_dir);
130+
131+
// clean up
132+
rmdir($temp_dir);
133+
125134
return $ext_dir;
126135
}
127136

0 commit comments

Comments
 (0)