Upgrading to PHP 5
暫譯: 升級到 PHP 5

Adam Trachtenberg

  • 出版商: O'Reilly
  • 定價: $1,020
  • 售價: 2.0$199
  • 語言: 英文
  • 頁數: 352
  • 裝訂: Paperback
  • ISBN: 0596006365
  • ISBN-13: 9780596006365
  • 相關分類: PHP
  • 立即出貨

買這商品的人也買了...

商品描述

Description:

If you're using PHP 4, then chances are good that an upgrade to PHP 5 is in your future. The more you've heard about the exciting new features in PHP 5, the sooner that upgrade is probably going to be. Although an in-depth, soup-to-nuts reference guide to the language is good to have on hand, it's not the book an experienced PHP programmer needs to get started with the latest release. What you need is a lean and focused guide that answers your most pressing questions: what's new with the technology, what's different, and how do I make the best use of it? In other words, you need a copy of Upgrading to PHP 5.

This book is targeted toward PHP developers who are already familiar with PHP 4. Rather than serve as a definitive guide to the entire language, the book zeroes in on PHP 5's new features, and covers these features definitively. You'll find a concise appraisal of the differences between PHP 4 and PHP 5, a detailed look at what's new in this latest version, and you'll see how PHP 5 improves on PHP 4 code. See PHP 4 and PHP 5 code side-by-side, to learn how the new features make it easier to solve common PHP problems. Each new feature is shown in code, helping you understand why it's there, when to use it, and how it's better than PHP 4. Short, sample programs are included throughout the book.

Topics covered in Upgrading to PHP 5 include:


  • The new set of robust object-oriented programming features
  • An improved MySQL extension, supporting MySQL 4.1, prepared statements, and bound parameters
  • Completely rewritten support for XML: DOM, XSLT, SAX, and SimpleXML
  • Easy web services with SOAP
  • SQLite, an embedded database library bundled with PHP 5
  • Cleaner error handling with exceptions
  • Other new language features, such as iterators, streams, and more.


Upgrading to PHP 5 won't make you wade through information you've covered before. Written by Adam Trachtenberg, coauthor of the popular PHP Cookbook, this book will take you straight into the heart of all that's new in PHP 5. By the time you've finished, you'll know PHP 5 in practice as well as in theory.

 

Table of Contents:

Preface

1. Introduction

     Why PHP 5?

     What's New in PHP 5?

     Installing and Configuring PHP 5

2. Object-Oriented Programming

     What Is Object-Oriented Programming?

     Memory Management

     Basic Classes

     Class Intermediates

     Inheritance

     Magical Methods

3. MySQL

     Installing and Configuring

     Procedural Interface

     Before and After: Connecting to the Database Server

     Object-Oriented Interface

     Before and After: Querying and Retrieving Data with Prepared Statements

     Before and After: Subselects

     Transactions

     Before and After: Making Multiple Queries

     Securing Connections with SSL

     Porting Code and Migrating Databases

4. SQLite

     SQLite Basics

     Alternate SQLite Result Types

     Object-Oriented Interface

     Indexes, Error Handling, and In-Memory Tables

     Transactions

     User-Defined Functions

5. XML

     XML Extensions in PHP 5

     Installing XML and XSLT Support

     DOM

     SimpleXML

     Converting Between SimpleXML and DOM Objects

     Before and After: Reading XML into a Tree

     Before and After: Searching XML with XPath

     Reading XML as Events with SAX

     Before and After: Creating New XML Documents

     Before and After: Transforming XML with XSLT

     Validating Against a Schema

6. Iterators and SPL

     Before and After: Using Iterators

     Implementing the Iterator Interface

     MySQL Query Iterator

     Chaining Iterators

     SimpleXML Iterator

     Before and After: Recursive Directory Iteration

     Implementing the RecursiveIterator Interface

     Array and Object Property Iteration

     Redefining Class Iteration

     Iterator and SPL Classes and Interfaces

7. Error Handling and Debugging

     Before and After: Handling Errors

     The Benefits of Exceptions

     System Exceptions

     The Exception Class

     User Exceptions

     Setting a Custom Exception Handler

     Processing Errors with a Custom Handler

     Debugging Functions

8. Streams, Wrappers, and Filters

     Using the Streams API

     Wrapper Overview

     Wrapper Details

     Creating Wrappers

     Filtering Streams

     Creating Filters

9. Other Extensions

     SOAP

     Tidy

     Reflection

10. PHP 5 in Action

     Defining Your Database Schema

     The Person Class

     The addressBook Class

     The Template Class

     Assembling the Application

     Wrap-Up and Future Directions

A. Introduction to XML

B. Additional New Features and Minor Changes

