Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
PHP 7 Programming Blueprints
PHP 7 Programming Blueprints
Credits
About the Authors
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Create a User Profile System and use the Null Coalesce Operator
The null coalesce operator
Separation of Concerns
Creating views
Create a profile input form
Admin system
Summary
2. Build a Database Class and Simple Shopping Cart
Building the database abstraction class
Raw query method
Create method
Read method
Select all method
Delete method
Update method
first_of method
last_of method
iterate_over method
searchString method
Using the convert_to_json method to implement a simple API
Shopping Cart
Building the shopping items list
Item template rendering function
Adding checkboxes to the Shopping List page
Cookies in PHP
Building the Checkout page
Thank you page
Installing TCPDF
Admin for managing purchases
Summary
3. Building a Social Newsletter Service
Authentication system
Creating a social login for members
Member dashboard
Marketers dashboard
Administration system for managing marketers
Custom template for our newsletter
Link tracking
AJAX socket chat for support
Introduction to socket.io
Summary
4. Build a Simple Blog with Search Capability using Elasticsearch
Creating the CRUD and admin system
Seeding the post table
What is Elasticsearch?
Installing Elasticsearch and the PHP client
Building a PHP Elasticsearch tool
Adding documents to our Elasticsearch
Querying Elasticsearch
Installing Logstash
Setting up the Logstash configuration
Installing PHP Redis
Encoding and decoding JSON messages
Storing Apache logs in Elasticsearch
Getting filtered data to display with Highcharts
Dashboard app for viewing Elasticsearch logs
Simple search engine with result caching
Cache basics
Cache invalidation of Redis data
Using browser localStorage as cache
Working with streams
Storing and searching XML documents using PHP
Using Elasticsearch to search a social network database
Displaying randomized search engine results
Summary
5. Creating a RESTful Web Service
RESTful basics
REST architectures
Common HTTP methods and response codes
First steps with the Slim framework
Installing Slim
A small sample application
Accepting URL parameters
Accepting HTTP requests with a message body
The PSR-7 standard
Middleware
Implementing the REST service
Designing the service
Bootstrapping the project
Building the persistence layer with MongoDB
Adding and retrieving users
Listing and searching users
Deleting profiles
Validating input
Streams and large files
Profile image upload
Using GridFS storage
Summary
6. Building a Chat Application
The WebSocket protocol
First steps with Ratchet
Architectural considerations
Getting started
Testing WebSocket applications
Playing with the event loop
Implementing the chat application
Bootstrapping the project server-side
Bootstrapping the HTML user interface
Building a simple chat application
Receiving messages
Sending messages
Testing the application
Keeping the connection from timing out
Deployment options
Bridging Ratchet and PSR-7 applications
Accessing your application via the web server
Adding authentication
Creating the login form
Checking the authorization
Connecting users and messages
Summary
7. Building an Asynchronous Microservice Architecture
The target architecture
ZeroMQ patterns
Request/reply pattern
Publish/subscribe pattern
Push/pull pattern
Bootstrapping the project
Building the inventory service
Getting started with ZeroMQ REQ/REP sockets
Using JsonRPC for communication
Making the inventory service multithreaded
Building the checkout service
Using react/zmq
Working with promises
Building the mailing service
Building the shipping service
PUSH/PULL for beginners
Fan-out/fan-in
Bridging ZeroMQ and HTTP
Summary
8. Building a Parser and Interpreter for a Custom Language
How interpreters and compilers work
Languages and grammars
Your first PEG parser
Evaluating expressions
Building an Abstract Syntax Tree
Building a better interface
Evaluating variables
Adding logical expressions
Comparisons
The "and" and "or" operators
Conditions
Working with structured data
Working with objects
Optimizing the interpreter by adding a compiler
Verifying performance improvements
Summary
9. Reactive Extensions in PHP
An introduction to observables
Introduction to event loop and ReactiveX
delay
defer
Scheduler
recursive-scheduler
map and flatMap
reduce
toArray
merge
do
scan
zip
Parsing logs through a Reactive scheduler
Event queues with ReactiveX
Summary
← Prev
Back
Next →
← Prev
Back
Next →