MongoQP\Silex\Provider\QueryProfilerServiceProvider::register PHP Метод

register() публичный Метод

public register ( Silex\Application $app )
$app Silex\Application
    public function register(Application $app)
    {
        if (!isset($app['mongo'])) {
            $app['mongo'] = $app->share(function () {
                return new \MongoClient();
            });
        }
        $app['query.profiler'] = $app->share(function () use($app) {
            $jsDir = __DIR__ . '/../../../js';
            $code = ['map' => new \MongoCode(file_get_contents($jsDir . '/map.js')), 'reduce' => new \MongoCode(file_get_contents($jsDir . '/reduce.js')), 'finalize' => new \MongoCode(file_get_contents($jsDir . '/finalize.js')), 'skeleton' => new \MongoCode(file_get_contents($jsDir . '/skeleton.js'))];
            return new QueryProfiler($app['mongo'], $code);
        });
    }
QueryProfilerServiceProvider