C. Installing PHP 5 Alongside PHP 4

Index

商品描述(中文翻譯)

**描述:**
如果您正在使用 PHP 4,那麼升級到 PHP 5 的機會很大。您聽到的有關 PHP 5 中令人興奮的新功能越多,升級的時間就越快。雖然擁有一份深入的、全面的語言參考指南是很有幫助的,但這並不是一位經驗豐富的 PHP 程式設計師開始使用最新版本所需的書籍。您需要的是一本精簡且專注的指南,能夠回答您最迫切的問題:這項技術有什麼新內容?有什麼不同?我該如何充分利用它?換句話說,您需要一本《升級到 PHP 5》。

這本書的目標讀者是已經熟悉 PHP 4 的 PHP 開發人員。這本書並不是整個語言的權威指南,而是專注於 PHP 5 的新功能,並對這些功能進行了全面的介紹。您將找到 PHP 4 和 PHP 5 之間差異的簡明評估,詳細了解此最新版本中的新內容,並看到 PHP 5 如何改進 PHP 4 的代碼。並排查看 PHP 4 和 PHP 5 的代碼,以了解新功能如何使解決常見 PHP 問題變得更容易。每個新功能都以代碼形式展示,幫助您理解它的存在原因、何時使用以及它比 PHP 4 更好的地方。全書中包含短小的示例程式。

《升級到 PHP 5》涵蓋的主題包括:
- 新的一套強大物件導向程式設計功能
- 改進的 MySQL 擴展,支持 MySQL 4.1、預處理語句和綁定參數
- 完全重寫的 XML 支持:DOM、XSLT、SAX 和 SimpleXML
- 使用 SOAP 的簡易網路服務
- SQLite,與 PHP 5 一起捆綁的嵌入式資料庫庫
- 更乾淨的錯誤處理,使用例外
- 其他新語言功能,如迭代器、流等。

《升級到 PHP 5》不會讓您在已經學過的資訊中掙扎。這本書由《PHP 食譜》的合著者 Adam Trachtenberg 撰寫,將直接帶您進入 PHP 5 中所有新內容的核心。當您完成閱讀時,您將在實踐和理論上都了解 PHP 5。

**目錄:**
前言

1. 介紹
- 為什麼選擇 PHP 5?
- PHP 5 有什麼新內容?
- 安裝和配置 PHP 5

2. 物件導向程式設計
- 什麼是物件導向程式設計?
- 記憶體管理
- 基本類別
- 類別中介
- 繼承
- 魔法方法

3. MySQL
- 安裝和配置
- 程序介面
- 之前和之後:連接到資料庫伺服器
- 物件導向介面
- 之前和之後:使用預處理語句查詢和檢索資料
- 之前和之後:子選擇
- 交易
- 之前和之後:執行多個查詢
- 使用 SSL 保護連接
- 移植代碼和遷移資料庫

4. SQLite
- SQLite 基礎
- 替代 SQLite 結果類型
- 物件導向介面
- 索引、錯誤處理和內存表
- 交易
- 使用者定義函數

5. XML
- PHP 5 中的 XML 擴展
- 安裝 XML 和 XSLT 支持
- DOM
- SimpleXML
- 在 SimpleXML 和 DOM 物件之間轉換
- 之前和之後:將 XML 讀入樹狀結構
- 之前和之後:使用 XPath 搜尋 XML
- 使用 SAX 以事件方式讀取 XML
- 之前和之後:創建新的 XML 文件
- 之前和之後:使用 XSLT 轉換 XML
- 根據架構進行驗證

6. 迭代器和 SPL
- 之前和之後:使用迭代器
- 實現迭代器介面
- MySQL 查詢迭代器
- 迭代器鏈接
- SimpleXML 迭代器
- 之前和之後:遞歸目錄迭代
- 實現 RecursiveIterator 介面
- 陣列和物件屬性迭代
- 重新定義類別迭代
- 迭代器和 SPL 類別及介面

7. 錯誤處理和除錯
- 之前和之後:處理錯誤
- 例外的好處
- 系統例外
- 例外類別
- 使用者例外
- 設定自定義例外處理器
- 使用自定義處理器處理錯誤
- 除錯函數

8. 流、包裝器和過濾器
- 使用 Streams API
- 包裝器概述
- 包裝器詳細信息
- 創建包裝器
- 過濾流
- 創建過濾器

9. 其他擴展
- SOAP
- Tidy
- 反射

10. PHP 5 實戰
- 定義您的資料庫架構
- Person 類別
- addressBook 類別
- Template 類別
- 組裝應用程式
- 總結與未來方向

A. XML 介紹
B. 其他新功能和小變更
C. 與 PHP 4 一起安裝 PHP 5
索引