Muutke küpsiste eelistusi

Modern PHP [Pehme köide]

  • Formaat: Paperback / softback, 268 pages, kõrgus x laius x paksus: 234x162x15 mm, kaal: 184 g
  • Ilmumisaeg: 31-Mar-2015
  • Kirjastus: O'Reilly Media
  • ISBN-10: 1491905018
  • ISBN-13: 9781491905012
Teised raamatud teemal:
  • Pehme köide
  • Hind: 29,91 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Tavahind: 35,19 €
  • Säästad 15%
  • Raamatu kohalejõudmiseks kirjastusest kulub orienteeruvalt 2-4 nädalat
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Tellimisaeg 2-4 nädalat
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 268 pages, kõrgus x laius x paksus: 234x162x15 mm, kaal: 184 g
  • Ilmumisaeg: 31-Mar-2015
  • Kirjastus: O'Reilly Media
  • ISBN-10: 1491905018
  • ISBN-13: 9781491905012
Teised raamatud teemal:

The PHP language is different than you remember. No longer just about procedural code and monolithic frameworks, PHP has experienced a renaissance to become a full-featured, mature language with object-orientation, namespaces, and a growing collection of reusable component libraries.

Modern PHP reveals these new language features in action. Author Josh Lockhart—creator of PHP The Right Way, a popular community initiative—shows you how to develop PHP applications using best practices for application architecture and planning, databases, security, testing, debugging, and deployment.

  • Learn detailed, practical techniques that you can immediately implement in your PHP project
  • Grow your PHP skillset with the newest language features and modern best practices
  • Get up to speed on new language features of PHP 5.x (OOP, DateTime, namespaces, traits, and more)
  • Discover the latest from the PHP community, including what's new with the Hack programming language and the HipHop Virtual Machine (HHVM)

Find out how the new PHP has become a more mature language with community standards, a growing affinity for interoperable components, and a passionate community committed to improving performance.

