mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +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:
parent
9e5410e6a2
commit
1898a540d8
2 changed files with 19 additions and 0 deletions
|
@ -1383,6 +1383,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorSetupCheckExtensions' => 'applications/config/check/PhabricatorSetupCheckExtensions.php',
|
'PhabricatorSetupCheckExtensions' => 'applications/config/check/PhabricatorSetupCheckExtensions.php',
|
||||||
'PhabricatorSetupCheckExtraConfig' => 'applications/config/check/PhabricatorSetupCheckExtraConfig.php',
|
'PhabricatorSetupCheckExtraConfig' => 'applications/config/check/PhabricatorSetupCheckExtraConfig.php',
|
||||||
'PhabricatorSetupCheckFacebook' => 'applications/config/check/PhabricatorSetupCheckFacebook.php',
|
'PhabricatorSetupCheckFacebook' => 'applications/config/check/PhabricatorSetupCheckFacebook.php',
|
||||||
|
'PhabricatorSetupCheckFileinfo' => 'applications/config/check/PhabricatorSetupCheckFileinfo.php',
|
||||||
'PhabricatorSetupCheckGD' => 'applications/config/check/PhabricatorSetupCheckGD.php',
|
'PhabricatorSetupCheckGD' => 'applications/config/check/PhabricatorSetupCheckGD.php',
|
||||||
'PhabricatorSetupCheckImagemagick' => 'applications/config/check/PhabricatorSetupCheckImagemagick.php',
|
'PhabricatorSetupCheckImagemagick' => 'applications/config/check/PhabricatorSetupCheckImagemagick.php',
|
||||||
'PhabricatorSetupCheckInvalidConfig' => 'applications/config/check/PhabricatorSetupCheckInvalidConfig.php',
|
'PhabricatorSetupCheckInvalidConfig' => 'applications/config/check/PhabricatorSetupCheckInvalidConfig.php',
|
||||||
|
@ -3114,6 +3115,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorSetupCheckExtensions' => 'PhabricatorSetupCheck',
|
'PhabricatorSetupCheckExtensions' => 'PhabricatorSetupCheck',
|
||||||
'PhabricatorSetupCheckExtraConfig' => 'PhabricatorSetupCheck',
|
'PhabricatorSetupCheckExtraConfig' => 'PhabricatorSetupCheck',
|
||||||
'PhabricatorSetupCheckFacebook' => 'PhabricatorSetupCheck',
|
'PhabricatorSetupCheckFacebook' => 'PhabricatorSetupCheck',
|
||||||
|
'PhabricatorSetupCheckFileinfo' => 'PhabricatorSetupCheck',
|
||||||
'PhabricatorSetupCheckGD' => 'PhabricatorSetupCheck',
|
'PhabricatorSetupCheckGD' => 'PhabricatorSetupCheck',
|
||||||
'PhabricatorSetupCheckImagemagick' => 'PhabricatorSetupCheck',
|
'PhabricatorSetupCheckImagemagick' => 'PhabricatorSetupCheck',
|
||||||
'PhabricatorSetupCheckInvalidConfig' => 'PhabricatorSetupCheck',
|
'PhabricatorSetupCheckInvalidConfig' => 'PhabricatorSetupCheck',
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue