Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F35364334
PhabricatorSetupCheckGD.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
PhabricatorSetupCheckGD.php
View Options
<?php
final
class
PhabricatorSetupCheckGD
extends
PhabricatorSetupCheck
{
protected
function
executeChecks
()
{
if
(!
extension_loaded
(
'gd'
))
{
$message
=
pht
(
"The 'gd' extension is not installed. Without 'gd', support, "
.
"Phabricator will not be able to process or resize images "
.
"(for example, to generate thumbnails). Install or enable 'gd'."
);
$this
->
newIssue
(
'extension.gd'
)
->
setName
(
pht
(
"Missing 'gd' Extension"
))
->
setMessage
(
$message
);
}
else
{
$image_type_map
=
array
(
'imagecreatefrompng'
=>
'PNG'
,
'imagecreatefromgif'
=>
'GIF'
,
'imagecreatefromjpeg'
=>
'JPEG'
,
);
$have
=
array
();
foreach
(
$image_type_map
as
$function
=>
$image_type
)
{
if
(
function_exists
(
$function
))
{
$have
[]
=
$image_type
;
}
}
$missing
=
array_diff
(
$image_type_map
,
$have
);
if
(
$missing
)
{
$missing
=
implode
(
', '
,
$missing
);
$have
=
implode
(
', '
,
$have
);
$message
=
pht
(
"The 'gd' extension has support for only some image types. "
.
"Phabricator will be unable to process images of the missing "
.
"types until you build 'gd' with support for them. "
.
"Supported types: %s. Missing types: %s."
,
$have
,
$missing
);
$this
->
newIssue
(
'extension.gd.support'
)
->
setName
(
pht
(
"Partial 'gd' Support"
))
->
setMessage
(
$message
);
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Feb 6, 9:59 PM (6 h, 55 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
f7/ab/788a8d9c26f8880274521b0f1689
Attached To
rPHAB Phabricator
Event Timeline
Log In to Comment