Adding the new configuration class to our application was pretty easy. Now, we just need to add it into our __construct()of
Bones, and we should be able to start using this class throughout our project.
1. Open up
lib/bones.php
, and look at the beginning of the file where we tell our library where to look for our otherlib
files. We need to add our configuration class here.require_once ROOT . '/lib/bootstrap.php'; require_once ROOT . '/lib/sag/src/Sag.php'; require_once ROOT . '/lib/configuration.php';
2. Let's make sure that we define
$config in
Bones' public variables so that we can use them in other files if we need to.class Bones { private static $instance; public static $route_found = false; public $route = ''; public $method = ''; public $content = ''; public $vars = array(); public $route_segments = array(); public $route_variables = array(); public $couch; public $config;
3. Let's look at the
__construct()
method a bit...