PHP 5 Power Programming
暫譯: PHP 5 強力程式設計

Andi Gutmans, Stig Bakken, Derick Rethans

  • 出版商: Prentice Hall
  • 出版日期: 2004-10-01
  • 售價: $2,020
  • 貴賓價: 9.5$1,919
  • 語言: 英文
  • 頁數: 720
  • 裝訂: Paperback
  • ISBN: 013147149X
  • ISBN-13: 9780131471498
  • 相關分類: PHPR 語言
  • 已過版

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

商品描述

Table of Contents:

Foreword.

Preface.

1. What Is New in PHP 5?

    Introduction.

    Language Features.

      New Object-Oriented Model.

      New Object-Oriented Features.

      Other New Language Features.

    General PHP Changes.

      XML and Web Services.

    Other New Features in PHP 5.

      New Memory Manager.

      Dropped Support for Windows 95.

    Summary.

2. PHP 5 Basic Language.

    Introduction.

    HTML Embedding.

    Comments.

    Variables.

      Indirect References to Variables.

      Managing Variables.

      Superglobals.

    Basic Data Types.

      Integers.

      Floating-Point Numbers.

      Strings.

      Booleans.

      Null.

      Arrays.

      Constants.

    Operators.

      Binary Operators.

      Assignment Operators.

      Comparison Operators.

      Logical Operators.

      Bitwise Operators.

      Unary Operators.

      Negation Operators.

      Increment/Decrement Operators.

      The Cast Operators.

      The Silence Operator.

      The One and Only Ternary Operator.

    Control Structures.

      Conditional Control Structures.

      Loop Control Structures.

      Code Inclusion Control Structures.

    Functions.

      User-Defined Functions.

      Function Scope.

      Returning Values By Value.

      Returning Values By Reference.

      Declaring Function Parameters.

      Static Variables.

    Summary.

3. PHP 5 OO Language.

    Introduction.

    Objects.

    Declaring a Class.

    The new Keyword and Constructors.

    Destructors.

    Accessing Methods and Properties Using the $this Variable.

      public, protected, and private Properties.

      public, protected, and private Methods.

      Static Properties.

      Static Methods.

    Class Constants.

     Cloning Objects.

    Polymorphism.

    parent:: and self::.

    instanceof Operator.

    Interfaces.

    Inheritance of Interfaces.

    final Methods.

    final Classes.

    __toString() Method.

    Exception Handling.

    __autoload().

    Class Type Hints in Function Parameters.

    Summary.

4. PHP 5 Advanced OOP and Design Patterns.

    Introduction.

    Overloading Capabilities.

      Property and Method Overloading.

      Overloading the Array Access Syntax.

    Iterators.

    Design Patterns.

      Strategy Pattern.

      Singleton Pattern.

      Factory Pattern.

      Observer Pattern.

    Reflection.

      Introduction.

      Reflection API.

      Reflection Examples.

      Implementing the Delegation Pattern Using Reflection.

    Summary.

5. How to Write a Web Application with PHP.

    Introduction.

    Embedding into HTML.

    User Input.

    Safe-Handling User Input.

      Common Mistakes.

    Techniques to Make Scripts "Safe".

      Input Validation.

      HMAC Verification.

      PEAR::Crypt_HMAC.

      Input Filter.

      Working with Passwords.

      Error Handling.

    Cookies.

    Sessions.

      Handling the Incoming Uploaded File.

    Architecture.

      One Script Serves All.

      One Script per Function.

      Separating Logic from Layout.

    Summary.

6. Databases with PHP 5.

    Introduction.

    MySQL.

      MySQL Strengths and Weaknesses.

      PHP Interface.

      Example Data.

      Connections.

      Buffered Versus Unbuffered Queries.

      Queries.

      Multi Statements.

      Fetching Modes.

      Prepared Statements.

      BLOB Handling.

    SQLite.

      SQLite Strengths and Weaknesses.

      Best Areas of Use.

      PHP Interface.

    PEAR DB.

      Obtaining PEAR DB.

      Pros and Cons of Database Abstraction.

      Which Features Are Abstracted?

      Database Connections.

      Executing Queries.

      Fetching Results.

      Sequences.

      Portability Features.

      Abstracted Errors.

      Convenience Methods.

    Summary.

7. Error Handling.

     Introduction.

    Types of Errors.

      Programming Errors.

      Undefined Symbols.

      Portability Errors.

      PHP Errors.

    PEAR Errors.

      The PEAR_Error Class.

      Handling PEAR Errors.

      PEAR Error Modes.

      Graceful Handling.

    Exceptions.

      What Are Exceptions?

      try, catch, and throw.

    Summary.

8. XML with PHP 5.

    Introduction.

    Vocabulary.

    Parsing XML.

      SAX.

      DOM.

    SimpleXML.

      Creating a SimpleXML Object.

      Browsing SimpleXML Objects.

      Storing SimpleXML Objects.

    PEAR.

      XML_Tree.

      XML_RSS.

    Converting XML.

      XSLT.

    Communicating with XML.

      XML-RPC.

      SOAP.

    Summary.

9. Mainstream Extensions.

    Introduction.

    Files and Streams.

      File Access.

      Program Input/Output.

      Input/Output Streams.

      Compression Streams.

      User Streams.

      URL Streams.

      Locking.

      Renaming and Removing Files.

      Temporary Files.

      Syntax.

       Functions.

    Date Handling.

      Retrieving Date and Time Information.

      Formatting Date and Time.

      Parsing Date Formats.

    Graphics Manipulation with GD.

      Case 1: Bot-Proof Submission Forms.

      Case 2: Bar Chart.

      Exif.

    Multi-Byte Strings and Character Sets.

      Character Set Conversions.

      Extra Functions Dealing with Multi-Byte Character Sets.

      Locales.

    Summary.

10. Using PEAR.

    Introduction.

    PEAR Concepts.

      Packages.

      Releases.

      Version Numbers.

    Obtaining PEAR.

      Installing with UNIX / Linux PHP Distribution.

      Installing with PHP Windows Installer.

      go-pear.org.

    Installing Packages.

      Using the pear Command.

    Configuration Parameters.

    PEAR Commands.

      pear install.

      pear list.

      pear info.

      pear list-all.

      pear list-upgrades.

      pear upgrade.

      pear upgrade-all.

      pear uninstall.

      pear search.

      pear remote-list.

      pear remote-info.

      pear download.

      pear config-get.

      pear config-show.

      Shortcuts.

    Installer Front-Ends.

      CLI (Command Line Interface) Installer.

      Gtk Installer.

    Summary.

11. Important PEAR Packages.

    Introduction.

    Database Queries.

    Template Systems.

      Template Terminology.

      HTML_Template_IT.

      HTML_Template_Flexy.

    Authentication.

      Overview.

      Example: Auth with Password File.

      Example: Auth with DB and User Data.

      Auth Security Considerations.

      Auth Scalability Considerations.

      Auth Summary.

    Form Handling.

      HTML_QuickForm.

      Example: Login Form.

      Receiving Data.

    Caching.

      Cache_Lite.

    Summary.

12. Building PEAR Components.

    Introduction.

    PEAR Standards.

      Symbol Naming.

      Indentation.

    Release Versioning.

    CLI Environment.

    Fundamentals.

      When and How to Include Files.

      Error Handling.

    Building Packages.

      PEAR Example: HelloWorld.

      Building the Tarball.

      Verification.

      Package Information.

      Release Information.

    Dependencies.

      Element: <deps>.

      Element: <dep>.

      Dependency Types.

      Reasons to Avoid Dependencies.

      Optional Dependencies.

      Some Examples.

    String Substitutions.

      Element: <replace>.

      Examples.

    Including C Code.

      Element: <configureoptions>.

      Element: <configureoption>.

    Releasing Packages.

    The PEAR Release Process.

    Packaging.

      Source Analysis.

      MD5 Checksum Generation.

      Package.xml Update.

      Tarball Creation.

    Uploading.

      Upload Release.

      Finished!

    Summary.

13. Making the Move.

    Introduction.

    The Object Model.

    Passing Objects to Functions.

    Compatibility Mode.

      Casting Objects.

      Comparing Objects.

    Other Changes.

      Assigning to $this.

      get_class.

    E_STRICT.

      Automagically Creating Objects.

      var and public.

      Constructors.

      Inherited Methods.

      Define Classes Before Usage.

      Command-Line Interface.

      Comment Tokens.

      MySQL.

    Changes in Functions.

      array_merge().

      strrpos() and strripos().

    Summary.

