Visual Studio 2010 中的本机 PHP 支持?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1911254/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 04:16:23  来源:igfitidea点击:

Native PHP support in Visual Studio 2010?

phpvisual-studio-2010visual-studio

提问by Balchev

Is there any truth to the rumor that Visual Studio 2010 will natively support PHP coding?

Visual Studio 2010 将原生支持 PHP 编码的传言是否属实?

(http://www.codeplex.com/php4vs)

( http://www.codeplex.com/php4vs)

If not,what are the options?(except VS.php)

如果没有,有什么选择?(除了 VS.php)

采纳答案by Sam Harwell

Visual Studio 2010 won't have native PHP support. However, it's "relatively easy" to add some language support to Visual Studio 2010. If all you want is syntax highlighting, auto comment/uncomment, and brace matching, it could be done in one sitting by someone who knows how the new extensibility model works.

Visual Studio 2010 将不具有本机 PHP 支持。但是,向 Visual Studio 2010 添加一些语言支持“相对容易”。如果您只需要语法突出显示、自动注释/取消注释和大括号匹配,则可以由了解新扩展模型的人一次性完成作品。

After you wrote this post, I started making an add-in to show you what I mean. I downloaded the WordPress source only to note that the .php extension is registered with Expression Web 3, which does support PHP (first image).

在你写完这篇文章后,我开始制作一个插件来向你展示我的意思。我下载了 WordPress 源代码只是为了注意 .php 扩展名是在 Expression Web 3 中注册的,它确实支持 PHP(第一张图片)。

My 15 minute attempt at an extension (second image) is not as impressive, but keep in mind I startedworking on it after I answered this question. Edit:Updated to color keywords/global functions/global objects separately.

我 15 分钟的扩展尝试(第二张图片)并没有那么令人印象深刻,但请记住,我在回答这个问题后就开始研究它了。编辑:分别更新为关键字/全局函数/全局对象的颜色。

Microsoft Expression Web for PHP
(source: 280z28.org)

用于 PHP 的 Microsoft Expression Web
(来源:280z28.org

My PHP extension for Visual Studio 2010
(source: 280z28.org)

我的 Visual Studio 2010 的 PHP 扩展
(来源:280z28.org

回答by CrackerHyman

Check out CodeLobsterphp, it's free and has a very similar look and feel to visual studio plus it has IntelliSense and debugging support.

查看CodeLobsterphp,它是免费的,外观和感觉与 Visual Studio 非常相似,而且它具有 IntelliSense 和调试支持。

回答by Jakub Mí?ek

I would recommend PHP Tools for Visual Studio- new PHP integration for VS2010 and VS11.

我会推荐Visual Studio 的 PHP 工具——VS2010 和 VS11 的新 PHP 集成。

  • syntax highlightingPHP syntax highlighting
  • IntelliSense (tooltip, function assist, code completion, go to definition,...)intellisense here
  • code navigation
  • custom file extensions
  • integrated documentation
  • 语法高亮PHP 语法高亮
  • IntelliSense(工具提示、功能辅助、代码完成、转到定义、...)智能感知在这里
  • 代码导航
  • 自定义文件扩展名
  • 综合文件

Its basic features are free, it is fast and stable (preferred for me)

它的基本功能是免费的,速度快且稳定(我更喜欢)

回答by VS.Php

As far as large projects, VS.Php 2.7 improved quite a bit in handling large projects (10000+ files)

就大型项目而言,VS.Php 2.7 在处理大型项目(10000+ 个文件)方面有相当大的改进

Give it a try and let me know,

试一试,让我知道,

Juan

胡安

www.jcxsoftware.com

www.jcxsoftware.com

回答by John Farrell

It is not true that VS 2010 will natively support Php.

VS 2010 本身并不支持 PHP。

AFAIK the only options are vs.php and vs.php. ;)

AFAIK 唯一的选项是 vs.php 和 vs.php。;)

回答by Nitecon

One of my projects has over 30,000 files, that includes however images and other items, in total about 12,000 php and js scripts, VS.php looked at it and barfed. Back to netbeans for now. Netbeans is amazing in what it does including the js support but I HATE java based apps. They are way too slow and fat.

我的一个项目有超过 30,000 个文件,其中包括图像和其他项目,总共大约 12,000 个 php 和 js 脚本,VS.php 看着它并吐槽。现在回到netbeans。Netbeans 的功能非常出色,包括对 js 的支持,但我讨厌基于 Java 的应用程序。他们太慢太胖了。

回答by Bil Simser

Visual Studio has various types of support for PHP through the links, tools, and projects listed here but not "native" support (meaning install just Visual Studio and be able to create PHP projectsa and websites).

Visual Studio 通过此处列出的链接、工具和项目对 PHP 提供各种类型的支持,但不提供“本机”支持(意味着仅安装 Visual Studio 并能够创建 PHP 项目a 和网站)。

WebMatrix, another Microsoft product (free) does have native support. You can install it via the Web Platform Installerand immediately start building PHP sites from scratch or install various PHP 3rd party solutions like WordPress, Drupal, etc.

WebMatrix,另一个 Microsoft 产品(免费)确实具有本机支持。您可以通过Web Platform Installer安装它并立即开始从头开始构建 PHP 站点或安装各种 PHP 3rd 方解决方案,如 WordPress、Drupal 等。

WebMatrix also has pretty good support for MySQL (via the MySQL->Net connector, installable through the web platform installer, just search for MySQL in the Web PI tool). You cannot create new databases from within WebMatrix but you can create and edit tables and data once the database is created (just create the database through the mysql.exe command line).

WebMatrix 对 MySQL 也有很好的支持(通过 MySQL->Net 连接器,可通过 Web 平台安装程序安装,只需在 Web PI 工具中搜索 MySQL)。您不能从 WebMatrix 中创建新数据库,但您可以在创建数据库后创建和编辑表和数据(只需通过 mysql.exe 命令行创建数据库)。

回答by Shivam

You can use PHP tools for Visual Studio:

您可以为 Visual Studio 使用 PHP 工具:

PHP Tools for Visual Studio 2010, 2012, 2013

适用于 Visual Studio 2010、2012、2013 的 PHP 工具

回答by softboxkid

phpDesigner7 was the best solution for PHP

phpDesigner7 是 PHP 的最佳解决方案

回答by lola

There is PHP Language Support, created by Sam Harwell. It has basic editing features for the PHP scripting language.

PHP 语言支持,由Sam Harwell创建。它具有 PHP 脚本语言的基本编辑功能。

According to it's Visual Studio Gallery page, current editing features include:

根据它的 Visual Studio Gallery 页面,当前的编辑功能包括:

  • Syntax highlighting, including support for HTML code outside PHP tags and within documentation comments
  • Outlining support for quickly collapsing classes and functions
  • Dropdown bars listing classes and functions within the current document This extension has a relatively small feature set, but it's quite fast and usable. It was created as part of an experiment to provide editor features for multiple languages within a single document (PHP, HTML, and formatted documentation comments).
  • 语法高亮,包括支持 PHP 标签外和文档注释内的 HTML 代码
  • 概述对快速折叠类和函数的支持
  • 下拉栏列出当前文档中的类和函数 这个扩展有一个相对较小的特性集,但它非常快速和可用。它是作为实验的一部分创建的,旨在为单个文档(PHP、HTML 和格式化文档注释)中的多种语言提供编辑器功能。