01PHP Core Technology and Best Practices - Contents

Preface
Chapter 1 Core Concepts of Object-Oriented Thought 7
1.1 Object-oriented "shape" and "body"
1.1.1 Object's "shape"
1.1.2 Object's "body"
1.1.3 Object and array
1.1.4 Object and class
1.2 The application of magic methods
1.2.1 The set and get methods
1.2.2 The call and callStatic methods
1.2.3 The toString method
1.3 Inheritance and polymorphism
1.3.1 The composition and inheritance of classes
1.3.2 Polymorphism in various languages
​​1.4 Interface-oriented Programming
1.4.1 The role
of the interface 1.4.2 Thinking about the PHP interface
1.5 Reflection
1.5.1 How to use the reflection API
1.5.2 What is the role of reflection
1.6 Exception and error handling
1.6.1 How to use the exception handling mechanism
1.6.2 How to look at PHP 1.6.3
Error Levels in
PHP 1.6.4 Error Handling Mechanisms in PHP
1.7 Chapter Summary
Chapter 2 Object-Oriented Design Principles 76
2.1 Five Principles of Object-Oriented Design
2.1.1 Single Responsibility Principle
2.1.2 Interface Isolation Principle
2.1.3 The Open-Closed Principle
2.1.4 The Substitution Principle
2.1.5 The Dependency Inversion Principle
2.2 An Example of an Object-Oriented Guestbook
2.3 Object-Oriented Thinking
2.4 Chapter Summary
Chapter 3 Regular Expression Basics and Applications 112
3.1 Understanding Regular Expressions
3.1 .1 Regular functions in PHP
3.1.2 The composition of regular expressions
3.1.3 The use of testing tools
3.2 Metacharacters in regular expressions
3.2.1 What are metacharacters
3.2.2 Start and end metacharacters
3.2.3 Dots 3.2.4
Quantifiers
3.3 Regular Expression Matching Rules
3.3.1 Character Groups
3.3.2 Escapes
3.3.3 Antisense
3.3.4 Branches
3.3.5 Grouping
3.3.6
Backreferences 3.3.7 Look
Around 3.3.8 Greedy Lazy Matching Pattern
3.4 Constructing Regular Expressions
3.4.1 Logical Relationships of Regular Expressions
3.4.2 Operator Priority
3.4.3 Common Patterns of Regular Expressions
3.5 Application of Regular Expressions in Actual Development 159
3.5.1 Mobile Phone Verification
3.5.2 Matching E-mail Addresses
3.5.3 The Application of Escaping in Data Security
3.5.4 URL Rewriting and Search Engine Optimization
3.5.5 Removing Blank Lines and Comments in Files
3.6 Efficiency and Optimization of Regular Expressions
3.7 This Chapter Summary 180
Chapter 4 PHP Network Technology and Application 181
4.1 Detailed Explanation of HTTP Protocol
4.1.1 HTTP Protocol and SPDY Protocol
4.1.2 How HTTP Protocol Works 182
4.1.3 HTTP Application: Simulated Watering Robot
4.1.4 Spam Defense Measures
4.2 Packet Capture Tools 201
4.2.1 Classification of Packet Capture Tools
4.2.2 Fiddler Functions and Principles
4.2.3 Installing Fiddler
4.2.4 Fiddler Basic Interface
4.2.5 Using Fiddler for HTTP Breakpoint Debugging
4.3 Socket Process Communication Mechanism and Application 212
4.3.1 Process Communication Related concepts
4.3.2 Socket demonstration: realize the interaction between server and client
4.3.3 Socket function prototype
4.3.4 Socket function in PHP 4.3.5 Socket interactive application: use Socket
to capture data Basic steps for cURL request


4.4.2 Checking
cURL errors and getting the return information .8 Network application: use cURL to crawl Tencent Weibo 4.5 Simple Mail Transfer Protocol SMTP 251 4.5.1 How SMTP Protocol Works 4.5.2 Common Commands of SMTP Protocol 4.5.3 SMTP Protocol Application: Sending Mail Using Socket .1 Introduction to WebService 4.6.2 Understanding PHPRPC Protocol 4.6.3 Implementation Mode of Web Service 4.6.4 Simple Object Access Protocol SOAP 4.6.5 Debugging Tool soapUI 4.7 Detailed Cookie Explanation 4.7.1 Basic Concept and Settings of Cookie 4.7.2 PHP and JavaScript 4.7.3 Cookie storage mechanism and application 4.7.4 Cookie cross-domain and P3P protocol 4.7.5 Local storage localStorage 4.8 Session details























