PHP and CouchDB Web Development will teach you the fundamentals of combining CouchDB and PHP to create a full application from conception to deployment. This book will direct you in developing a basic social network, while guiding you through some of the common pitfalls that are frequently associated with NoSQL databases.
Chapter 1, Introduction to CouchDB, provides a quick definition of NoSQL and an overview of CouchDB.
Chapter 2, Setting up your Development Environment, sets up your computer for developing an application with PHP and CouchDB.
Chapter 3, Getting Started with CouchDB and Futon, defines CouchDB documents and shows how to manage them both from the command-line and within Futon — CouchDB's built-in administration utility.
Chapter 4, Starting your Application, creates a simple PHP framework to house your application and publishes this code to GitHub.
Chapter 5, Connecting your Application to CouchDB, connects your application to CouchDB using a variety of methods, and ultimately picks the right solution for your application.
Chapter 6, Modeling Users, creates users within your application and handles document creation and authentication with CouchDB.
Chapter 7, User Profiles and Modeling Posts, perfects your user profile using Bootstrap and posts content to CouchDB.
Chapter 8, Using Design Documents for Views and Validation, explores CouchDB's exclusive use of Design Documents to improve the quality of your application.
Chapter 9, Adding Bells and Whistles to your Application, leverages existing tools to simplify and improve your application.
Chapter 10, Deploying your Application, shows your application to the world, and teaches you how to launch your application and database using a variety of Cloud services.
Bonus Chapter, Replicating your Data, finds out how to use CouchDB's replication system to scale your application as it grows.
You can download the Bonus Chapter from http://www.packtpub.com/sites/default/files/downloads/Replicating_your_Data.pdf.
You'll need a modern computer with Mac OSX. Chapter 1, Introduction to CouchDB, will provide the setup instructions for Linux and Windows machines, and the code written in this book will work on any machine. However, the majority of the command-line statements and applications that we'll use in this book are Mac OSX-specific.
This book is for beginners and intermediate PHP developers, who are 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.
In this book, you will find several headings appearing frequently.
To give clear instructions of how to complete a procedure or task, we use:
1. Action 1
2. Action 2
3. Action 3
Instructions often need some extra explanation so that they make sense, so they are followed with:
This heading explains the working of tasks or instructions that you have just completed.
You will also find some other learning aids in the book, including:
These are short multiple choice questions intended to help you test your own understanding.
These set practical challenges and give you ideas for experimenting with what you have learned.
You will also find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: " It's difficult to standardize the install
methods for Linux, because there are many different flavors and configurations."
A block of code is set as follows:
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Allow from all </Directory>
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
Any command-line input or output is written as follows:
sudo apt-get install php5 php5-dev libapache2-mod-php5 php5-curl php5-mcrypt
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this:"Start by opening Terminal".
Feedback from our readers is always welcome. Let us know what you think about this book — what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>
, and mention the book title through the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books — maybe a mistake in the text or the code — we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.