diff --git a/scripts/aphront/aphrontpath.php b/scripts/aphront/aphrontpath.php new file mode 100755 index 0000000000..07b9d86730 --- /dev/null +++ b/scripts/aphront/aphrontpath.php @@ -0,0 +1,43 @@ +#!/usr/bin/env php +\n"; + echo "Purpose: Print controller which will process passed .\n"; + exit(1); +} + +$url = parse_url($argv[1]); +$path = '/'.(isset($url['path']) ? ltrim($url['path'], '/') : ''); + +$config_key = 'aphront.default-application-configuration-class'; +$config_class = PhabricatorEnv::getEnvConfig($config_key); +$application = newv($config_class, array()); +$mapper = new AphrontURIMapper($application->getURIMap()); + +list($controller) = $mapper->mapPath($path); +if (!$controller && $path[strlen($path) - 1] !== '/') { + list($controller) = $mapper->mapPath($path.'/'); +} +if ($controller) { + echo "$controller\n"; +}