What are the right sources for libraries used by phabricator when setting up a local development environment?

I’m learning the codebase of phabricator to maintain a fork. But there are some functions which show up as undefined in my IDE like this function:

In the above code, getIsAdmin() shows up as undefined as seen in the screenshot below:

What are the libraries and sources I need to add to my IDE to ensure all functions show up as being defined?

https://secure.phabricator.com/w/guides/dependencies/ lists the required dependencies.

In this case, though, getIsAdmin is not a real method, it’s being faked by the ORM at run time (LiskDAO class implements __call method). The IDE is not likely to be able to find it.

https://secure.phabricator.com/book/phabcontrib/ might help you getting started…

That doesn’t sound right. If it is being generated at runtime I should be able call the method.
For instance changing the PhabricatorUser::getPolicy method to print out an error log of getIsAdmin or one of the already used faked methods like getIsSystemAgent will throw an undeclared property exception. An example of this with code used is seen below.

Traceback when adding the below line to PhabricatorUser::getPolicy and navigating to /people/manage/%d/:

phlog("User is System Agent: $this->getIsSystemAgent()");

Error Log:

I’ve already read the contribution guide, but it’s not obvious where to look to understand how it works. Reading LiskDAO or Database Schema did not help. Any guidance appreciated.

phlog("User is System Agent: $this->getIsSystemAgent()");

This is not a method call in PHP.

$ cat test.php 

class C {
  public $m = 'A';
  public function m() {
    return 'B';

$o = new C();

echo "$o->m()\n";
$ php -f test.php 

Wow that was dumb on my part :man_facepalming:. Thanks!

1 Like