Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / people / engineextension / PhabricatorPeopleDatasourceEngineExtension.php
blobdc8599554e0008bbe1d5fb484de27f54f1d63909
1 <?php
3 final class PhabricatorPeopleDatasourceEngineExtension
4 extends PhabricatorDatasourceEngineExtension {
6 public function newQuickSearchDatasources() {
7 return array(
8 new PhabricatorPeopleDatasource(),
9 );
12 public function newJumpURI($query) {
13 $viewer = $this->getViewer();
15 // Send "u" to the user directory.
16 if (preg_match('/^u\z/i', $query)) {
17 return '/people/';
20 // Send "u <string>" to the user's profile page.
21 $matches = null;
22 if (preg_match('/^u\s+(.+)\z/i', $query, $matches)) {
23 $raw_query = $matches[1];
25 // TODO: We could test that this is a valid username and jump to
26 // a search in the user directory if it isn't.
28 return urisprintf(
29 '/p/%s/',
30 $raw_query);
33 return null;