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 ourlib
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 information you need to access your local CouchDB instance; mine looks similar to the following:
<?php class Configuration { private $db_server = '127.0.0.1'; private $db_port = '5984'; private $db_database = 'verge'; private...