mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
Jump to PHP Manual for PHP's internal classes and interfaces in symbol search
Test Plan: Clicked on `Exception` in `throw new Exception`. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1978
This commit is contained in:
parent
12973fca36
commit
ccc258fa85
1 changed files with 17 additions and 5 deletions
|
@ -65,11 +65,23 @@ final class DiffusionSymbolController extends DiffusionController {
|
|||
// For PHP builtins, jump to php.net documentation.
|
||||
if ($request->getBool('jump') && count($symbols) == 0) {
|
||||
if ($request->getStr('lang') == 'php') {
|
||||
if ($request->getStr('type') == 'function') {
|
||||
if (in_array($this->name, idx(get_defined_functions(), 'internal'))) {
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setURI('http://www.php.net/function.'.$this->name);
|
||||
}
|
||||
switch ($request->getStr('type')) {
|
||||
case 'function':
|
||||
$functions = get_defined_functions();
|
||||
if (in_array($this->name, $functions['internal'])) {
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setURI('http://www.php.net/function.'.$this->name);
|
||||
}
|
||||
break;
|
||||
case 'class':
|
||||
if (class_exists($this->name) ||
|
||||
in_array($this->name, get_declared_interfaces())) {
|
||||
if (id(new ReflectionClass($this->name))->isInternal()) {
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setURI('http://www.php.net/class.'.$this->name);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue