PEAR lib in Vagrant: "Undefined class"?

Hi,

I have Vagrant configured for my project. Running PHPUnit and debugging tests inside it works great from the iDE.

 

But, PhpStorm doesn't know anything about libs installed from PEAR in Vagrant. For example:

$pager = Pager::factory($pager_params); // pear lib

When I click on the `factory`, I'm not able to see its code. Hovering over `Pager` gives me "Undefined class Pager. The complition for `$pager` doesn't work.

 

How do I configure PhpStorm to load the code definition from the run env, which is Vagrant?

1 comment
Comment actions Permalink

Hi Dawid,

To be able to resolve these objects, PhpStorm has to index contents of the PHP files containing their declaration.
I'd suggest that you do the following:

  1. Share the PEAR directory on the Vagrant machine
  2. Map the share inside of the host machine (where PhpStorm runs)
  3. Include this mounted directory in Settings | Languages & Framework | PHP
0

Please sign in to leave a comment.