pfff_db does not work as documented #3

sebastianbergmann opened this Issue Oct 8, 2010 · 5 comments


None yet
2 participants

The documentation has this example

./pfff_db -lang php -metapath /tmp/pfff_db ~/www/

for the pfff_db tool.

However, it does not work like that for me

sb@thinkpad pfff % ./pfff_db -lang php -metapath /tmp/pfff_db /usr/local/src/phpunit/PHPUnit
./pfff_db: unknown option `-lang'.
Usage: pfff_db [options] <file or dir> 
Options are:
  -metapath <dir> (default=/tmp/pfff_db)
  -phase  <phase number>
  -pp  <cmd> optional preprocessor (e.g. xhpize)
  -xhp  parsing XHP constructs (default)
  -xhp_with_xhpize   parsing XHP using xhpize as a preprocessor
  -index_db_glimpse    <db>
  -index_db2    <db>
  -index_db3    <db>
  -debugger    option to set if launched inside ocamldebug
  -profile    gather timing information about important functions
  -verbose_level  <int> guess what
  -disable_pr2_once    to print more messages
  -show_trace_profile    show trace
  -batch_mode  no interactivity
  -version   guess what
  -date    guess what
  -help  Display this list of options
  --help  Display this list of options

Next thing I did was try it without the -lang php switch

sb@thinkpad pfff % ./pfff_db -metapath /tmp/pfff_db /usr/local/src/phpunit/PHPUnit      
/bin/sh: realpath: not found
Fatal error: exception Failure("problem with realpath")

Am I doing something wrong here? Thanks!

I figured out the

/bin/sh: realpath: not found

error. I did not have the realpath command installed.


aryx commented Oct 8, 2010

Argh. Facebook specific stuff. I'll send a fix.


aryx commented Oct 8, 2010

In the mean time you can compile this:


  • Get base path of a file. Why isn't this in the GNU tools?
  • pwd is not always adequate for this purpose.

#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

int main(int argc, char *argv[])
char path[4096];

    if(argc>1) {
            if(realpath(argv[1], path))
                    printf("%s", path);
    return 0;


and put the realpath binary somewhere in your PATH.

I just had to aptitude install realpath.

pfff_db works for me now.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment