PHP 7 Programming Blueprints
eBook - ePub

PHP 7 Programming Blueprints

Jose Palala, Martin Helmich

Share book
  1. 320 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

PHP 7 Programming Blueprints

Jose Palala, Martin Helmich

Book details
Book preview
Table of contents
Citations

About This Book

Learn how to exploit the impressive power of PHP 7 with this collection of practical project blueprints – begin building better applications for the web today!

About This Book

  • Don't just learn PHP 7 – follow a diverse range of practical knowledge to get started quickly
  • Take advantage of PHP 7's newest features – and find out how to use them to solve real development challenges
  • Put PHP to work for performance and scalability – we'll show you how, you do it!

Who This Book Is For

The book is for web developers, PHP consultants, and anyone who is working on multiple projects with PHP. Basic knowledge of PHP programming is assumed.

What You Will Learn

  • Build versatile projects using the newest features PHP 7 has to offer
  • Learn how to use PHP 7's event-driven asynchronous features
  • Find out how to improve the performance of your code with effective techniques and design patterns
  • Get to grips with backend development and find out how to optimize session handling
  • Learn how to use the PHP 7 Abstract Syntax Tree to improve the quality of your code and make it more maintainable
  • Find out how to build a RESTful web service
  • Build your own asynchronous microservice

In Detail

When it comes to modern web development, performance is everything. The latest version of PHP has been improvised and updated to make it easier to build for performance, improved engine execution, better memory usage, and a new and extended set of tools. If you're a web developer, what's not to love? This guide will show you how to make full use of PHP 7 with a range of practical projects that will not only teach you the principles, but also show you how to put them into practice. It will push and extend your skills, helping you to become a more confident and fluent PHP developer.

You'll find out how to build a social newsletter service, a simple blog with a search capability using Elasticsearch, as well as a chat application. We'll also show you how to create a RESTful web service, a database class to manage a shopping cart on an e-commerce site and how to build an asynchronous microservice architecture.

With further guidance on using reactive extensions in PHP, we're sure that you'll find everything you need to take full advantage of PHP 7. So dive in now!

Style and approach

This product focuses on helping developers build projects from scratch. But more than that, each project will help the reader to learn a new facet or feature of PHP 7 – it means the reader really will ?earn by doing.'

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is PHP 7 Programming Blueprints an online PDF/ePUB?
Yes, you can access PHP 7 Programming Blueprints by Jose Palala, Martin Helmich in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Bases de datos. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785889714

PHP 7 Programming Blueprints


PHP 7 Programming Blueprints

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: September 2016
Production reference: 1160916
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78588-971-4
www.packtpub.com

Credits

Authors
Jose Palala
Martin Helmich
Copy Editor
Safis Editing
Reviewer
Shuvankar Sarkar
Project Coordinator
Ulhas Kambali
Commiss ioning Editor
Kunal Parikh
Proofreader
Safis Editing
Acq uisition Editor
Chaitanya Nair
Indexer
Rekha Nair
Content Development Editor
Onkar Wani
Production Coordinator
Melwyn Dsa
Technical Editor
Murtaza Tinwala
Cover Work
Melwyn Dsa

About the Authors

Jose Palala has been working professionally with PHP for at least 8 years. He has experience working with PHP frameworks such as Eden PHP, CodeIgniter, Laravel and Zend.
He has worked for Philippine-based IT companies for at least 8 years, working on projects ranging from internal corporate systems and CMS websites. In his spare time, he regularly contributes back to the tech community in the Philippines.
I would like to thank everyone at Packt Publishing, it’s been great working with them since Day 1. Super thanks to all to my colleagues, friends and family who have helped me to become a better developer and have helped me become what I am today.
Martin Helmich holds a Master's degree in Computer Science from the University of Applied Sciences in Osnabrück. He works as a software architect and specializes in building distributed applications using web technologies and Microservice Architectures. Besides programming in Go, PHP, Python and Node.JS, he also builds infrastructures using configuration management tools like SaltStack and container technologies like Docker.
He is an open source enthusiast and likes to make fun of people who are not using Linux. In his free time, you'll probably find him coding on one of his open source pet projects, listening to music or reading science-fiction literature.

About the Reviewer

Shuvankar Sarkar is an IT analyst and experienced in C#, .NET, PHP and web development.
He is a technology enthusiast and maintains his blog at http://shuvankar.com/. You can follow him on Twitter at @sonu041. He is interested in computer security as well.
I would like to thank my family for making my life easier and full of happiness.

www.PacktPub.com

eBooks, discount offers, and more

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com , you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
eBooks, discount offers, and more
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print, and bookmark content
  • On demand and accessible via a web browser

Preface

PHP is a great language for developing web applications. It is essentially a server-side scripting language that is also used for general-purpose programming. PHP 7 is the latest version, which provides major backward-compatibility breaks and focuses on providing improved performance and speed. With the rise in demand for high performance, this newest version contains everything you need to build efficient applications. PHP 7 provides improved engine execution, better memory usage, and a better set of tools allowing you to maintain high traffic on your websites with low-cost hardware and servers through a multithreading web server.

What this book covers

Chapter 1, Create a User Profile System and use the Null Coalesce Operator, we'll discover new PHP 7 features and build app for storing user profiles.
Chapter 2, Build a Database Class and Simple Shopping Cart, we'll create a simple database layer library which will help us access our database. We'll cover some tips on making our queries secure, and how to make our coding simpler and more succinct with PHP 7.
Chapter 3, Building a Social Newsletter Service, we'll be building a social newsletter service, which will have a way for users to sign in using their social login and allow them to register to a newsletter. We'll also make a simple admin system for managing the newsletters.
Chapter 4, Build a Simple Blog with Search Capability using Elasticsearch, you will learn how to create a blog system, experiment with ElasticSearch and how to apply it in your code. Also, you will learn how to create a simple blog application and store data into MySQL.
Chapter 5, Creating a RESTful Web Service, shows you how create a RESTful web service that can be used to manage user profiles. The service will be implemented using the Slim micro framework and use a MongoDB database for persistence. The chapter also covers the basics of RESTful web services, most importantly the common HTTP request and response methods, the PSR-7 standard and PHP 7’s new mongodb extension.
Chapter 6, Building a Chat Application, describes the implementation of a real-time chat application using WebSockets. You will learn how to use the Ratchet framework to build stand-alone WebSocket and HTTP servers with PHP and how to connect to WebSocket servers in a JavaScript client application. We will also discuss how you can implement authentication for WebSocket applications and how to deploy them in a production environment.
Chapter 7, Building an Asynchronous Microservice Architecture, covers the implementation of a (small) microservice architecture. Instead of RESTful web services, you will use ZeroMQ in this chapter for network communication, an alternative communication protocol that focuses on asynchronicity, loose coupling and high performance.
Chapter 8, Building a Parser and Interpreter for a Custom Language, describes how to use the PHP-PEG library to define a grammar and implement a parser for a custom expression language that can be used to add end-user development features to enterprise applications.
Chapter 9, Reactive Extensions in PHP, here we'll look into the Reactive extensions library for PHP, and and try to build a simple scheduled app.

What you need for this book

You’ll need to download and install PHP 7 from the official PHP website. You’ll also need to install a Webserver such as Apache or Nginx configured to run PHP 7 by default.
If you are experienced with virtual machines, you can also use Docker containers and/or Vagrant to build an environment with PHP 7 installed.

Who this book is for

The book is for web developers, PHP consultants, and anyone who is working on multiple projects with PHP. Basic knowledge of PHP programming is assumed.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database t...

Table of contents