From 680076497c7f7b5c358e62bd00b40a1ced64c2c9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 22 Oct 2012 10:51:16 -0700 Subject: [PATCH] Add setup check to detect attempts to install on a path Summary: We don't support this and say so in the documentation, but can check explicitly. https://github.com/facebook/phabricator/issues/148 Test Plan: Set base-uri to stuff with/without paths, verified setup caught mistakes and gave useful errors. Reviewers: vrana, btrahan Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D3768 --- src/infrastructure/PhabricatorSetup.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/infrastructure/PhabricatorSetup.php b/src/infrastructure/PhabricatorSetup.php index 4b01b46484..1cf03eb2b8 100644 --- a/src/infrastructure/PhabricatorSetup.php +++ b/src/infrastructure/PhabricatorSetup.php @@ -357,6 +357,21 @@ final class PhabricatorSetup { "'http://example.com/'."); return; } + + $host_path = $host_uri->getPath(); + if ($host_path == '/') { + self::write(" okay phabricator.base-uri path\n"); + } else { + self::writeFailure(); + self::write( + "Your 'phabricator.base-uri' setting includes a path, but should ". + "not (e.g., 'http://phabricator.example.com/' is OK, but ". + "'http://example.com/phabricator/' is not). Phabricator must be ". + "installed on an entire domain, it can not be installed on a ". + "path alongside other applications. Consult the documentation ". + "for more details."); + return; + } } $timezone = nonempty(