Skip to content

Commit b1b2afc

Browse files
author
vrana
committed
Support applications in aphrontpath.php
Test Plan: $ ./aphrontpath.php /diffusion/ Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3233
1 parent 64472dd commit b1b2afc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

scripts/aphront/aphrontpath.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131

3232
$config_key = 'aphront.default-application-configuration-class';
3333
$application = PhabricatorEnv::newObjectFromConfig($config_key);
34-
$mapper = new AphrontURIMapper($application->getURIMap());
34+
$application->setRequest(new AphrontRequest('', $path));
3535

36-
list($controller) = $mapper->mapPath($path);
37-
if (!$controller && $path[strlen($path) - 1] !== '/') {
38-
list($controller) = $mapper->mapPath($path.'/');
36+
list($controller) = $application->buildControllerForPath($path);
37+
if (!$controller && substr($path, -1) !== '/') {
38+
list($controller) = $application->buildControllerForPath($path.'/');
3939
}
4040
if ($controller) {
41-
echo "$controller\n";
41+
echo get_class($controller) . "\n";
4242
}

src/aphront/configuration/AphrontApplicationConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ final public function buildController() {
149149
* parameters.
150150
* @task routing
151151
*/
152-
private function buildControllerForPath($path) {
152+
final public function buildControllerForPath($path) {
153153
$maps = array();
154154
$maps[] = array(null, $this->getURIMap());
155155

0 commit comments

Comments
 (0)