PHP code example of ray / dbal-module
1. Go to this page and download the library: Download ray/dbal-module library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ray / dbal-module example snippets
use BEAR\DbalModule\DbalModule;
use Ray\Di\AbstractModule;
class AppModule extends AbstractModule
{
protected function configure()
{
$this->install(new DbalModule('driver=pdo_sqlite&memory=true');
}
}
$this->install(new DbalModule('driver=pdo_sqlite&memory=true', 'log_db');
/**
* @Inject
* @Named("log_db")
*/
public function setLogDb(Connection $logDb)
{
$this->logDb = $logDb;
}