/** * Registers services on the given app. * * This method should only be used to configure services and parameters. * It should not get services. * * @param Application $app */ public function register(Application $app) { parent::register($app); $app['dbs.config'] = $app->share(function ($app) { $app['dbs.options.initializer'](); $configs = new \Pimple(); foreach ($app['dbs.options'] as $name => $options) { $configs[$name] = new Configuration(); $configs[$name]->setSQLLogger($app['doctrine.dbal.logger.chain']); } return $configs; }); $app['doctrine.dbal.logger.chain'] = $app->share(function () use($app) { return new LoggerChain(); }); }
public function register(Application $app) { parent::register($app); $app['db.default_options'] += array('wrapperClass' => 'Tabler\\Connection', 'namespace' => ''); }
/** * @param Application $app */ public function register(Application $app) { $app['dbs.options'] = array('db' => array('driver' => 'pdo_mysql', 'dbname' => 'DATABASE_NAME', 'host' => '127.0.0.1', 'user' => 'DATABASE_USER', 'password' => 'DATABASE_PASS', 'charset' => 'utf8')); // parent::register($app); }