CouchDB and PHP Web Development Beginner's Guide
eBook - ePub

CouchDB and PHP Web Development Beginner's Guide

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

CouchDB and PHP Web Development Beginner's Guide

About this book

In Detail

CouchDB is a NoSQL database which is making waves in the development world. It's the tool of choice for many PHP developers so they need to understand the robust features of CouchDB and the tools that are available to them.

CouchDB and PHP Web Development Beginner's Guide will teach you the basics and fundamentals of using CouchDB within a project. You will learn how to build an application from beginning to end, learning the difference between the "quick way" to do things, and the "right way" by looking through a variety of code examples and real world scenarios.

You will start with a walkthrough of setting up a sound development environment and then learn to create a variety of documents manually and programmatically. You will also learn how to manage their source control with Git and keep track of their progress. With each new concept, such as adding users and posts to your application, the author will take you through code step-by-step and explain how to use CouchDB's robust features. Finally, you will learn how to easily deploy your application and how to use simple replication to scale your application.

Approach

Each chapter follows the creation of a social networking application with step-by-step instructions. This means that you will have easily created a complete, working application by the end of the book.

Who this book is for

This book is for beginner and intermediate PHP developers interested in using CouchDB development in their projects. Advanced PHP developers will appreciate the familiarity of the PHP architecture and can easily learn how to incorporate CouchDB into their existing development experiences.

Trusted byΒ 375,005 students

Access to over 1 million titles for a fair monthly price.

Study more efficiently using our study tools.

CouchDB and PHP Web Development Beginner's Guide


Table of Contents

CouchDB and PHP Web Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Time for action β€” heading
What just happened?
Pop quiz β€” heading
Have a go hero β€” heading
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction to CouchDB
The NoSQL database evolution
What makes NoSQL different
Classification of NoSQL databases
CAP theorem
ACID
So what does all of that mean?
Advantages of NoSQL databases
Negatives of NoSQL databases
When you should use NoSQL databases
When you should avoid NoSQL databases
Introduction to CouchDB
The history of CouchDB
Defining CouchDB
Summary
2. Setting up your Development Environment
Operating systems
Windows
Installing Apache and PHP
Installing Git
Installing CouchDB
Linux
Installing Apache and PHP
Installing Git
Installing CouchDB
Setting up your web development environment on Mac OS X
Terminal
Time for action β€” using Terminal to show hidden files
What just happened?
Text editor
Apache
Web browser
Time for action β€” opening your web browser
What just happened?
PHP
Time for action β€” checking your PHP version
What just happened?
Time for action β€” making sure that Apache can connect to PHP
What just happened?
Time for action β€” creating a quick info page
What just happened?
Fine tuning Apache
Time for action β€” further configuration of Apache
What just happened?
Our web development setup is complete!
Installing CouchDB
Homebrew
Time for action β€” installing Homebrew
What just happened?
Time for action β€” installing CouchDB
What just happened?
Checking that our setup is complete
Starting CouchDB
Time for action β€” checking that CouchDB is running
What just happened?
Running CouchDB as a background process
Installing version control
Git
Time for action β€” installing and configuring Git
What just happened?
Did you have any problems?
Pop quiz
Summary
3. Getting Started with CouchDB and Futon
What is CouchDB?
Database server
Documents
Example of a CouchDB document
JSON format
Key-value storage
Reserved fields
RESTful JSON API
Time for action β€” getting a list of all databases in CouchDB
What just happened?
Time for action β€” creating new databases in CouchDB
What just happened?
Time for action β€” deleting a database In CouchDB
What just happened?
Time for action β€” creating a CouchDB document
What just happened?
Futon
Time for action β€” updating a document in Futon
What just happened?
Time for action β€” creating a document in Futon
What just happened?
Security
Time for action β€” taking CouchDB out of Admin Party
What just happened?
Time for action β€” anonymously accessing the _users database
What just happened?
Time for action β€” securing the _users database
What just happened?
Time for action β€” checking to make sure the database is secure
What just happened?
Time for action β€” accessing a database with security enabled
What just happened?
Pop quiz
Summary
4. Starting your Application
What we'll build in this book
Bones
Project setup
Time for action β€” creating the directories for Verge
What just happened?
Source control with Git
Time for action β€” initializing a Git repository
What just happened?
Implementing basic routing
Time for action β€” creating our first file: index.php
What just happened?
.htaccess files
Time for action β€” creating the .htaccess file
What just happened?
Hacking together URLs
Creating the skeleton of Bones
Time for action β€” hooking up our application to Bones
What just happened?
Using Bones to handle requests
Time for action β€” creating the class structure of Bones
What just happened?
Accessing the route
Time for action β€” creating functions to access the route on Bones creation
What just happened?
Matching URLs
Time for action β€” creating the register function to match routes
What just happened?
Calling the register function from our application
Time for action β€” creating a get function in our Bones class
What just happened?
Adding routes to our application
Time for action β€” creating routes for us to test against Bones
What just happened?
Testing it out!
Adding changes to Git
Handling layouts and views
Using Bones to support views and layouts
Time for action β€” using constants to get the location of the working directory
What just happened?
Time for action β€” allowing Bones to store variables and the content path
What just happened?
Time for action β€” allowing our application to display a view by calling it in index.php
What just happened?
Time for action β€” creating a simple layout file
What just happened?
Adding views to our application
Time for action β€” rendering views inside of our routes
What just happened?
Time for action β€” creating views
What just happened?
Adding changes to Git
Adding support for other HTTP methods
Time for action β€” retrieving the HTTP method used in a request
What just happened?
Time for action β€” al...

Table of contents

  1. CouchDB and PHP Web Development Beginner's Guide

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
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 990+ topics, we’ve got you covered! Learn about our mission
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 about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere β€” even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access CouchDB and PHP Web Development Beginner's Guide by Tim Juravich in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.