Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorGDSetupCheck.php
<?php | <?php | ||||
final class PhabricatorGDSetupCheck extends PhabricatorSetupCheck { | final class PhabricatorGDSetupCheck extends PhabricatorSetupCheck { | ||||
public function getDefaultGroup() { | public function getDefaultGroup() { | ||||
return self::GROUP_OTHER; | return self::GROUP_OTHER; | ||||
} | } | ||||
protected function executeChecks() { | protected function executeChecks() { | ||||
if (!extension_loaded('gd')) { | if (!extension_loaded('gd')) { | ||||
$message = pht( | $message = pht( | ||||
"The '%s' extension is not installed. Without '%s', support, ". | "The '%s' extension is not installed. Without '%s', support, ". | ||||
"Phabricator will not be able to process or resize images ". | "this server will not be able to process or resize images ". | ||||
"(for example, to generate thumbnails). Install or enable '%s'.", | "(for example, to generate thumbnails). Install or enable '%s'.", | ||||
'gd', | 'gd', | ||||
'gd', | 'gd', | ||||
'gd'); | 'gd'); | ||||
$this->newIssue('extension.gd') | $this->newIssue('extension.gd') | ||||
->setName(pht("Missing '%s' Extension", 'gd')) | ->setName(pht("Missing '%s' Extension", 'gd')) | ||||
->setMessage($message) | ->setMessage($message) | ||||
Show All 14 Lines | if (!extension_loaded('gd')) { | ||||
$missing = array_diff($image_type_map, $have); | $missing = array_diff($image_type_map, $have); | ||||
if ($missing) { | if ($missing) { | ||||
$missing = implode(', ', $missing); | $missing = implode(', ', $missing); | ||||
$have = implode(', ', $have); | $have = implode(', ', $have); | ||||
$message = pht( | $message = pht( | ||||
"The '%s' extension has support for only some image types. ". | "The '%s' extension has support for only some image types. ". | ||||
"Phabricator will be unable to process images of the missing ". | "This server will be unable to process images of the missing ". | ||||
"types until you build '%s' with support for them. ". | "types until you build '%s' with support for them. ". | ||||
"Supported types: %s. Missing types: %s.", | "Supported types: %s. Missing types: %s.", | ||||
'gd', | 'gd', | ||||
'gd', | 'gd', | ||||
$have, | $have, | ||||
$missing); | $missing); | ||||
$this->newIssue('extension.gd.support') | $this->newIssue('extension.gd.support') | ||||
->setName(pht("Partial '%s' Support", 'gd')) | ->setName(pht("Partial '%s' Support", 'gd')) | ||||
->setMessage($message); | ->setMessage($message); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |