1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Add a setup warning about missing 'fileinfo'

Summary:
See <https://github.com/facebook/phabricator/issues/320>. We have a soft dependency on 'fileinfo', which we try to recover from (with `file`) but won't be able to on Windows and apparently FreeBSD systems. Since users can ignore setup checks anyway now, just raise a warning during install.

I believe almost all installs should have this extension, it has been part of the core for a long time.

Test Plan: Faked setup failure, looked at warning. "Solved" setup failure, saw it go away.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D5952
This commit is contained in:
epriestley 2013-05-17 10:00:40 -07:00
parent 9e5410e6a2
commit 1898a540d8
2 changed files with 19 additions and 0 deletions

View file

@ -1383,6 +1383,7 @@ phutil_register_library_map(array(
'PhabricatorSetupCheckExtensions' => 'applications/config/check/PhabricatorSetupCheckExtensions.php',
'PhabricatorSetupCheckExtraConfig' => 'applications/config/check/PhabricatorSetupCheckExtraConfig.php',
'PhabricatorSetupCheckFacebook' => 'applications/config/check/PhabricatorSetupCheckFacebook.php',
'PhabricatorSetupCheckFileinfo' => 'applications/config/check/PhabricatorSetupCheckFileinfo.php',
'PhabricatorSetupCheckGD' => 'applications/config/check/PhabricatorSetupCheckGD.php',
'PhabricatorSetupCheckImagemagick' => 'applications/config/check/PhabricatorSetupCheckImagemagick.php',
'PhabricatorSetupCheckInvalidConfig' => 'applications/config/check/PhabricatorSetupCheckInvalidConfig.php',
@ -3114,6 +3115,7 @@ phutil_register_library_map(array(
'PhabricatorSetupCheckExtensions' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckExtraConfig' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckFacebook' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckFileinfo' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckGD' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckImagemagick' => 'PhabricatorSetupCheck',
'PhabricatorSetupCheckInvalidConfig' => 'PhabricatorSetupCheck',

View file

@ -0,0 +1,17 @@
<?php
final class PhabricatorSetupCheckFileinfo extends PhabricatorSetupCheck {
protected function executeChecks() {
if (!extension_loaded('fileinfo')) {
$message = pht(
"The 'fileinfo' extension is not installed. Without 'fileinfo', ".
"support, Phabricator may not be able to determine the MIME types ".
"of uploaded files.");
$this->newIssue('extension.fileinfo')
->setName(pht("Missing 'fileinfo' Extension"))
->setMessage($message);
}
}
}