Exemple #1
0
 public function testCanLoadEnvironmentOverrideRecursive()
 {
     $this->config->clear();
     $this->config->setEnvironment('test');
     $this->config->load('default');
     $recursive_values = $this->config->get('recursive_test');
     // test top-level of recursive replacements
     $this->assertEquals('new_value', $recursive_values['foo']);
     $this->assertEquals('test', $this->config->get('name'));
     $this->assertEquals('qux', $recursive_values['only_in_env']);
     $this->assertEquals('baz', $recursive_values['only_in_parent']);
     // test the inner recursive replacements
     $this->assertEquals('new_value', $recursive_values['bar']['baz']);
     $this->assertEquals('original', $recursive_values['bar']['qux']);
     $this->assertEquals('sting', $recursive_values['bar']['bee']);
 }
use OpenTok\OpenTok;
use OpenTok\Role;
use werx\Config\Providers\ArrayProvider;
use werx\Config\Container;
/* ------------------------------------------------------------------------------------------------
 * Slim Application Initialization
 * -----------------------------------------------------------------------------------------------*/
$app = new Slim(array('log.enabled' => true));
/* ------------------------------------------------------------------------------------------------
 * Configuration
 * -----------------------------------------------------------------------------------------------*/
$provider = new ArrayProvider('../config');
$config = new Container($provider);
// Environment Selection
$app->configureMode('development', function () use($config) {
    $config->setEnvironment('development');
});
$config->load(array('opentok'), true);
// Constants
define('NAME_MAX_LENGTH', '100');
/* ------------------------------------------------------------------------------------------------
 * OpenTok Initialization
 * -----------------------------------------------------------------------------------------------*/
$opentok = new OpenTok($config->opentok('key'), $config->opentok('secret'));
/* ------------------------------------------------------------------------------------------------
 * Routing
 * -----------------------------------------------------------------------------------------------*/
// Presence configuration
//
// Response: (JSON encoded)
// *  `apiKey`: The presence session API Key