How to develop PHP using VisualStudio _php Tutorial

Source: Internet
Author: User
Tags php template netbeans
Now, three layers, MVC and other ideas everywhere, so that the code and HTML can be separated, and with the development of the Division of Labor and the increase of the project, a good IDE for coding work provides a lot of convenience. Just like developing Java with Eclipse,. NET, like Visual Studio, developing PHP also requires a tool like this. The common PHP IDE has eclipse,netbeans,zend studio,vs.php and so on. I've used all of them, including Eclipse,netbeans,zend studio, which has both win and Linux versions, and integrates features like code sense, debugging, design, fragments, and so on, and it's been used for a while, and in Windows, the personal feeling is vsiual. Studio+vs.php is best. The main reason is speed. VS speed is really fast other IDE too much, whether from the start speed or the use of resources in the process is better than the other 3, after all, is Microsoft's own things.

Vs.php installed to vs in plug-in form, now out to 2.9, support visual studio2005~2010, to download the installation on the official website. The default is a 30-day trial that can be paired with VisualStudio Express. After installation, there will be more PHP projects in the new project in Visual Studio.

Of course also supports a solution for multiple projects.

vs.php automatically scans the PHP files contained in the project when it is started and loads it into the code auto-sensing. At the same time, not to avoid loading too much perceptual support, the default does not load the common PHP extension of the perceptual support, if necessary, you can right-click the project, select Add Php Module, in the list to select the extension to add. If you want to add awareness to a file outside the project, you can also select Add support by right-clicking the project, choosing Add Php refence.

If you need to debug, you can edit the project properties, here, there is a bad place is the start page must be set, otherwise it will not start debugging, and press F5 run debugging, is to open the Start page, no way to run the currently open page like ASP.

You can choose the mode of debugging and other configuration according to the need, of course, if you feel something old change trouble, you can also modify vs.php configuration to once and for all. Vs.php with a apache2.2 in the installation directory, so, choose debugging, you can decide to use the built-in Apache or server Apache, at the same time, the installation directory has PHP4,PHP5 directory, the contents can also be modified to use, such as php.ini. If you use Xdebug to debug, it is recommended to modify the Php-xdebug.ini under PHP5, add the modified

[XDebug]
Xdebug.idekey = vsphp
Xdebug.auto_trace=on
Xdebug.collect_params=on
Xdebug.collect_return=on
Xdebug.trace_output_dir= "D:/x-debuginfo"
Xdebug.profiler_enable=on; turn on Performance Monitor
Xdebug.profiler_output_dir= "D:/x-debuginfo"
Xdebug.default_enable = On
Xdebug.show_mem_delta=on

In this way, debugging will be output debugging information to D:/x-debuginfo, and then use Wincachegrind to see the CPU, memory usage, function execution time, especially convenient performance optimization. Such as

Language Reference directory is stored in the PHP function annotation, the intelligent perception relies on these files, modify the comments inside the information, you can change the sense of the hint, is now full English, do not know will not be a Chinese comment, look forward to.

In terms of code intelligence, vs.php can only hit 80 points, and sometimes it's more depressing to come out. Of course, this may be related to the distribution of classes or functions in other files, vs.php will automatically parse the containing statements such as require,include, and attempt to load parse the file, when using instantiated objects, when the current information is insufficient, Will attempt to load the file according to the settings in the project configuration properties

Just like the __autoload in PHP.

In addition, a well-defined annotation will provide great convenience for code-aware hints, particularly for custom class objects. Just for example,

$this->response here, he does not know what type, so no hint will have, but if you add a type declaration @var type, it will be normal to display the object's member information, hints, etc.

In the context of breakpoint debugging, although breakpoints are sometimes not captured, they are implemented.

In fact, many times, because this function is not reliable, this situation I would prefer to self-output variable view.

In general, individuals prefer vs.php, compared to Zendstudio,netbeans and other operating speed and resource occupancy, which is undoubtedly a better choice. And I personally like to use the Web page with smarty syntax as a php template, compared to the pure HTML template,. NET pages in VisualStudio have unparalleled advantages, such as masterpage and Usercontroller, can be displayed normally, this for the control It is quite convenient to reuse and design. Specific template class, when there is a time to clean up and release.

If you're still using Notepad, or Dreamweaver, you might want to try vs.

http://www.bkjia.com/PHPjc/322273.html www.bkjia.com true http://www.bkjia.com/PHPjc/322273.html techarticle now, three layers, MVC and other ideas everywhere, so that the code and HTML can be separated, and with the development of the Division of Labor and the increase of the project, a good IDE for the coding work to provide a lot of ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.