万本电子书0元读

万本电子书0元读

顶部广告

Expert PHP 5 Tools电子书

售       价:¥

4人正在读 | 1人评论 9.8

作       者:Dirk Merkel

出  版  社:Packt Publishing

出版时间:2010-03-30

字       数:1434.7万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Each chapter focuses on one topic, such as version control or debugging. After initially discussing essential concepts, the author takes an in-depth look at one or more tools relevant to the topic. Sample projects and plenty of well-documented code are used to work through practical application of the concepts. This book has been written for professional developers new to PHP and experienced PHP developers who want to take their skills to the next level by learning enterprise-level tools and techniques.
目录展开

Expert PHP 5 Tools

Table of Contents

Expert PHP 5 Tools

Credits

About the Author

About the Reviewers

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code for the book

Errata

Piracy

Questions

1. Coding Style and Standards

Coding standard considerations

Pros

Cons

A PHP coding standard

Formatting

PHP tags

Indenting

Line length

Line endings

Spacing

Statements

Strings

Arrays

Control structures

If-elseif-else statements

Switch statements

Class and method definitions

Naming conventions

Class names

Property and variable names

Constant names

Method and function names

Methodology

Type hinting

Separating object creation from initialization

Class files

Class names and directory structures

Visibility and access

Including source files

Comments

Inline documentation

Coding standard adherence and verification

PHP_CodeSniffer for automated checking

Installing PHP_CodeSniffer

Basic usage

Slightly advanced usage

Validating against your own coding standard

Creating the directories

The main coding standard class file

Creating Sniffs

Tokenization

Writing our first sniff

Extending existing sniffs

Automated code checks

Summary

2. Documentation with phpDocumentor

Code-level documentation

Levels of detail

Introducing phpDocumentor

Installing phpDocumentor

DocBlocks

Short and long descriptions

Tags

DocBlock templates

Tutorials

Naming conventions and how to reference tutorials

DocBook syntax

Documenting a project

Documentation without DocBlocks

Documentation with DocBlocks

phpDocumentor options

Command line reference

Config files

Browser-based interface

Tag reference

Standard tags

@access

@author

@category

@copyright

@deprecated

@example

@filesource

@global

@ignore

@internal

@license

@link

@method

@name

@package

@property

@return

@see

@since

@static

@staticvar

@subpackage

@todo

@tutorial

@uses

@var

@version

Inline tags

{@Example}

{@id}

{@internal}}

{@inheritdoc}

{@link}

{@source}

{@toc}

{@tutorial}

PHP4 elements

Custom tags

Summary

3. The Eclipse Integrated Development Environment

Why Eclipse?

Introducing PDT

Installing Eclipse

Requirements

Choosing a package

Adding the PDT plugin

Basic Eclipse concepts

Workspace

Views

Perspectives

A PDT sample project

PDT features

Editor

Syntax highlighting

Code assist

Code folding

Mark occurrences

Override indicators

Type, method, and resource navigation

Inspection

Projects and files

PHP explorer

Type hierarchy

Debugging

PDT preferences

Appearance

Code style

Formatter

Code templates

Debug

Installed debuggers

Step filtering

Workbench options

Editor

Code assist

Code folding

Hovers

Mark occurrences

Save actions

Syntax coloring

Task tags

Typing

New project layout

PHP executables

PHP interpreter

PHP manual

PHP servers

Templates

Other features

PHP function reference

Eclipse plugins

Zend Studio for Eclipse

Support

Refactoring

Code generation

PHPUnit testing

PhpDocumentor support

Zend Framework integration

Zend server integration

Summary

4. Source Code and Version Control

Common use cases

A brief history of source code control

CVS

Introducing Subversion

Client installation

Server configuration

Apache with mod_dav_svn

svnserve

Subversion concepts

Repository

Tags

Trunk

Branches

Working (Local) copy

Merging

Revisions and versions

Updating

Comparing

History/Log

Annotating code

Reverting

Committing

Subversion command reference

svn

blame

cat

changelist

checkout

cleanup

commit

copy

delete

diff

export

help

import

info

list

lock

log

merge

mergeinfo

mkdir

move

propdel

propedit

propget

proplist

propset

resolve

resolved

revert

status

switch

unlock

update

svnadmin

create

dump

svnlook

svnserve

svndumpfilter

svnversion

Creating a Subversion project

Basic version control workflow

A closer look at the repository

Data store

Layout

Branching and merging

What is a branch?

Why branch?

How to branch?

Maintaining and merging a branch

Branching workflow

UI clients

Eclipse plug-ins

TortoiseSVN

WebSVN

Subversion conventions and best practices

Customizing Subversion

Hooks

Enforcing coding standards with a pre-commit hook

Notifying developers of commits with a post-commit hook

