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 — adding our configuration file to Bones

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 other lib 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; ...

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