Provide Filesystem::getUniqueFilename()
Summary: We do this in at least two places (D742 is one, and there's at least
one in Arcanist); provide a method for it since the logic is messy.
Test Plan:
php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,
'.'); echo $f;
/INSECURE/devtools/libphutil/derp php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,
'.'); echo $f;
/INSECURE/devtools/libphutil/derp.1 php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,
'.'); echo $f;
/INSECURE/devtools/libphutil/derp.2 php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,
'.'); echo $f;
/INSECURE/devtools/libphutil/derp.3 php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,
'.'); echo $f;
/INSECURE/devtools/libphutil/derp.4
Reviewed By: aran
Reviewers: codeblock, jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 743