'MongoDb', // 'host' => 'localhost', // 'database' => 'my_app' // )); /** * Uncomment this configuration to use CouchDB as your default database. */ // Connections::add('default', array( // 'type' => 'http', // 'adapter' => 'CouchDb', // 'host' => 'localhost', // 'database' => 'my_app' // )); /** * Uncomment this configuration to use MySQL as your default database. * * Strict mode can be enabled or disabled, older MySQL versions were * by default non-strict. */ // Connections::add('default', array( // 'type' => 'database', // 'adapter' => 'MySql', // 'host' => 'localhost', // 'login' => 'root', // 'password' => '', // 'database' => 'my_app', // 'encoding' => 'UTF-8', // 'strict' => false // )); $config1 = LITHIUM_APP_PATH . DS . 'config' . DS . 'db-config.php'; $config2 = NN_ROOT . 'newznab' . DS . 'config' . DS . 'config.php'; $config = file_exists($config1) ? $config1 : $config2; if (file_exists($config)) { require_once $config; switch (DB_SYSTEM) { case 'mysql': $adapter = 'MySql'; break; case 'pgsql': $adapter = 'PostgreSql'; break; default: break; } if (isset($adapter)) { $host = $port = ''; if (empty(DB_SOCKET)) { $host = DB_HOST; $port = DB_PORT; } Connections::add('default', [ 'type' => 'database', 'adapter' => $adapter, 'host' => $host, 'port' => $port, 'login' => DB_USER, 'password' => DB_PASSWORD, 'database' => DB_NAME, 'encoding' => 'UTF-8', 'persistent' => false, 'socket' => DB_SOCKET, ] ); } } else { /** throw new ErrorException("Couldn't open newznab-tmux configuration file!"); */ Connections::add('default', [ 'type' => 'database', 'adapter' => 'Mock', 'host' => 'localhost', 'port' => '3306', 'login' => 'root', 'password' => 'root_pass', 'database' => 'newznab', 'encoding' => 'UTF-8' ] ); } ?>