Using Visual Studio to develop PHP graphics and text Setup method _php tips

Source: Internet
Author: User
Tags memory usage php template zend netbeans
Now, the idea of three-tier, MVC, and so on, makes code and HTML separate, and with the Division of Development and the growth of projects, a good IDE can provide a lot of convenience for coding work. Just like developing Java with Eclipse,. NET with Visual Studio, the development of PHP is also a need for such a sharp weapon. The common PHP IDE has eclipse,netbeans,zend studio,vs.php and so on. I have also used all of these, including Eclipse,netbeans,zend Studio has win and Linux version, also integrates the code sensing, debugging, design, fragments and other functions, have spent a while later found in Windows, personal feeling or vsiual Studio+vs.php is the most convenient. The main reason is speed. VS is really fast. Other Ides too much, whether from the start speed or the use of the resource consumption is better than the other 3, after all, 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, which can be paired with Visual Studio Express. After installation, you will be able to add more PHP projects to your new project in Visual Studio.

Of course, it also supports a solution, multiple projects.

vs.php automatically scans the PHP file contained in the project and loads it into the code's automatic sensing when it starts. At the same time, do not avoid loading too much of the 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, such as figure. If you want to add a sense to a file outside of the project, you can also select Add Php refence by right-clicking the item and selecting file addition support.

Need to debug, you can edit item properties, here, there is a bad place is the start page must be set, or you can not start debugging, and press F5 run debugging, is to open this start page, no way like ASP.net, run the currently open page.

You can choose the mode of debugging according to the configuration, of course, if you think some things old trouble, can also modify the vs.php configuration to once and for all. Vs.php with a apache2.2 in the installation directory, so, when you choose to debug, you can decide to use the built-in Apache or server Apache, at the same time, the installation directory has a PHP4,PHP5 directory, which can also modify the use of things, such as php.ini. If you use Xdebug to debug, it is recommended to modify the Php-xdebug.ini under PHP5, add 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; open Performance Monitor
Xdebug.profiler_output_dir= "D:/x-debuginfo"
Xdebug.default_enable = On
Xdebug.show_mem_delta=on

This way, debugging will output debugging information to D:/x-debuginfo, and then use Wincachegrind to view the execution of the CPU, memory usage, function execution time, especially convenient for performance optimization. Such as

Language Reference directory is stored in PHP function annotation, IntelliSense relies on these files, modify the annotation information inside, you can change the sense of the hint, now is all in English, do not know whether a Chinese annotation, look forward to.

In the code IntelliSense aspect, vs.php can only hit 80 points, sometimes it is 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 include statements such as Require,include, and try to load parse the file, when using the instantiated object, 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, specification-justified annotations provide great convenience for code-aware hints, especially for custom class objects. Just for example,

$this->response here, he does not know what type, so any hint will not have, but if you add a type declaration @var type, you can display the object's member information, prompts, etc.

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

In fact, many times, because this function is not reliable, this situation I still tend to output variables to view.

On the whole, individuals prefer vs.php, which is certainly a better choice than the speed and resource footprint of Zendstudio,netbeans. And I personally like using asp.net pages with smarty syntax as a php template, compared to pure HTML templates,. NET pages in Visual Studio have incomparable advantages, such as masterpage and Usercontroller, can be normal display, this for the control In terms of reuse and design, it is quite convenient. Specific template class, when the time is available to be sorted and then released.

If you're still using Notepad, Dreamweaver or something, try vs.

Related Article

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.