4.8.2 How Session Works
4.8.3 Session Storage
4.8.4 Cookie and Session Questions and Answers
4.9 Chapter Summary
Chapter 5 PHP and Database Fundamentals 310
5.1 What is PDO
5.1.1 PDO predefined classes
5.1.2 How to use PDO
5.1. 3 PDO parameter binding and precompilation
5.1.4 PDO transaction processing
5.1.5 PDO efficiency issues
5.2 Database application optimization
5.2.1 10 principles of basic statement optimization
5.2.2 Index and performance analysis
5.2.3 Server and configuration optimization
5.2 .4 MySQL Bottlenecks and Countermeasures
5.3 Database Design
5.3.1 Normal Form and Anti-normal Form
5.3.2 Database Partitioning
5.3.3 Application of Partitioning Table
5.4 Advanced MySQL Application
5.4.1 MySQL Self-Increasing Sequence
5.4.2 MySQL View
5.4.3 MySQL Stored Procedures and Event Scheduling
5.4.4 Simulating Message Queues with MySQL
5.4.5 SQL Injection Vulnerabilities and Prevention
5.5 Chapter Summary
Chapter 6 Principles and Practices of PHP Template Engine 373
6.1 The Idea of ​​Code Layering
6.2 Implement a simple template engine skeleton
6.2.1 Build the template engine basic class skeleton
6.2.2 Compile the class skeleton
6.2.3 Test the template engine
6.3 Compile the template engine
6.3.1 Implement the variable tag
6.3.2 Implement the foreach tag
6.3.3 Implement if…else tags
6.3.4 Support for PHP native syntax
6.4 Improve template engine
6.4.1 Implementation of template caching mechanism
6.4.2 Debugging and cache cleaning
6.4.3 How to use templates
6.5 Common template engines
6.5.1 Discuz template engine
6.5. 2 Smarty template engine
6.5.3 DedeCms template engine
6.5.4 Blitz template engine
6.5.5 Some thoughts on template engine
6.6 Chapter summary
Chapter 7 PHP extension development 425
7.1 Why develop PHP extensions
7.2 Build a PHP extension framework
7.2.1 PHP source Code directory
7.2.2 ext_skel tool
7.2.3 Windows platform environment configuration
7.2.4 Linux platform environment configuration
7.2.5 PHP life cycle
7.3 Variables in PHP kernel
7.3.1 How PHP variables are stored in the kernel
7.3.2 Access macros for PHP kernel variables
7.3.3 Reference counter and copy-on-write
7.4 Analysis of HashTable in
PHP kernel 7.4.1 Data structure of PHP kernel HashTable
7.4.2 HashTable code Implementation
7.5 Zend API Explanation and Extension Writing
7.5.1 What is Zend Engine
7.5.2 Zend Engine Memory Management
7.5.3 Architecture of PHP Extension
7.5.4 Receiving Parameters Passed by User
7.5.5 Creating Variables in PHP Extension
7.5.6 In
7.5.7 Assigning variable
values ​​to PHP extensions _ Implementation of Linked List Structure 7.6.2 Creating PHP Extension Framework 7.6.3 Writing Code 7.6.4 Compile and Install Extension 7.6.5 Test Extension 7.7 Chapter Summary Chapter 8 Cache Detailed Explanation 538 8.1 Understanding Cache 8.1.1 Why Use Cache 8.1.2 Hit Rate














