更新时间:2021-08-13 18:23:23
coverpage
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
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Time for action — heading
Reader feedback
Customer support
Chapter 1. Introduction to CouchDB
The NoSQL database evolution
Introduction to CouchDB
Summary
Chapter 2. Setting up your Development Environment
Operating systems
Setting up your web development environment on Mac OS X
Time for action — using Terminal to show hidden files
Time for action — opening your web browser
Time for action — checking your PHP version
Time for action — making sure that Apache can connect to PHP
Time for action — creating a quick info page
Time for action — further configuration of Apache
Time for action — installing Homebrew
Time for action — installing CouchDB
Checking that our setup is complete
Time for action — checking that CouchDB is running
Installing version control
Time for action — installing and configuring Git
Did you have any problems?
Chapter 3. Getting Started with CouchDB and Futon
What is CouchDB?
Time for action — getting a list of all databases in CouchDB
Time for action — creating new databases in CouchDB
Time for action — deleting a database In CouchDB
Time for action — creating a CouchDB document
Futon
Time for action — updating a document in Futon
Time for action — creating a document in Futon
Security
Time for action — taking CouchDB out of Admin Party
Time for action — anonymously accessing the _users database
Time for action — securing the _users database
Time for action — checking to make sure the database is secure
Time for action — accessing a database with security enabled
Chapter 4. Starting your Application
What we'll build in this book
Bones
Project setup
Time for action — creating the directories for Verge
Time for action — initializing a Git repository
Implementing basic routing
Time for action — creating our first file: index.php
Time for action — creating the .htaccess file
Time for action — hooking up our application to Bones
Time for action — creating the class structure of Bones
Time for action — creating functions to access the route on Bones creation
Time for action — creating the register function to match routes
Time for action — creating a get function in our Bones class
Time for action — creating routes for us to test against Bones
Handling layouts and views
Time for action — using constants to get the location of the working directory
Time for action — allowing Bones to store variables and the content path
Time for action — allowing our application to display a view by calling it in index.php
Time for action — creating a simple layout file
Time for action — rendering views inside of our routes
Time for action — creating views
Adding support for other HTTP methods
Time for action — retrieving the HTTP method used in a request
Time for action — altering the register to support different methods
Time for action — adding simple but powerful helpers to Bones
Adding support for complex routing
Adding support for public files
Time for action — altering .htaccess to support public files
Time for action — creating a stylesheet for the application
Publishing your code to GitHub
Get complete code from GitHub
Chapter 5. Connecting your Application to CouchDB
Before we get started
Time for action — creating a database for Verge with curl
Diving in head first
Time for action — adding an e-mail field to the signup form
Time for action — creating a standard object to encode to JSON
Time for action — creating a CouchDB document with PHP and curl
Available CouchDB libraries
Sag
Time for action — using Git to install Sag
Time for action — adding Sag to Bones
Time for action — creating a document with Sag
Time for action — including the classes directory
Time for action — creating a Base object
Time for action — creating a User object