1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

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
This commit is contained in:
vrana 2012-08-09 22:11:50 -07:00
parent 64472dd7b8
commit b1b2afce95
2 changed files with 6 additions and 6 deletions

View file

@ -31,12 +31,12 @@ $path = '/'.(isset($url['path']) ? ltrim($url['path'], '/') : '');
$config_key = 'aphront.default-application-configuration-class';
$application = PhabricatorEnv::newObjectFromConfig($config_key);
$mapper = new AphrontURIMapper($application->getURIMap());
$application->setRequest(new AphrontRequest('', $path));
list($controller) = $mapper->mapPath($path);
if (!$controller && $path[strlen($path) - 1] !== '/') {
list($controller) = $mapper->mapPath($path.'/');
list($controller) = $application->buildControllerForPath($path);
if (!$controller && substr($path, -1) !== '/') {
list($controller) = $application->buildControllerForPath($path.'/');
}
if ($controller) {
echo "$controller\n";
echo get_class($controller) . "\n";
}

View file

@ -149,7 +149,7 @@ abstract class AphrontApplicationConfiguration {
* parameters.
* @task routing
*/
private function buildControllerForPath($path) {
final public function buildControllerForPath($path) {
$maps = array();
$maps[] = array(null, $this->getURIMap());