This is an implementation of the pgsql PHP extension for the HipHop PHP VM.
Note: As of writing, this extension is blocked on this issue
This extension only requires the libpq library distributed with Postgres and HipHop VM itself.
Installation requires a copy of HipHop to be built from source on the local machine, instructions on how to do this are available on the HipHop Wiki. Once done, the following commands will build the extension.
$ cd /path/to/extension
$ $HPHP_HOME/hphp/tools/hphpize/hphpize
$ cmake .
$ make
This will produce a pgsql.so file, the dynamically-loadable extension.
To enable the extension, you need to have the following section in your hhvm config file
DynamicExtensionPath = /path/to/hhvm/extensions
DynamicExtensions {
* = pgsql.so
}
Where /path/to/hhvm/extensions is a folder containing all HipHop extensions, and pgsql.so is in
it. This will cause the extension to be loaded when the virtual machine starts up.
There are a few differences from the standard Zend implementation.
- The connection resource is not optional.
- Persistent connections are not implemented
- The following functions are not implemented for various reasons:
pg_convertpg_copy_frompg_copy_topg_field_typepg_insertpg_last_oidpg_lo_closepg_lo_createpg_lo_exportpg_lo_importpg_lo_openpg_lo_read_allpg_lo_readpg_lo_seekpg_lo_tellpg_lo_unlinkpg_lo_writepg_meta_datapg_pconnectpg_put_linepg_selectpg_set_client_encodingpg_set_error_verbositypg_tracepg_ttypg_untracepg_update
Otherwise, all functionality is (or should be) the same as the Zend implementation.
As always, bugs should be reported to the issue tracker and patches are very welcome.