ID: 42614 Comment by: matteo at beccati dot com Reported By: b...@php.net Status: Open Bug Type: Feature/Change Request PHP Version: 5.2.4 New Comment:
Following a post on php-dev and a catch-up with Lukas K. Smith, here's an updated patch for PHP 5.3 HEAD that mimics the behaviour of David/Wez's patch, that unfortunately was lost: http://www.beccati.com/misc/pdo_pgsql_getnotify_php5_3.patch The patch adds two methods: int PDO::pgsqlGetPid() Returns the PID of the connected backend mixed PDO::pgsqlGetNotify( [ $result_type = PDO::FETCH_USE_DEFAULT [, [int $ms_timeout = 0 ]]) Returns an array or false, just like pg_get_notify() $result_type can either be: - PDO::FETCH_USE_DEFAULT - PDO::FETCH_BOTH - PDO::FETCH_NUM - PDO::FETCH_ASSOC $ms_timeout is the timeout in milliseconds that the function will wait before returning if no NOTIFY was received Thanks go to: Lukas Kahwe Smith for the support Wez Fufrlong for the feedback and suggestions David Begley who is the author of a similar patch Previous Comments: ------------------------------------------------------------------------ [2008-02-02 08:25:04] d dot begley at uws dot edu dot au Support for PostgreSQL's LISTEN/NOTIFY in PDO has been written since PHP 5.1, it just needs to be integrated with the latest code by one of the core developers - see: http://netevil.org/blog/2006/oct/background-batch-workflow-processing-with-pdo-pgsql ------------------------------------------------------------------------ [2007-09-10 17:12:04] b...@php.net Description: ------------ Hi, sorry that i post this as a bug, there is no other way to specify a feature request per extension. Support for PGnotifies() would be great in PDO. ext/pgsql has it already with pg_get_notify(). Docs are at http://www.postgresql.org/docs/8.2/interactive/libpq-notify.html and a sample at http://www.postgresql.org/docs/8.2/interactive/libpq-example.html#LIBPQ-EXAMPLE-2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42614&edit=1