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

Time for action — creating a configuration class

Plugging in a simple configuration class is actually really easy for us to do because of how we've coded everything so far. Let's walk through the creation of it together.

  1. Start by creating a new configuration file called configuration.php inside our lib folder (lib/configuration.php).
  2. Now, let's create the scaffolding for our class called Configuration.
    <?php
    class Configuration {
    }
    
  3. Let's go through and create some descriptive configuration variables. We could add more, but let's just add the ones we need right now.
    <?php
    class Configuration {
    private $db_server = ';
    private $db_port = '';
    private $db_database = '';
    private $db_admin_user = '';
    private $db_admin_password = '';
    
    }
    
  4. Now, copy the login ...

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