8.1.3 Cache update strategy
8.1.4 Maximum amount of data
cached 8.2 File cache
8.2.1 File cache mechanism
8.2.2 File cache open source product Secache
8.3 Opcode cache
8.3.1 eAccelerator download and use
8.3.2 How to view Opcode
8.4 Client cache
8.4.1 Client-side caching rules
8.4.2 Cache usage in HTTP protocol
8.4.3 HTTP caching examples
8.4.4 Application Cache in HTML 5
8.5 Web server caching
8.5.1 Apache caching
8.5.2 Nginx caching
8.6 Chapter summary
Chapter 9 Chapter Memcached Use and Practice 573
9.1 Why Use Memcached
9.2 Memcached Installation and Use
9.2.1 Install Memcached Server
9.2.2 Install Memcached Client
9.2.3 Use Memcache Extension to Access Memcached Server
9.2.4 Use Memcached to Accelerate Web Applications
9.3 Learn More Memcached
9.3.1 How Memcached Supports High Concurrency
9.3.2 Using Slab Allocation Algorithm to Save Data
9.3.3 Deleting Expired Items
9.3.4 Using LRU Algorithm to Eliminate Data
9.3.5 Memcached Multi-Thread Model
9.4 Memcached Distributed Layout Scheme
9.4.1 Common Hash Distribution
9.4.2 Consistent Hash Distribution
9.4 .3 Example of Consistent Hash Distribution Algorithm
9.5 Chapter Summary
Chapter 10 Redis Use and Practice 610
10.1 Redis Installation and Use
10.1.1 Redis Installation Steps
10.1.2 Modify Redis Configuration File
10.1.3 Run Redis Server
10.1.4 Key Related Commands
10.1.5 Data Types Supported by
Redis 10.1.6 Redis Sort Command Details
10.2 Transaction Processing
10.2.1 Transaction Processing Principle
10.2.2 Transaction Processing Implementation
10.3 Persistence
10.3.1 Memory Snapshot
10.3.2 Log Append
10.4 Master-Slave Synchronization
10.4.1 Redis master-slave synchronization principle
10.4.2 Slave side workflow
10.4.3 Master side workflow
10.5 Virtual memory
10.5.1 Configuration file information
10.5.2 Enable VM background operations
10.5.3 Redis Object and VM Pointer
10.5.4 Swap process
10.5.5 Blocking VM
10.5.6 Non-blocking VM
10.6 Extension library phpredis installation and use
10.7 Redis application Practice
10.7.1 Use message queue to publish microblog
10.7.2 Redis replaces file storage session
10.8 In-depth understanding of Redis kernel
10.8.1 Memory elimination
10.8.2 Object reference counter
10.8.3 Automatically close timeout connection
10.8.4 Clear expired data
10.9 Summary of this chapter
Chapter 11 High-performance website architecture solutions 689
11.1 How to optimize website response time
11.1.1 Throughput rate
11.1.2 Stress test
11.1.3 Persistent connection
11.2 MySQL response speed improvement plan: HandlerSocket
11.2.1 HandlerSocket working principle
11.2.2 HandlerSocket installation and Configuration
11.2.3 PHP-HandlerSocket Performance Test
11.3 MySQL Stability Improvement Scheme: Master-Slave Replication
11.3.1 How Master-Slave Replication Works
11.3.2 Master-Slave Replication Configuration
11.3.3 Connecting Master-Slave Servers
11.4 Web Application Acceleration Solution: Varnish
11.4.1 Traditional Proxy and Reverse Proxy
11.4.2 Varnish Installation and Configuration
11.4.3 Varnish Performance Testing
11.4.4 Modifying Cache Rules
11.4.5 Monitoring Varnish Running Status
11.5 Asynchronous Computing Scheme: Gearman
11.5.1 Gearman Working Principle
11.5.2 Installing Gearman and PHP Extensions
11.5.3 Using Gearman to Send Emails Asynchronously
11.6 Chapter Summary
Chapter 12 Code Debugging and test 734
12.1 Debugging PHP code
12.1.1 Debugging PHP functions
12.1.2 Breakpoint debugging and variable tracing tool Xdebug
12.2 Front-end debugging
12.2.1 Firebug debugging API
12.2.2 Debugging DOM structures
with Firebug 12.2.3 Debugging JavaScript with Firebug
12.2. 4 Debugging files on remote servers with Fiddler
12.3 Log management
12.3.1 PHP logs
12.3.2 Apache server logs
12.3.3 MySQL logs
12.4 Code performance testing techniques
12.4.1 Time point testing
12.4.2 File viewing tool WinCacheGrind
12.4.3 Performance testing considerations
12.5 Unit testing
12.5.1 Unit testing framework PHPUnit installation
12.5.2 Using PHPUnit with NetBeans Unit testing
12.5.3 Assertion functions in
PHPUnit 12.5.4 PHPUnit common methods
12.5.5 PHPUnit common annotations
12.6 Stress testing
12.6.1 Using JMeter to stress testing HTTP
12.6.2 Stress testing MySQL
12.6.3 JMeter+Badboy combined testing
12.7 Summary of this chapter
Chapter 13 Hash algorithm and database implementation 800
13.1 Hash function
13.2 Hash algorithm
13.2.1 Direct remainder method
13.2.2 Product rounding method
13.2.3 Classic Hash algorithm Times33
13.3 Hash table
13.3.1 Hash table structure
13.3.2 Using PHP Implementing Hash Tables
13.3.3 Hash Table Conflicts
13.3.4 Zipper Method for Conflict Resolution
13.4 Implementation of a small database
13.4.1 Usage of pack function
13.4.2 Usage of unpack function
13.4.3 Index file and data file
13.4.4 Database interface method
13.4.5 Source code analysis
13.4.6 Test code
13.5 Chapter summary
Chapter 14 Chapter PHP Coding Specification 836
14.1 File Format
14.1.1 File Marking
14.1.2 File and Directory Naming
14.1.3 File Directory Structure
14.2 Naming
Convention 14.2.1 Variable Naming
14.2.2 Class and Interface Naming
14.2.3 Database Naming
14.2.4 Conventions
14.3 Comment Specifications 14.3.1
Program Comments
14.3.2 File Comments
14.3.3 Class Interface Comments
14.3.4 Method and Function Comments
14.3.5 Use of Callouts
14.4 Code Style
14.4.1 Indentation and Spaces
14.4.2 Statement Line Breaks
14.4 .3 Better Habits

14.5 Chapter Summary

Download address: https://download.csdn.net/download/wang_ze/10368056

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324784322&siteId=291194637