Home php教程 php手册 PHP学习之路工欲善其事,必先利其器(Zend配置)

PHP学习之路工欲善其事,必先利其器(Zend配置)

Jun 13, 2016 am 10:42 AM
php zend personal reason study Go to Configuration

因为个人原因转到PHP已经一星期有余,熟悉了简单的语法,也可以用PHP来实现CRUD了,算是迈出第一步吧,对PHP的感觉估计也和很多人一样,简单,好上手。

  或许你可以用Dreamweaver、Notepad++或者Editplus这样的东西完成你的系统,但所谓“工欲善其事,必先利其器”,偶认为一个给力的IDE对于新手还是很必要的,而Zend作为PHPer们公认的最前IDE,自然成为了我的选择,我安装的版本是7.2.1,本文就介绍一下自己对于这个“新”工具的改造吧,最后留几个问题让高手们给解决下。

  1、更改Zend工作目录

 

  2、更改Zend字体

     依次进入Window——Preferences——General——Appearance——Colors and Fonts——Basic——Text Font进行修改,偶还是喜欢Consolas的16号:

 

 

  3、更改新建文档模板的默认设置

  默认情况下新建PHP文件自动生成的代码为:

    

  仅此一行,偶希望能新建PHP文件时可以生成闭合的PHP标签,所以依次进入Window -> Preferences -> PHP -> Editor -> Templates -> New simple PHP file修改:

 

  4、修改自动提示代码速度

  Zend是个慢性子,默认的代码提示延迟是500毫秒,显然不符合Coder们的急脾气,所以进入Window -> Preferences -> PHP -> Editor -> Content Assist ->Auto Activation,将代码自动提示的速度500设置成50:

   5、新建模板

  Zend里面已经自带了很多模板了,大家可以进到上面修改默认新建PHP文件模板的地方去逛逛,但难免还会出现不够用的情况,所以我们需要新建模板:

  注意在context中选择newphp,负责新建时无法找到模板名。

  6、更改快捷键

  这个和VS是类似的,相信大家难免对有些快捷键的键位不爽哈,比如会将Ctrl+K,C作为注释的快捷键,这明显是两只手才可以操作完成的工作,怎么快得起来哈,所以我们会进行修改,比如修改成Ctrl+E,C等,而Zend里默认加块注释是Ctrl+Shift+/,取消块注释是Ctrl+Shift+,而增加或取消单行注释,默认是切换Ctrl+/,偶依然不想两只手来操作,所以果断改掉,我改的单行注释切换是Ctrl+E,块注释是Ctrl+R,取消块注释是Ctrl+G。

  另外就是更改调试和VS的习惯一致,调试由F11改为F5,运行由Ctrl+F11改为Ctrl+F5,Step into由F5改为F11,Step Over由F6改为F10。

  以上两个部分的更改可在搜索框中输入“comment”和“debug”即可看到。

  7、安装JSEclipse

JS的提示要强大,而Zend本身自带的稍弱,这里更好的选择是安装JSEclipse插件,我们依次进入Help -> Install newsoftware
  这里有两种安装方法,一种是添加在线安装地址 http://download.macromedia.com/pub/labs/jseclipse/autoinstall,还有当然就是下载安装包到本机,进行安装,如果你解压了就选Local找到本地文件夹确定,或者你懒得解压也可以直接选Archive即可。

  一路Next,就可以安装完成了。。

  安装好要选择JSEclipse 为默认的Javascript编辑器才可以使用JSEclipse,依次进入Window -> Preferences -> General -> Editors -> File Assocaitions:

  设置“Default”即可。

  同样,代码提示也修改的快一些:

  原“outline reparsing delay(ms)”默认值为500,“Code Completion popup delay(ms)”默认值为200。

  8、窗口布局

  使用Alt+Shift+Q,V调出变量窗口,方便调试的时候跟踪相关变量的值

  另外可以调出Debug和Debug OutPut窗口,方便跟踪调试

  还在Window——Show View中调出PHP Function窗口,懒得开手册的时候可以看一眼。

    最后的布局为了看其顺眼,还是搞成了象VS的样子,其中下面一块可以最小化以增大工作区。

    9:注释心得

  大家在VS里为某个函数添加注释都会连续输入三个/,这样就可以添加函数的Summary了,偶本以为这个功能在Zend里米有,但是还是在偶然的一次注释中发现了,就是敲入/**,然后回车就可以为函数添加注释了,效果如图:

  好了,以上大概就是我对Zend的改造了,最后留几个在VS中我常用,但是在Zend中还暂时未找到实现的问题,望大牛们给指点下:

  1、在VS中我会设置所有的文件全都自动换行,也就是代码一行显示不完的时候会换行显示,而不是继续显示,从而出现横向的滚动条,这样看代码拖来拖去的,很是影响代码的可读性。我现在只发现在工作区右键有个“Toggle Word Wrap”选项可以让当前页面换行显示,但是没有找到让所有文件统一全部换行的功能设置。
  2、另外,还经常用到一个“转到定义”的功能,就是在函数或者变量上右击,可以转到定义,然后就转到了函数或变量初始定义的那一行,这个在文件多的时候比较有用,但在Zend里面也没有找到。
  3、还有一个比较常见的功能就是我输入一个函数或者变量,Zend肯定会提示哈,好,假设现在我不小心点到其他什么了,比如碰到触摸板,这样因为鼠标点击的原因,智能提示框就肯定消失了对吧,这时候有没有方法可以按某个键之类的把提示框调出来,而不用把这个敲到一半的函数删掉然后从头开始输入,让提示框出现。这个在VS里面是Ctrl+J,但是在Zend里也没有找到怎么实现。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1261
29
C# Tutorial
1234
24
How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

See all articles