Zend Studio 中 PHP 扩展的代码完成?

发布于 2024-07-27 14:49:52 字数 135 浏览 3 评论 0原文

从 PECL 安装 HTTP 扩展后,我希望 Zend Studio 6 能够识别提供的 HTTP* 类并提供代码补全。 然而,情况并非如此。 如何让 Zend Studio 识别 PHP 扩展提供的类? 具体来说,我希望能够在这些类上使用代码竞争。

After having installed the HTTP extension from PECL, I expected Zend Studio 6 to recognize the provided HTTP* classes and for code completion to be made available. This is not the case, however. How do I get Zend Studio to recognize classes provided by PHP extensions? Specifcally, I want to be able to use code competition on these classes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

伪装你 2024-08-03 14:49:52

我使用了 Michael Spector 的 phpgenerator.php 脚本。 它会在您的电脑上生成一个包含已加载扩展的 php 文档文件夹。 然后可以将文档路径添加到 Eclipse (Zend Studio) 包含路径中。 代码完成功能就像一个魅力。

用法:

console: php phpgenerator.php $path_to_doc_output

http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.pdt/plugins/org.eclipse.php.core/Resources/language/?root=Tools_Project

  • 该脚本可用于生成 PDT 的 PHP 模型。
  • 它根据运行PHP时加载的扩展来构建PHP函数,
  • 使用从 PHP.net 文档收集的补充信息
    *
  • @作者迈克尔·斯佩克特

I used the phpgenerator.php script from Michael Spector. It generates a php documentation folder with the loaded extensions on your pc. Afterwards the doc path can be added to the Eclipse (Zend Studio) include path. Code Completion works like a charm.

usage:

console: php phpgenerator.php $path_to_doc_output

http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.pdt/plugins/org.eclipse.php.core/Resources/language/?root=Tools_Project

  • This script can be used for generating PHP model for PDT.
  • It builds PHP functions according to the loaded extensions in running PHP,
  • using complementary information gathered from PHP.net documentation
    *
  • @author Michael Spector
牵你手 2024-08-03 14:49:52

在 Eclipse 中,Zend Studio 与它共享代码,因此它可能会有所帮助,是“PHP Include Path”。
“PHP 包含路径”位于项目资源管理器中。
您可以在其中添加扩展程序所在的目录。 然后 Eclipse 将扫描它,您就可以完成代码了。

我对 PhpUnit2 也做了同样的事情。

In Eclipse, with which Zend Studio shares code, so it might help, is the "PHP Include Path".
"PHP Include Path" is in the project explorer.
There you can add the directory where the extensions are. Then Eclipse will scan it and you will be able to code-complete.

I did the same with PhpUnit2.

樱花落人离去 2024-08-03 14:49:52

我不熟悉 Eclipse,但如果它的工作方式与 Netbeans 处理 PHP 扩展的方式相同,则您需要 将相关的 PHP 存根文件添加到 IDE 的搜索路径

I'm not familiar with Eclipse, but if it works in the same way as Netbeans handles PHP extensions, you'll need to add the relevant stub PHP files to the IDE's search path.

风苍溪 2024-08-03 14:49:52

您可以通过将带有存根函数描述的 PHP 文件放入特殊目录来向 Studio 添加函数。 通过以下方式在文件系统中找到该目录:编写类似 gmdate() 的内容,选择名称并按 F3。 您将被带到原型文件之一。 请记下此文件所在的目录(如果将鼠标悬停在选项卡上,则显示在顶部)。 现在,您需要为缺少的函数创建存根,就像您正在查看的函数一样。 通常,您可以将它们放入任何文件中,但我建议将它们放入单独的文件中 - 例如 geoip.php - 并将该文件放入该目录中。 如果您需要如何正确执行此操作的示例,您可能还需要右键单击/在 PHP 资源管理器中显示并浏览其他原型文件。

You can add functions to Studio by putting PHP files with stub function descriptions into special directory. Find this directory in filesystem in a following way: write something like gmdate(), select the name and press F3. You will be taken to one of the prototype files. Note the directory where this file resides (shown on the top and if you hover over the tab). Now you need to create stubs for functions you are missing just like the one you're looking at. You can put them into any file, generally, but I suggest putting them into separate file - like geoip.php - and put this file into that directory. You may also want to do right-click/Show In/PHP Explorer and browse other prototype files if you need examples of how to do it right.

情话墙 2024-08-03 14:49:52

Zend 为 Zend Studio 中的所有扩展提供语言支持。

添加对不受支持的扩展提供的语言实体的支持的最有效方法肯定是创建存根(您可以自己添加此支持)。 所有支持的 PHP 实体的描述“存根”文件都可以在此目录中找到:
/.metadata/.plugins/org.eclipse.php.core/语言
(这也是您应该放置存根文件的位置)。

Zend ship language support for all the extensions in Zend Studio.

The most efficient way of adding support for language entities provided by unsupported extensions is definitely creating stubs (You can add this support yourself). The description "stub" files for all supported PHP entities can be found in this directory:
/.metadata/.plugins/org.eclipse.php.core/language
(this is also the location where you should put your stub files).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文