+ /**
+ * Unlink a file, suppressing the warnings
+ *
+ * @param string $path Absolute file system path
+ * @return bool Success
+ */
+ protected function unlink( $path ) {
+ AtEase::suppressWarnings();
+ $ok = unlink( $path );
+ AtEase::restoreWarnings();
+
+ return $ok;
+ }
+
+ /**
+ * @param array $params Operation parameters with 'content' and 'headers' fields
+ * @return TempFSFile|null
+ */
+ protected function stageContentAsTempFile( array $params ) {
+ $content = $params['content'];
+ $tempFile = $this->tmpFileFactory->newTempFSFile( 'create_', 'tmp' );
+ if ( !$tempFile ) {
+ return null;
+ }
+
+ AtEase::suppressWarnings();
+ $tmpPath = $tempFile->getPath();
+ if ( file_put_contents( $tmpPath, $content ) === false ) {
+ $tempFile = null;
+ }
+ AtEase::restoreWarnings();
+
+ return $tempFile;
+ }
+