Upgrading to 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 5》涵蓋的主題包括:





  • 一套強大的面向對象編程功能


  • 改進的 MySQL 擴展,支持 MySQL 4.1、預備語句和綁定參數


  • 完全重寫的 XML 支持:DOM、XSLT、SAX 和 SimpleXML


  • 使用 SOAP 輕鬆創建網絡服務


  • 與 PHP 5 捆綁的 SQLite 嵌入式數據庫庫


  • 更清晰的錯誤處理與異常


  • 其他新的語言功能,如迭代器、流等。



《升級到 PHP 5》不會讓您浸淫在您已經熟悉的信息中。本書由《PHP Cookbook》的合著者 Adam Trachtenberg 撰寫,將帶您深入了解 PHP 5 的所有新功能。在您完成閱讀之前,您將在實踐中以及理論上了解 PHP 5。


 



目錄:



前言



1. 簡介

     為什麼選擇 PHP 5?

 
   PHP 5 有什麼新功能?

     安裝和配置 PHP 5



2. 面向對象編程

     什麼是面向對象編程?

 
   內存管理

     基本類

   
 類的中間層

     繼承

   
 魔術方法



3. MySQL

     安裝和配置

   
 過程式接口

     之前和之後:連接到數據庫服務器

   
 面向對象接口

     之前和之後:使用預備語句查詢和檢索數據

   
 之前和之後:子查詢

     事務

   
 之前和之後:進行多個查詢

     使用 SSL 保護連接

 
   代碼移植和數據庫遷移



4. SQLite

     SQLite 基礎

   
 替代 SQLite 結果類型

   
&nbsp```