Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling PHP Code Assist for different PECL extensions in Eclipse

I'm using a few PECL installed extensions in my PHP environment. I am developing with Eclipse and it would be useful to have Eclipse's code assist / auto-completion support for these extensions. This procedure worked quite well for the Solr extension:

  1. I additionally downloaded the latest solr-php PECL sources and put them into a separate folder.
  2. I added this certain folder as an "external folder" to one of my User Libs (Prefrences -> PHP -> PHP Libraries).
  3. I added the user lib to my project's php include path (Properties -> PHP Include Path -> Libraries -> Add Library)
  4. I immediately had the new classes/methods available in the editor's auto-completion.

The problem is: This doesn't seem to work for all extensions. E. g. for the extension adding MongoDB support to PHP. Why is that?

Comparing the folders' contents I notice that the Mongo extension is missing a php file like docs/documentation.php (which is contained in the Solr extension). Whereas all relevant *.h and *.c files are available.

Do I have to generate certain file(s) by myself?

Thanks in advance for your hints, cheers!

like image 398
proximus Avatar asked Nov 04 '22 22:11

proximus


1 Answers

Hmm... May be using sources instead of *.php classes?

Or just mongo don`t have such good piece of *.php, like in Solr.

And I think it shouldn`t have...

As I understand -- it's somekind of extension, which is not bundled with PHP by default, so then we don't have such a nice stuff, like for some php.core, when we click on realpath.

I suggest here to add some bug to mongo team and maybe to fix it by some patch, that will be analog of the solr solution. Yes -- you should add it by yourself. Ecl works with *.php files for compeletion in PHP. *.h & *.c will not helps here.

like image 95
gaRex Avatar answered Nov 09 '22 08:11

gaRex