Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/configuration/AphrontApplicationConfiguration.php
Show All 26 Lines | public function buildRequest() { | ||||
$request->setApplicationConfiguration($this); | $request->setApplicationConfiguration($this); | ||||
$request->setCookiePrefix($cookie_prefix); | $request->setCookiePrefix($cookie_prefix); | ||||
$request->updateEphemeralCookies(); | $request->updateEphemeralCookies(); | ||||
return $request; | return $request; | ||||
} | } | ||||
public function build404Controller() { | |||||
return array(new Phabricator404Controller(), array()); | |||||
} | |||||
public function buildRedirectController($uri, $external) { | public function buildRedirectController($uri, $external) { | ||||
return array( | return array( | ||||
new PhabricatorRedirectController(), | new PhabricatorRedirectController(), | ||||
array( | array( | ||||
'uri' => $uri, | 'uri' => $uri, | ||||
'external' => $external, | 'external' => $external, | ||||
), | ), | ||||
); | ); | ||||
▲ Show 20 Lines • Show All 452 Lines • ▼ Show 20 Lines | if (!preg_match('@/$@', $path) && $request->isHTTPGet()) { | ||||
} | } | ||||
} | } | ||||
$result = $site->new404Controller($request); | $result = $site->new404Controller($request); | ||||
if ($result) { | if ($result) { | ||||
return array($result, array()); | return array($result, array()); | ||||
} | } | ||||
return $this->build404Controller(); | throw new Exception( | ||||
pht( | |||||
'Aphront site ("%s") failed to build a 404 controller.', | |||||
get_class($site))); | |||||
} | } | ||||
/** | /** | ||||
* Map a specific path to the corresponding controller. For a description | * Map a specific path to the corresponding controller. For a description | ||||
* of routing, see @{method:buildController}. | * of routing, see @{method:buildController}. | ||||
* | * | ||||
* @param list<AphrontRoutingMap> List of routing maps. | * @param list<AphrontRoutingMap> List of routing maps. | ||||
* @param string Path to route. | * @param string Path to route. | ||||
▲ Show 20 Lines • Show All 365 Lines • Show Last 20 Lines |