Home php教程 php手册 PHP程序员都应该会用的五个工具

PHP程序员都应该会用的五个工具

Jun 13, 2016 am 10:28 AM
php code several participate Discover exist Large tool I use programmer project

在参与了几个大型PHP项目,写了很多PHP代码以后,我发现很多工具可以提高代码质量,简化发布,使得做为PHP开发人员的生涯变得轻松许多。许多这样的工具可能已经为大家所用。但是,由于一些人甚至没有注意到这些工具的存在,我会从此开始,好了,不说废话,下面是我认为所有PHP程序员应该知道的工具列表。 Phing - 一个项目构建系统

Phing 是一个基于Apache ANT 的项目构建系统。它的名字是一个拗口的语句首字母缩写 - PHing Is Not GNU make 。Phing可以做传统构建系统比如 GNU make 能做的任何事情,同时没有陡峭的学习曲线。

在phing(以及其他的构建系统)背后的思想是评估一系列相关性,然后执行一系列PHP类去正确的安装和配置一个应用系统。构建过程用一个简单的XML配置文件控制。Out of the box, phing内置可以执行一系列替换(比如:在你的开发版本和产品版本间改变include路径)、执行SQL语句、移动和复制文件、运行外部脚本等等。通过扩展包含在发行包中的“task”类,你也可以创造自己的定制任务。

对任何需要在超过一台服务器上部署大型PHP应用的人来世,Phing是一个无价之宝。同时我发现它对简单的PHP脚本也是很有用的。

Xdebug - 调试和分析工具

Xdebug 是帮助你调试和分析脚本的一个PHP扩展。Xdebug中最有用的特性是在激活后显示的新注意信息、警告信息和错误信息。如果一个脚本不能正常运行,Xdebug将会输出关于错误信息的完整堆跟踪 ,会附带函数名称、参数值、源文件和行号。这对于厌倦了PHP默认只带的可怜的错误报告功能的程序员是一个值得欢迎的特性。

这个扩展有很多更先进的功能,允许开发人员进行代码覆盖率分析,收集分析信息以及交互式地调试脚本。profiling functionality 功能尤其有用。分析器使用一个普通的输出文件格式,允许你使用象 KCacheGrind 这样的工具快速发现你代码中的瓶颈。对任何严肃的开发人员而言,一个好的分析器是基本工具,它使得你妥善优化你的代码,同时避免过早优化带来的危害。

PHPUnit - 单元测试框架

PHPUnit 是一个轻量级的PHP测试框架。它是在PHP5下面的 JUnit 3.8.1 完整移植,是xUnit 测试框架家族的一员(它们基于软件模式 先锋 Kent Beck 的设计)。

单元测试是几个现代敏捷开发方法的基础,使得PHPUnit成为许多大型PHP项目的关键工具。这个工具也可以被前面讨论的Xdebug扩展用来生成代码覆盖率报告 ,并且可以与phing集成来自动测试。

Propel - ORM(对象关系映射)框架

Propel是一个PHP5下面的对象关系映射(ORM)框架,它起源于Apache Torque项目。它提供了一个复杂但是易用的数据库抽象层,使得你可以在PHP中象使用普通类和对象一样得使用数据库实体。Propel允许你使用一种简单的XML格式定义你的数据库,这个XML文件被用来映射数据库,生成应用中使用的静态类。 

Propel被内嵌于流行的Symfony PHP框架 (还有其他的),它使得代码更灵活、模块化以及可移植。这个项目有The project has 出色的文档,以及很棒的支持社区。

phpMyAdmin / phpPgAdmin - 基于web的数据库管理系统

历史有点长可是还是很有用,phpMyAdmin是对于任何数据库(对应PostgreSQL和SQLite是phpPgAdmin 和 phpSQLiteAdmin)最有用的管理工具之一。它有助于做每一件事情 - 从为了调试应用去创建和删除数据库到做备份。安装它通常是我在一个LAMP服务器上面安装完 Apache, PHP和MySQL后做的第一件事情。如果你使用MySQL,不知何故还没听说过它,那么现在就安装 。

其他工具

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

Explain the match expression (PHP 8 ) and how it differs from switch. Explain the match expression (PHP 8 ) and how it differs from switch. Apr 06, 2025 am 12:03 AM

In PHP8, match expressions are a new control structure that returns different results based on the value of the expression. 1) It is similar to a switch statement, but returns a value instead of an execution statement block. 2) The match expression is strictly compared (===), which improves security. 3) It avoids possible break omissions in switch statements and enhances the simplicity and readability of the code.

Does H5 page production require continuous maintenance? Does H5 page production require continuous maintenance? Apr 05, 2025 pm 11:27 PM

The H5 page needs to be maintained continuously, because of factors such as code vulnerabilities, browser compatibility, performance optimization, security updates and user experience improvements. Effective maintenance methods include establishing a complete testing system, using version control tools, regularly monitoring page performance, collecting user feedback and formulating maintenance plans.

What is Cross-Site Request Forgery (CSRF) and how do you implement CSRF protection in PHP? What is Cross-Site Request Forgery (CSRF) and how do you implement CSRF protection in PHP? Apr 07, 2025 am 12:02 AM

In PHP, you can effectively prevent CSRF attacks by using unpredictable tokens. Specific methods include: 1. Generate and embed CSRF tokens in the form; 2. Verify the validity of the token when processing the request.

Why are the purple slashed areas in the Flex layout mistakenly considered 'overflow space'? Why are the purple slashed areas in the Flex layout mistakenly considered 'overflow space'? Apr 05, 2025 pm 05:51 PM

Questions about purple slash areas in Flex layouts When using Flex layouts, you may encounter some confusing phenomena, such as in the developer tools (d...

Describe the purpose and usage of the ... (splat) operator in PHP function arguments and array unpacking. Describe the purpose and usage of the ... (splat) operator in PHP function arguments and array unpacking. Apr 06, 2025 am 12:07 AM

The... (splat) operator in PHP is used to unpack function parameters and arrays, improving code simplicity and efficiency. 1) Function parameter unpacking: Pass the array element as a parameter to the function. 2) Array unpacking: Unpack an array into another array or as a function parameter.

Why does negative margins not take effect in some cases? How to solve this problem? Why does negative margins not take effect in some cases? How to solve this problem? Apr 05, 2025 pm 10:18 PM

Why do negative margins not take effect in some cases? During programming, negative margins in CSS (negative...

How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) Apr 08, 2025 am 12:03 AM

In PHP, the final keyword is used to prevent classes from being inherited and methods being overwritten. 1) When marking the class as final, the class cannot be inherited. 2) When marking the method as final, the method cannot be rewritten by the subclass. Using final keywords ensures the stability and security of your code.

Why do negative margins not take effect in some cases? Why do negative margins not take effect in some cases? Apr 05, 2025 pm 04:09 PM

Why do negative margins not take effect in some cases? When using CSS to layout web pages, you often encounter negative margins (negative...

See all articles