1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-22 04:31:13 +01:00
phorge-phorge/src/applications/config/check/PhabricatorBaseURISetupCheck.php
Chad Little b701313e0e Split Setup Issues into Groups
Summary: Groups setup issues into Important, PHP, MySQL, and Base for easier parsing on initial installations.

Test Plan:
Test my internal server and various issues.

{F289699}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7207

Differential Revision: https://secure.phabricator.com/D11726
2015-02-10 12:53:00 -08:00

71 lines
2.3 KiB
PHP

<?php
final class PhabricatorBaseURISetupCheck extends PhabricatorSetupCheck {
public function getDefaultGroup() {
return self::GROUP_IMPORTANT;
}
protected function executeChecks() {
$base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri');
if (strpos(AphrontRequest::getHTTPHeader('Host'), '.') === false) {
$summary = pht(
'The domain does not contain a dot. This is necessary for some web '.
'browsers to be able to set cookies.');
$message = pht(
'The domain in the base URI must contain a dot ("."), e.g. '.
'"http://example.com", not just a bare name like "http://example/". '.
'Some web browsers will not set cookies on domains with no TLD.');
$this
->newIssue('config.phabricator.domain')
->setShortName(pht('Dotless Domain'))
->setName(pht('No Dot Character in Domain'))
->setSummary($summary)
->setMessage($message)
->setIsFatal(true);
}
if ($base_uri) {
return;
}
$base_uri_guess = PhabricatorEnv::getRequestBaseURI();
$summary = pht(
'The base URI for this install is not configured. Many major features '.
'will not work properly until you configure it.');
$message = pht(
'The base URI for this install is not configured, and major features '.
'will not work properly until you configure it.'.
"\n\n".
'You should set the base URI to the URI you will use to access '.
'Phabricator, like "http://phabricator.example.com/".'.
"\n\n".
'Include the protocol (http or https), domain name, and port number if '.
'you are using a port other than 80 (http) or 443 (https).'.
"\n\n".
'Based on this request, it appears that the correct setting is:'.
"\n\n".
'%s'.
"\n\n".
'To configure the base URI, run the command shown below.',
$base_uri_guess);
$this
->newIssue('config.phabricator.base-uri')
->setShortName(pht('No Base URI'))
->setName(pht('Base URI Not Configured'))
->setSummary($summary)
->setMessage($message)
->addCommand(
hsprintf(
'<tt>phabricator/ $</tt> %s',
csprintf(
'./bin/config set phabricator.base-uri %s',
$base_uri_guess)));
}
}