Modern PHP new features and good practices 1st Edition by Josh Lockhart – Ebook PDF Instant Download/DeliveryISBN: 1491905180, 9781491905180
Full download Modern PHP new features and good practices 1st Edition after payment.
Product details:
ISBN-10 : 1491905180
ISBN-13 : 9781491905180
Author: Josh Lockhart
PHP is experiencing a renaissance, though it may be difficult to tell with all of the outdated PHP tutorials online. With this practical guide, you’ll learn how PHP has become a full-featured, mature language with object-orientation, namespaces, and a growing collection of reusable component libraries. Author Josh Lockhart—creator of PHP The Right Way, a popular initiative to encourage PHP best practices—reveals these new language features in action. You’ll learn best practices for application architecture and planning, databases, security, testing, debugging, and deployment. If you have a basic understanding of PHP and want to bolster your skills, this is your book. Learn modern PHP features, such as namespaces, traits, generators, and closures Discover how to find, use, and create PHP components Follow best practices for application security, working with databases, errors and exceptions, and more Learn tools and techniques for deploying, tuning, testing, and profiling your PHP applications Explore Facebook’s HVVM and Hack language implementations—and how they affect modern PHP Build a local development environment that closely matches your production server
Modern PHP new features and good practices 1st Table of contents:
Part I. Language Features
Chapter 1. The New PHP
Past
Present
Future
Chapter 2. Features
Namespaces
Why We Use Namespaces
Declaration
Import and Alias
Helpful Tips
Code to an Interface
Traits
Why We Use Traits
How to Create a Trait
How to Use a Trait
Generators
Create a Generator
Use a Generator
Closures
Create
Attach State
Zend OPcache
Enable Zend OPcache
Configure Zend OPcache
Use Zend OPcache
Built-in HTTP server
Start the Server
Configure the Server
Router Scripts
Detect the Built-in Server
Drawbacks
What’s Next
Part II. Good Practices
Chapter 3. Standards
PHP-FIG to the Rescue
Framework Interoperability
Interfaces
Autoloading
Style
What Is a PSR?
PSR-1: Basic Code Style
PSR-2: Strict Code Style
PSR-3: Logger Interface
Write a PSR-3 Logger
Use a PSR-3 Logger
PSR-4: Autoloaders
Why Autoloaders Are Important
The PSR-4 Autoloader Strategy
How to Write a PSR-4 Autoloader (and Why You Shouldn’t)
Chapter 4. Components
Why Use Components?
What Are Components?
Components Versus Frameworks
Not All Frameworks Are Bad
Use the Right Tool for the Job
Find Components
Shop
Choose
Leave Feedback
Use PHP Components
How to Install Composer
How to Use Composer
Example Project
Composer and Private Repositories
Create PHP Components
Vendor and Package Names
Namespaces
Filesystem Organization
The composer.json File
The README file
Component Implementation
Version Control
Packagist Submission
Using the Component
Chapter 5. Good Practices
Sanitize, Validate, and Escape
Sanitize Input
Validate Data
Escape Output
Passwords
Never Know User Passwords
Never Restrict User Passwords
Never Email User Passwords
Hash User Passwords with bcrypt
Password Hashing API
Password Hashing API for PHP < 5.5.0
Dates, Times, and Time Zones
Set a Default Time Zone
The DateTime Class
The DateInterval Class
The DateTimeZone Class
The DatePeriod Class
The nesbot/carbon Component
Databases
The PDO Extension
Database Connections and DSNs
Prepared Statements
Query Results
Transactions
Multibyte Strings
Character Encoding
Output UTF-8 Data
Streams
Stream Wrappers
Stream Context
Stream Filters
Custom Stream Filters
Errors and Exceptions
Exceptions
Exception Handlers
Errors
Error Handlers
Errors and Exceptions During Development
Production
Part III. Deployment, Testing, and Tuning
Chapter 6. Hosting
Shared Server
Virtual Private Server
Dedicated Server
PaaS
Choose a Hosting Plan
Chapter 7. Provisioning
Our Goal
Server Setup
First Login
Software Updates
Nonroot User
SSH Key-Pair Authentication
Disable Passwords and Root Login
PHP-FPM
Install
Global Configuration
Pool Configuration
nginx
Install
Virtual Host
Automate Server Provisioning
Delegate Server Provisioning
Further Reading
What’s Next
Chapter 8. Tuning
The php.ini File
Memory
Zend OPcache
File Uploads
Max Execution Time
Session Handling
Output Buffering
Realpath Cache
Up Next
Chapter 9. Deployment
Version Control
Automate Deployment
Make It Simple
Make It Predictable
Make It Reversible
Capistrano
How It Works
Install
Configure
Authenticate
Prepare the Remote Server
Capistrano Hooks
Deploy Your Application
Roll Back Your Application
Further Reading
What’s Next
Chapter 10. Testing
Why Do We Test?
When Do We Test?
Before
During
After
What Do We Test?
How Do We Test?
Unit Tests
Test-Driven Development (TDD)
Behavior-Driven Development (BDD)
PHPUnit
Directory Structure
Install PHPUnit
Install Xdebug
Configure PHPUnit
The Whovian Class
The WhovianTest Test Case
Run Tests
Code Coverage
Continuous Testing with Travis CI
Setup
Run
Further Reading
What’s Next
Chapter 11. Profiling
When to Use a Profiler
Types of Profilers
Xdebug
Configure
Trigger
Analyze
XHProf
Install
XHGUI
Configure
Trigger
New Relic Profiler
Blackfire Profiler
Further Reading
What’s Next
Chapter 12. HHVM and Hack
HHVM
PHP at Facebook
HHVM and Zend Engine Parity
Is HHVM Right for Me?
Install
Configure
Extensions
Monitor HHVM with Supervisord
HHVM, FastCGI, and Nginx
The Hack Language
Convert PHP to Hack
What is a Type?
Static Typing
Dynamic Typing
Hack Goes Both Ways
Hack Type Checking
Hack Modes
Hack Syntax
Hack Data Structures
HHVM/Hack vs. PHP
Further Reading
Chapter 13. Community
Local PUG
Conferences
Mentoring
Stay Up-to-Date
Websites
Mailing Lists
Twitter
Podcasts
Humor
Appendix A. Installing PHP
Linux
Package Managers
Ubuntu 14.04 LTS
CentOS 7
OS X
MAMP
Homebrew
Build from Source
Get the Source Code
Windows
Binaries
WAMP
Zend Server
Appendix B. Local Development Environments
VirtualBox
Vagrant
Commands
Boxes
Initialize
Provision
Synced folders
Get started
People also search for Modern PHP new features and good practices 1st:
modern pizza review
modern solutions for modern problems
modern php
modern php frameworks
modern php tutorial
Tags: Modern PHP, new features, good practices, Josh Lockhart