[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/scripts/aphront/ -> aphrontpath.php (source)

   1  #!/usr/bin/env php
   2  <?php
   3  
   4  $root = dirname(dirname(dirname(__FILE__)));
   5  require_once $root.'/scripts/__init_script__.php';
   6  
   7  if ($argc !== 2 || $argv[1] === '--help') {
   8    echo "Usage: aphrontpath.php <url>\n";
   9    echo "Purpose: Print controller which will process passed <url>.\n";
  10    exit(1);
  11  }
  12  
  13  $url = parse_url($argv[1]);
  14  $path = '/'.(isset($url['path']) ? ltrim($url['path'], '/') : '');
  15  
  16  $config_key = 'aphront.default-application-configuration-class';
  17  $application = PhabricatorEnv::newObjectFromConfig($config_key);
  18  $application->setRequest(new AphrontRequest('', $path));
  19  
  20  list($controller) = $application->buildControllerForPath($path);
  21  if (!$controller && substr($path, -1) !== '/') {
  22    list($controller) = $application->buildControllerForPath($path.'/');
  23  }
  24  if ($controller) {
  25    echo get_class($controller)."\n";
  26  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1