mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 08:42:40 +01:00
Use Filesystem::getMimeType() in Arcanist
Summary: Missed this when getting rid of all the 'file' calls. Test Plan: Meta. Reviewers: btrahan, vrana, jungejason Reviewed By: vrana CC: aran Maniphest Tasks: T1159 Differential Revision: https://secure.phabricator.com/D2327
This commit is contained in:
parent
cb051d8568
commit
e9ab03a48e
2 changed files with 4 additions and 5 deletions
|
@ -898,11 +898,9 @@ EOTEXT
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$future = new ExecFuture('file -b --mime -');
|
$tmp = new TempFile();
|
||||||
$future->write($data);
|
Filesystem::writeFile($tmp, $data);
|
||||||
list($mime_type) = $future->resolvex();
|
$mime_type = Filesystem::getMimeType($tmp);
|
||||||
|
|
||||||
$mime_type = trim($mime_type);
|
|
||||||
$result['mime'] = $mime_type;
|
$result['mime'] = $mime_type;
|
||||||
|
|
||||||
echo "Uploading {$desc} '{$name}' ({$mime_type}, {$size} bytes)...\n";
|
echo "Uploading {$desc} '{$name}' ({$mime_type}, {$size} bytes)...\n";
|
||||||
|
|
|
@ -23,6 +23,7 @@ phutil_require_module('phutil', 'console');
|
||||||
phutil_require_module('phutil', 'console/editor');
|
phutil_require_module('phutil', 'console/editor');
|
||||||
phutil_require_module('phutil', 'filesystem');
|
phutil_require_module('phutil', 'filesystem');
|
||||||
phutil_require_module('phutil', 'filesystem/filelist');
|
phutil_require_module('phutil', 'filesystem/filelist');
|
||||||
|
phutil_require_module('phutil', 'filesystem/tempfile');
|
||||||
phutil_require_module('phutil', 'future/exec');
|
phutil_require_module('phutil', 'future/exec');
|
||||||
phutil_require_module('phutil', 'utils');
|
phutil_require_module('phutil', 'utils');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue