Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorWebServerSetupCheck.php
Context not available. | |||||
} | } | ||||
$base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); | $base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); | ||||
if (!strlen($base_uri)) { | if (!@strlen($base_uri)) { | ||||
// If `phabricator.base-uri` is not set then we can't really do | // If `phabricator.base-uri` is not set then we can't really do | ||||
// anything. | // anything. | ||||
return; | return; | ||||
Context not available. | |||||
try { | try { | ||||
list($body) = $ec2_future->resolvex(); | list($body) = $ec2_future->resolvex(); | ||||
$body = trim($body); | $body = trim($body); | ||||
if (preg_match('/^t2/', $body)) { | if (@preg_match('/^t2/', $body)) { | ||||
$message = pht( | $message = pht( | ||||
'Phabricator appears to be installed on a very small EC2 instance '. | 'Phabricator appears to be installed on a very small EC2 instance '. | ||||
'(of class "%s") with burstable CPU. This is strongly discouraged. '. | '(of class "%s") with burstable CPU. This is strongly discouraged. '. | ||||
Context not available. | |||||
'"Content-Encoding: gzip", but received different bytes than it '. | '"Content-Encoding: gzip", but received different bytes than it '. | ||||
'sent.'); | 'sent.'); | ||||
$prefix_len = min(strlen($raw_body), strlen($uncompressed)); | $prefix_len = min(@strlen($raw_body), @strlen($uncompressed)); | ||||
if ($prefix_len > 16 && !strncmp($raw_body, $uncompressed, $prefix_len)) { | if ($prefix_len > 16 && !strncmp($raw_body, $uncompressed, $prefix_len)) { | ||||
$message[] = pht( | $message[] = pht( | ||||
'The request body that the server received had already been '. | 'The request body that the server received had already been '. | ||||
Context not available. | |||||
} | } | ||||
private function snipBytes($raw) { | private function snipBytes($raw) { | ||||
if (!strlen($raw)) { | if (!@strlen($raw)) { | ||||
$display = pht('<empty>'); | $display = pht('<empty>'); | ||||
} else { | } else { | ||||
$snip = substr($raw, 0, 24); | $snip = @substr($raw, 0, 24); | ||||
$display = phutil_loggable_string($snip); | $display = phutil_loggable_string($snip); | ||||
if (strlen($snip) < strlen($raw)) { | if (@strlen($snip) < @strlen($raw)) { | ||||
$display .= '...'; | $display .= '...'; | ||||
} | } | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0