3 final class DiffusionPhpExternalSymbolsSource
4 extends DiffusionExternalSymbolsSource
{
6 public function executeQuery(DiffusionExternalSymbolQuery
$query) {
9 if (!$query->matchesAnyLanguage(array('php'))) {
13 $names = $query->getNames();
15 if ($query->matchesAnyType(array('function'))) {
16 $functions = get_defined_functions();
17 $functions = $functions['internal'];
19 foreach ($names as $name) {
20 if (in_array($name, $functions)) {
21 $symbols[] = $this->buildExternalSymbol()
22 ->setSymbolName($name)
23 ->setSymbolType('function')
24 ->setSource(pht('PHP'))
25 ->setLocation(pht('Manual at php.net'))
26 ->setSymbolLanguage('php')
27 ->setExternalURI('http://www.php.net/function.'.$name);
31 if ($query->matchesAnyType(array('class'))) {
32 foreach ($names as $name) {
33 if (class_exists($name, false) ||
interface_exists($name, false)) {
34 if (id(new ReflectionClass($name))->isInternal()) {
35 $symbols[] = $this->buildExternalSymbol()
36 ->setSymbolName($name)
37 ->setSymbolType('class')
38 ->setSource(pht('PHP'))
39 ->setLocation(pht('Manual at php.net'))
40 ->setSymbolLanguage('php')
41 ->setExternalURI('http://www.php.net/class.'.$name);