protected function writeInventoryFile($inventory)
{
// what are we doing?
$log = usingLog()->startAction("write temporary inventory file");
// what are we going to call the inventory file?
$filename = fromFile()->getTmpFilename();
// write the data
file_put_contents($filename, $inventory);
// all done
$log->endAction("written to file '{$filename}'");
return $filename;
}