O'Reilly logo

CouchDB and PHP Web Development Beginner's Guide by Tim Juravich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring our project

Now that we have our production database set up, our code needs to know how to connect to it. We could just alter over the hardcoded values we have in our Bones library and change it back and forth each time we want to develop locally or deploy to production. But, trust me that you don't want to go through the hassle of doing this, and more importantly, we don't want to store any usernames or passwords in our code; for this we'll use environment variables. Environment variables are a set of dynamically named values that allow you to define variables from the applications hosting environment. Let's create a class that will allow us to use environment variables so that our code is free of sensitive information and our application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required