@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 51 lines 1.1 kB view raw
1<?php 2 3final class PhabricatorExtensionsSetupCheck extends PhabricatorSetupCheck { 4 5 public function getDefaultGroup() { 6 return self::GROUP_PHP; 7 } 8 9 public function isPreflightCheck() { 10 return true; 11 } 12 13 protected function executeChecks() { 14 // TODO: Make 'mbstring' a soft requirement. 15 16 $required = array( 17 'hash', 18 'json', 19 'openssl', 20 'mbstring', 21 'ctype', 22 'mysqli', 23 24 // There is a tiny chance we might not need this, but a significant 25 // number of applications require it and it's widely available. 26 'curl', 27 ); 28 29 $need = array(); 30 foreach ($required as $extension) { 31 if (!extension_loaded($extension)) { 32 $need[] = $extension; 33 } 34 } 35 36 if (!$need) { 37 return; 38 } 39 40 $message = pht('Required PHP extensions are not installed.'); 41 42 $issue = $this->newIssue('php.extensions') 43 ->setIsFatal(true) 44 ->setName(pht('Missing Required Extensions')) 45 ->setMessage($message); 46 47 foreach ($need as $extension) { 48 $issue->addPHPExtension($extension); 49 } 50 } 51}