Summary

5. Debugging

First line of defense: syntax check

Logging

Configuration options

Customizing and controlling config options: PhpIni

PhpIni example

Outputting debug information

Functions

echo(string $arg1 [, string $... ] / print(string $arg)

var_dump(mixed $expression [, mixed $expression [, $... ]]) and print_r(mixed $expression [, bool $return= false ])

highlight_string(string str [, bool return]) and highlight_file(string filename [, bool return])

get_class([object object])

get_object_vars(object object)

get_class_methods(mixed class_name)

get_class_vars(string class_name)

debug_backtrace()

debug_print_backtrace()

exit([string status]) or exit (int status)

Magic constants

Writing our own debugging class

Functional requirements

DebugException

Using DebugException

DebugException: Pros and cons

Introducing Xdebug

Installing Xdebug

Configuring Xdebug

Immediate benefits

var_dump() improved

var_dump() settings

Errors and exceptions beautified

Stack trace settings

Protection from infinite recursion

Remote debugging

Remote server debug configuration

Debugging client configuration

Summary

6. PHP Frameworks

Writing your own framework

Evaluating and choosing frameworks

Community and acceptance

Feature road map

Documentation

Code quality

Coding standards and compliance

Project fit

Easy to learn and adapt

Open source

Familiarity

Their rules

Popular PHP frameworks

Zend

CodeIgniter

Symfony

Yii

Zend Framework application

Feature list

Application skeleton

Important concepts

Bootstrapping

MVC

Application structure detail

Model: application/models/

View: application/views/

Controller: application/controllers/

Configuration: application/configs/

Library

Public

Tests

Enhancements

Adding a layout

Adding views

Adding logging

Adding a database

Adding a model

Adding a controller

Putting it all together

Summary

7. Testing

Testing methods

Black box

White box

Gray box

Types of testing

Unit testing

Integration testing

Regression testing

System testing

User acceptance testing

Introducing PHPUnit

Installing PHPUnit

String search project

BMH algorithm basics

Implementing BMH

Unit testing BoyerMooreStringSearch

The test class

Assertions

Organization

Our first unit test

Extended test class features

Fixtures

Annotations

Data providers

Exceptions

Automation: generating tests from classes

Unimplemented and skipped tests

Automation: generating classes from tests

Test-driven development

Enhancing our example with TDD

Code coverage

TestCase subclasses

Summary

8. Deploying Applications

Goals and requirements

Deploying your application

Checking out and uploading files

Displaying an under-maintenance message

Upgrading and installing files

Upgrading database schema and data

Rotating log files and updating symbolic links

Verifying the deployed application

Automating deployment

Phing

Installing Phing

Basic syntax and file structure

Tasks

Targets

Properties and property files

Types

Filters

Mappers

The project tag

Deploying a site

Separating external dependencies

Creating a build script

Environment and properties

Directory skeleton

Subversion export and checkout

Building files from templates

Maintenance page

Database backup

Database migrations

Going live

Putting it all together

Backing out

Summary

9. PHP Application Design with UML

Meta-model versus notation versus our approach

Levels of detail and purpose

Round-trip and one-way tools

Basic types of UML diagrams

Diagrams

Class diagrams

Elements of a class

Properties (Attributes)

Methods (Operations)

Static methods and properties

A class diagram example

Relationships

Association

Aggregation

Composition

Dependency

Generalization

Interfaces

Example refactored

Code generators

Sequence diagrams

Scope

A sequence diagram of the network scanner

Objects and lifelines

Methods

Creating and destroying object

Loops and conditionals

Synchronous versus asynchronous calls

Use cases

Use cases — diagrams optional

When to create use cases

Example use case

Background

Typical scenario

Example use case diagram

Actors

System boundary

Use cases

Relationships

Summary

10. Continuous Integration

The satellite systems

Version control: Subversion

Commit frequency

Testing: PHPUnit

Automation: Phing

Coding style: PHP_CodeSniffer

Documentation: PhpDocumentor

Code coverage: Xdebug

Environment setup considerations

Do I need a dedicated CI server?

Do I need a CI tool?

CI tools

XINC (Xinc Is Not CruiseControl)

phpUnderControl

Continuous integration with phpUnderControl

Installation

Installing CruiseControl

Installing phpUnderControl

Overlaying CruiseControl with phpUnderControl

CruiseControl configuration

Overview of the CI process and components

CruiseControl and project layout

Getting the project source

Configuring the project: build.xml

Configuring CruiseControl

Advanced options

Bootstrappers

Publishers

Running CruiseControl

The overview page

The tests page

Metrics

Coverage

Documentation

CodeSniffer

PHPUnit PMD

Replacing Ant with Phing

Summary

Index

累计评论(0条) 1个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部