public function testRead() { Config::write('testing', 'not empty'); $this->assertEquals('not empty', Config::read('testing')); }
<?php require '../vendor/autoload.php'; use MemcachedManager\Config; //load configuration Config::writeBulk(require '../config/config.local.php'); Config::write('environment', getenv('APPLICATION_ENV')); // Prepare app $app = new \Slim\Slim(array('templates.path' => '../templates')); //create singleton resources $app->container->singleton('log', function () { $log = new \Monolog\Logger('slim-skeleton'); $log->pushHandler(new \Monolog\Handler\StreamHandler(getenv('LOGGING_ROOT') . '/app.log', \Monolog\Logger::DEBUG)); return $log; }); $app->container->singleton('memcached', function () { $memcached = new \MemcachedManager\Client(Config::read('memcached')); return $memcached; }); // Prepare view $app->view(new \Slim\Views\Twig()); $app->view->parserOptions = array('charset' => 'utf-8', 'cache' => realpath('../templates/cache'), 'auto_reload' => true, 'strict_variables' => false, 'autoescape' => true); $app->view->parserExtensions = array(new \Slim\Views\TwigExtension(), new \Twig_Extension_Debug()); $app->view->set('asset_path', Config::read('asset.path')); $app->view->set('environment', Config::read('environment')); $app->get('/', function () use($app) { $app->render('index.html', array('clusters' => $app->memcached->getClusters())); }); $app->group('/cluster', function () use($app) { // get cluster properties $app->get('/:clusterName', function ($clusterName) use($app) {