14. Performance.

    Introduction.

    Design for Performance.

      PHP Design Tip #1: Beware of State.

      PHP Design Tip #2: Cache!

      PHP Design Tip #3: Do Not Over Design!

    Benchmarking.

      Using ApacheBench.

      Using Siege.

      Testing Versus Real Traffic.

    Proling with Zend Studio's Proler.

    Proling with APD.

      Installing APD.

      Analyzing Trace Data.

    Proling with Xdebug.

      Installing Xdebug.

      Tracing Script Execution.

      Using Kcachegrind.

    Using APC (Advanced PHP Cache).

    Using ZPS (Zend Performance Suite).

      Automatic Optimization.

      Compiled Code Caching.

      Dynamic Content Caching.

      Content Compression.

    Optimizing Code.

      Micro-Benchmarks.

      Rewrite in.

      OO Versus Procedural Code.

    Summary.

15. An Introduction to Writing PHP Extensions.

    Introduction.

    Quickstart.

      Memory Management.

      Returning Values from PHP Functions.

      Adding Custom INI Directives.

      Thread-Safe Resource Manager Macros.

    Summary.

16. PHP Shell Scripting.

    Introduction.

    PHP CLI Shell Scripts.

      How CLI Differs From CGI.

      The Shell-Scripting Environment.

      Parsing Command-Line Options.

      Good Practices.

      Process Control.

      Examples.

    Summary.

A. PEAR and PECL Package Index.

    Authentication.

    Benchmarking.

    Caching.

    Configuration.

    Console.

    Database.

    Date and Time.

    Encryption.

    File Formats.

    File System.

    Gtk Components.

    HTML.

    HTTP.

    Images.

    Internationalization.

    Logging.

    Mail.

    Math.

    Networking.

    Numbers.

    Payment.

    PEAR.

    PHP.

    Processing.

    Science.

    Streams.

    Structures.

    Web Services.

    XML.

B. phpDocumentor Format Reference.

    Introduction.

    Documentation Comments.

    Tag Reference.

      abstract.

      access.

      author.

      category.

      copyright.

      deprecated.

      example.

      filesource.

      final.

      global.

      ignore.

      inheritdoc (inline).

      internal, internal (inline).

      licence.

      link.

      link (inline).

      name.

      package.

      param.

商品描述(中文翻譯)

目錄:

前言

序言

1. PHP 5 有什麼新特性?
- 介紹
- 語言特性
- 新的物件導向模型
- 新的物件導向特性
- 其他新的語言特性
- 一般 PHP 變更
- XML 和網路服務
- PHP 5 的其他新特性
- 新的記憶體管理器
- 停止支援 Windows 95
- 總結

2. PHP 5 基本語言
- 介紹
- HTML 嵌入
- 註解
- 變數
- 變數的間接引用
- 管理變數
- 超全域變數
- 基本資料類型
- 整數
- 浮點數
- 字串
- 布林值
- Null
- 陣列
- 常數
- 運算子
- 二元運算子
- 指派運算子
- 比較運算子
- 邏輯運算子
- 位元運算子
- 一元運算子
- 取反運算子
- 增量/減量運算子
- 型別轉換運算子
- 沉默運算子
- 唯一的三元運算子
- 控制結構
- 條件控制結構
- 迴圈控制結構
- 程式碼包含控制結構
- 函數
- 使用者定義函數
- 函數範圍
- 按值返回值
- 按引用返回值
- 宣告函數參數
- 靜態變數
- 總結

3. PHP 5 物件導向語言
- 介紹
- 物件
- 宣告類別
- new 關鍵字和建構子
- 解構子
- 使用 $this 變數訪問方法和屬性
- 公有、保護和私有屬性
- 公有、保護和私有方法
- 靜態屬性
- 靜態方法
- 類別常數
- 物件的複製
- 多型
- parent:: 和 self::
- instanceof 運算子
- 介面
- 介面的繼承
- final 方法
- final 類別
- __toString() 方法
- 異常處理