2017 © Pedro Peláez
 

library flex-doctrine-pg

Open minded PostGres connection driver for Doctrine DBAL

image

shorock/flex-doctrine-pg

Open minded PostGres connection driver for Doctrine DBAL

  • Sunday, January 22, 2017
  • by shorock
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

A little Doctrine DBAL driver for PostgreSQL connections. Basically, we've taken to using certain options in the libpq library that Doctrine's built in DSN constructor is opinionated about. Notably, sslcert or service, whereby we can use a different SSL certificate for cert authentication to Postgres. (BTW - if you just have one cert/key per user, they can just use the canon name of ~/.postgresql/server.crt, server.key, & root.crt and you don't need this module., (*1)

If you've never used 'service', it's a lovely way to go. You can also do your command line connection with $ psql service=mydb if you set that up., (*2)

Now, if you're using Doctrine more directly, the fact that it can't handle some of these advanced configuration options isn't such a problem. Write your options into new PDO(...) and pass it to Doctrine. Not so easy if you're wanting to use something higher level (Symfony, etc)., (*3)

I'm pulling from the driverOptions array for bare Doctrine DBAL because I didn't want to add more options to the Symfony Doctrine bundle's top-level configuration schema., (*4)

Example (Symfony - config.yml)

doctrine:
    dbal:
      driver_class: Shorock\Doctrine\FlexPDOPgSql\Driver
      user: shorock
      options:
        service: libdb
    # or
    # dsn: "pgsql:dbname=libdb.you.edu sslcert=/etc/pki/alternate.crt sslkey=/etc/pki/alternate.key"

The Versions

22/01 2017

dev-master

9999999-dev

Open minded PostGres connection driver for Doctrine DBAL

  Sources   Download

MIT

The Requires

 

by Tom Shorock

22/01 2017

0.1.2

0.1.2.0

Open minded PostGres connection driver for Doctrine DBAL

  Sources   Download

MIT

The Requires

 

by Tom Shorock