开发者

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 Librarie开发者_开发技巧s).
  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!


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.


After posting the question at mongodb's user group I got a link containing *.php doc files for the mongo php driver, which solved my problem after including them in my eclipse/pdt environment.

  • discussion at mongodb user group
  • mongo php driver doc packages

A generate.php script is offered by the pdt project, the new link was given by @ss333 below.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