Preface xiii
Part I. Language Features
1 The New PHP
1(4)
Past
1(1)
Present
2(1)
Future
3(2)
2 Features
5(32)
Namespaces
5(8)
Why We Use Namespaces
7(1)
Declaration
8(1)
Import and Alias
9(2)
Helpful Tips
11(2)
Code to an Interface
13(4)
Traits
17(5)
Why We Use Traits
18(1)
How to Create a Trait
19(2)
How to Use a Trait
21(1)
Generators
22(3)
Create a Generator
22(1)
Use a Generator
23(2)
Closures
25(4)
Create
25(2)
Attach State
27(2)
Zend OPcache
29(3)
Enable Zend OPcache
29(2)
Configure Zend OPcache
31(1)
Use Zend OPcache
31(1)
Built-in HTTP server
32(2)
Start the Server
32(1)
Configure the Server
33(1)
Router Scripts
33(1)
Detect the Built-in Server
34(1)
Drawbacks
34(1)
What's Next
34(3)
Part II. Good Practices
3 Standards
37(14)
PHP-FIG to the Rescue
38(1)
Framework Interoperability
38(2)
Interfaces
39(1)
Autoloading
39(1)
Style
39(1)
What Is a PSR?
40(1)
PSR-1: Basic Code Style
40(1)
PSR-2: Strict Code Style
41(4)
PSR-3: Logger Interface
45(3)
Write a PSR-3 Logger
46(1)
Use a PSR-3 Logger
47(1)
PSR-4: Autoloaders
48(3)
Why Autoloaders Are Important
48(1)
The PSR-4 Autoloader Strategy
49(1)
How to Write a PSR-4 Autoloader (and Why You Shouldn't)
49(2)
4 Components
51(24)
Why Use Components?
51(1)
What Are Components?
52(1)
Components Versus Frameworks
53(2)
Not All Frameworks Are Bad
54(1)
Use the Right Tool for the Job
55(1)
Find Components
55(2)
Shop
56(1)
Choose
56(1)
Leave Feedback
57(1)
Use PHP Components
57(9)
How to Install Composer
58(1)
How to Use Composer
59(2)
Example Project
61(3)
Composer and Private Repositories
64(2)
Create PHP Components
66(9)
Vendor and Package Names
66(1)
Namespaces
66(1)
Filesystem Organization
67(1)
The composer.json File
68(2)
The README file
70(1)
Component Implementation
71(1)
Version Control
72(1)
Packagist Submission
73(1)
Using the Component
74(1)
5 Good Practices
75(54)
Sanitize, Validate, and Escape
75(5)
Sanitize Input
76(3)
Validate Data
79(1)
Escape Output
80(1)
Passwords
80(7)
Never Know User Passwords
81(1)
Never Restrict User Passwords
81(1)
Never Email User Passwords
81(1)
Hash User Passwords with bcrypt
82(1)
Password Hashing API
82(5)
Password Hashing API for PHP < 5.5.0
87(1)
Dates, Times, and Time Zones
87(6)
Set a Default Time Zone
88(1)
The DateTime Class
88(1)
The DateInterval Class
89(2)
The DateTimeZone Class
91(1)
The DatePeriod Class
92(1)
The nesbot/carbon Component
93(1)
Databases
93(10)
The PDO Extension
93(1)
Database Connections and DSNs
93(3)
Prepared Statements
96(2)
Query Results
98(2)
Transactions
100(3)
Multibyte Strings
103(3)
Character Encoding
104(1)
Output UTF-8 Data
105(1)
Streams
106(13)
Stream Wrappers
106(3)
Stream Context
109(1)
Stream Filters
110(2)
Custom Stream Filters
112(3)
Errors and Exceptions
115(1)
Exceptions
115(3)
Exception Handlers
118(1)
Errors
119(10)
Error Handlers
121(2)
Errors and Exceptions During Development
123(1)
Production
124(5)
Part III. Deployment, Testing, and Tuning
6 Hosting
129(4)
Shared Server
129(1)
Virtual Private Server
130(1)
Dedicated Server
131(1)
PaaS
131(1)
Choose a Hosting Plan
132(1)
7 Provisioning
133(16)
Our Goal
134(1)
Server Setup
134(4)
First Login
134(1)
Software Updates
135(1)
Nonroot User
135(1)
SSH Key-Pair Authentication
136(2)
Disable Passwords and Root Login
138(1)
PHP-FPM
138(5)
Install
139(1)
Global Configuration
139(1)
Pool Configuration
140(3)
nginx
143(3)
Install
143(1)
Virtual Host
143(3)
Automate Server Provisioning
146(1)
Delegate Server Provisioning
146(1)
Further Reading
147(1)
What's Next
147(2)
8 Tuning
149(8)
The php.ini File
149(1)
Memory
150(1)
Zend OPcache
151(1)
File Uploads
152(1)
Max Execution Time
153(1)
Session Handling
154(1)
Output Buffering
155(1)
Realpath Cache
155(1)
Up Next
155(2)
9 Deployment
157(8)
Version Control
157(1)
Automate Deployment
157(1)
Make It Simple
158(1)
Make It Predictable
158(1)
Make It Reversible
158(1)
Capistrano
158(5)
How It Works
158(1)
Install
159(1)
Configure
159(2)
Authenticate
161(1)
Prepare the Remote Server
161(1)
Capistrano Hooks
162(1)
Deploy Your Application
163(1)
Roll Back Your Application
163(1)
Further Reading
163(1)
What's Next
163(2)
10 Testing
165(16)
Why Do We Test?
165(1)
When Do We Test?
166(1)
Before
166(1)
During
166(1)
After
166(1)
What Do We Test?
166(1)
How Do We Test?
167(1)
Unit Tests
167(1)
Test-Driven Development (TDD)
167(1)
Behavior-Driven Development (BDD)
167(1)
PHPUnit
168(9)
Directory Structure
169(1)
Install PHPUnit
170(1)
Install Xdebug
170(1)
Configure PHPUnit
171(1)
The Whovian Class
172(1)
The WhovianTest Test Case
173(2)
Run Tests
175(1)
Code Coverage
176(1)
Continuous Testing with Travis CI
177(1)
Setup
177(1)
Run
178(1)
Further Reading
178(1)
What's Next
179(2)
11 Profiling
181(6)
When to Use a Profiler
181(1)
Types of Profilers
181(1)
Xdebug
182(2)
Configure
182(1)
Trigger
183(1)
Analyze
183(1)
XHProf
184(2)
Install
184(1)
XHGUI
184(1)
Configure
185(1)
Trigger
185(1)
New Relic Profiler
186(1)
Blackfire Profiler
186(1)
Further Reading
186(1)
What's Next
186(1)
12 HHVM and Hack
187(18)
HHVM
187(8)
PHP at Facebook
188(1)
HHVM and Zend Engine Parity
189(1)
Is HHVM Right for Me?
190(1)
Install
190(1)
Configure
191(1)
Extensions
192(1)
Monitor HHVM with Supervisord
192(2)
HHVM, FastCGI, and Nginx
194(1)
The Hack Language
195(10)
Convert PHP to Hack
196(1)
What is a Type?
196(2)
Static Typing
198(1)
Dynamic Typing
198(1)
Hack Goes Both Ways
199(1)
Hack Type Checking
199(1)
Hack Modes
200(1)
Hack Syntax
200(2)
Hack Data Structures
202(1)
HHVM/Hack vs. PHP
203(1)
Further Reading
204(1)
13 Community
205(4)
Local PUG
205(1)
Conferences
205(1)
Mentoring
206(1)
Stay Up-to-Date
206(3)
Websites
206(1)
Mailing Lists
206(1)
Twitter
206(1)
Podcasts
206(1)
Humor
207(2)
A Installing PHP 209(20)
B Local Development Environments 229(8)
Index 237
Josh Lockhart is the creator of the Slim Framework for PHP. He also created and maintains PHP The Right Way, a popular initiative in the PHP community to encourage best practices and provide quality information. Josh is a senior developer at New Media Campaigns, a full service web design, development, and marketing agency in Carrboro, North Carolina.