当前位置:首页 > 工业技术
现代PHP  英文
现代PHP  英文

现代PHP 英文PDF电子书下载

工业技术

  • 电子书积分:10 积分如何计算积分?
  • 作 者:(美)洛克哈特著
  • 出 版 社:南京:东南大学出版社
  • 出版年份:2015
  • ISBN:9787564159146
  • 页数:248 页
图书介绍:PHP这门编程语言正在经历一场复兴,虽然这点从网上各种过时PHP教材还很难看出来。而在这本实用指导的帮助下,读者会看到PHP已经变成一门功能齐全、成熟的编程语言,包括支持面向对象、命名空间以及一套不断扩大的可复用组件代码库。
《现代PHP 英文》目录
标签:

Part Ⅰ.Language Features 1

1.The New PHP 1

Past 1

Present 2

Future 3

2.Features 5

Namespaces 5

Why We Use Namespaces 7

Declaration 8

Importand Alias 9

Helpful Tips 11

Code to an Interface 13

Traits 17

Why We Use Traits 18

How to Create a Trait 19

How to Use a Trait 21

Generators 22

Create a Generator 22

Use a Generator 23

Closures 25

Create 25

Attach State 27

Zend OPcache 29

Enable Zend OPcache 29

Configure Zend OPcache 31

Use Zend OPcache 31

Built-in HTTP server 32

Start the Server 32

Configure the Server 33

Router Scripts 33

Detect the Built-in Server 34

Drawbacks 34

What's Next 34

Part Ⅱ.Good Practices 34

3.Standards 37

PHP-FIG to the Rescue 38

Framework Interoperability 38

Interfaces 39

Autoloading 39

Style 39

What Is a PSR? 40

PSR-1:Basic Code Style 40

PSR-2:Strict Code Style 41

PSR-3:Logger Interface 45

Write a PSR-3 Logger 46

Use a PSR-3 Logger 47

PSR-4:Autoloaders 48

Why Autoloaders Are Important 48

The PSR-4 Autoloader Strategy 49

How to Write a PSR-4 Autoloader(and Why You Shouldn't) 49

4.Components 51

Why Use Components? 51

What Are Components? 52

Components Versus Frameworks 53

Not All Frameworks Are Bad 54

Use the Right Tool for the Job 55

Find Components 55

Shop 56

Choose 56

Leave Feedback 57

Use PHP Components 57

How to Install Composer 58

How to Use Composer 59

Example Project 61

Composer and Private Repositories 64

Create PHP Components 66

Vendor and Package Names 66

Namespaces 66

Filesystem Organization 67

The composer.json File 68

The README file 70

Component Implementation 71

Version Control 72

Packagist Submission 73

Using the Component 74

5.Good Practices 75

Sanitize,Validate,and Escape 75

Sanitize Input 76

Validate Data 79

Escape Output 80

Passwords 80

Never Know User Passwords 81

Never Restrict User Passwords 81

Never Email User Passwords 81

Hash User Passwords with bcrypt 82

Password Hashing API 82

Password Hashing API for PHP<5.5.0 87

Dates,Times,and Time Zones 87

Set a Default Time Zone 88

The DateTime Class 88

The DateInterval Class 89

The DateTimeZone Class 91

The DatePeriod Class 92

The nesbot/carbon Component 93

Databases 93

The PDO Extension 93

Database Connections and DSNs 93

Prepared Statements 96

Query Results 98

Transactions 100

Multibyte Strings 103

Character Encoding 104

Output UTF-8 Data 105

Streams 106

Stream Wrappers 106

Stream Context 109

Stream Filters 110

Custom Stream Filters 112

Errors and Exceptions 115

Exceptions 115

Exception Handlers 118

Errors 119

Error Handlers 121

Errors and Exceptions During Development 123

Production 124

Part Ⅲ.Deployment,Testing,and Tuning 124

6.Hosting 129

Shared Server 129

Virtual Private Server 130

Dedicated Server 131

PaaS 131

Choose a Hosting Plan 132

7.Provisioning 133

Our Goal 134

Server Setup 134

First Login 134

Software Updates 135

Nonroot User 135

SSH Key-Pair Authentication 136

Disable Passwords and Root Login 138

PHP-FPM 138

Install 139

Global Configuration 139

Pool Configuration 140

nginx 143

Install 143

Virtual Host 143

Automate Server Provisioning 146

Delegate Server Provisioning 146

Further Reading 147

What'sNext 147

8.Tuning 149

The phpini File 149

Memory 150

Zend OPcache 151

File Uploads 152

Max Execution Time 153

Session Handling 154

Output Buffering 155

Realpath Cache 155

Up Next 155

9.Deployment 157

Version Control 157

Automate Deployment 157

Make It Simple 158

Make It Predictable 158

Make It Reversible 158

Capistrano 158

How It Works 158

Install 159

Configure 159

Authenticate 161

Prepare the Remote Server 161

Capistrano Hooks 162

Deploy Your Application 163

Roll Back Your Application 163

Further Reading 163

What's Next 163

10.Testing 165

Why Do We Test? 165

When Do We Test? 166

Before 166

During 166

After 166

What Do We Test? 166

How Do We Test? 167

Unit Tests 167

Test-Driven Development(TDD) 167

Behavior-Driven Development(BDD) 167

PHPUnit 168

Directory Structure 169

Install PHPUnit 170

Install Xdebug 170

Configure PHPUnit 171

The Whovian Class 172

The Whovian Test Test Case 173

Run Tests 175

Code Coverage 176

Continuous Testing with Travis CI 177

Setup 177

Run 178

Further Reading 178

What's Next 179

11.Profiling 181

When to Use a Profiler 181

Types of Profilers 181

Xdebug 182

Configure 182

Trigger 183

Analyze 183

XHProf 184

Install 184

XHGUI 184

Configure 185

Trigger 185

New Relic Profiler 186

Blackfire Profiler 186

Further Reading 186

What's Next 186

12.HHVM and Hack 187

HHVM 187

PHP at Facebook 188

HHVM and Zend Engine Parity 189

Is HHVM Right for Me? 190

Install 190

Configure 191

Extensions 192

Monitor HHVM with Supervisord 192

HHVM,FastCGI,and Nginx 194

The Hack Language 195

Convert PHP to Hack 196

What is a Type? 196

Static Typing 198

Dynamic Typing 198

Hack Goes Both Ways 199

Hack Type Checking 199

Hack Modes 200

Hack Syntax 200

Hack Data Structures 202

HHVM/Hack vs.PHP 203

Further Reading 204

13.Community 205

Local PUG 205

Conferences 205

Mentoring 206

Stay Up-to-Date 206

Websites 206

Mailing Lists 206

Twitter 206

Podcasts 206

Humor 207

A.Installing PHP 209

B.Local Development Environments 229

Index 237

返回顶部