Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ All notable changes to PL/php are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and the project aims to follow [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Added

- **PGXN packaging.** A `META.json` conforming to version 1.0.0 of the PGXN
distribution metadata spec, so PL/php can be released on
[PGXN](https://pgxn.org/) and installed with `pgxn install plphp`. It lists
the four extensions in the distribution (`plphp` plus the `jsonb_plphp`,
`hstore_plphp`, and `bytea_plphp` transforms).

### Fixed

- Documentation: the README test-count badge and the INSTALL note on the
optional transforms, which still described a single jsonb transform.

## [2.6.0] - 2026-07-06

### Added
Expand Down
10 changes: 8 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ and links against the PHP "embed" SAPI.
2. Build and install
---------------------

From PGXN, which downloads, builds, and installs the current release:

pgxn install plphp

From a source checkout:

make
sudo make install

Expand All @@ -50,8 +56,8 @@ point that symlink at the intended version.
This installs the shared library plphp.so plus the extension control and SQL
files into the directories reported by pg_config.

The optional jsonb transform (CREATE EXTENSION jsonb_plphp; see
doc/plphp.md) builds the same way in its own directory:
The optional transforms (jsonb_plphp, hstore_plphp, bytea_plphp; see
doc/plphp.md) build the same way, each in its own directory:

make -C jsonb_plphp PG_CONFIG=... PHP_CONFIG=...
sudo make -C jsonb_plphp PG_CONFIG=... install
Expand Down
64 changes: 64 additions & 0 deletions META.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "plphp",
"abstract": "PHP as a procedural language for PostgreSQL",
"description": "PL/php lets you write PostgreSQL functions, set-returning functions, triggers, event triggers, and procedures in PHP, stored and executed inside the server. It supports SPI queries and cursors, subtransactions, transaction control in procedures, structured errors, per-function and session-shared state, and optional transforms that map PostgreSQL jsonb, hstore, and bytea values to native PHP values. PL/php is an untrusted language: PHP has no sandbox on modern releases, so functions run with the privileges of the server's operating system user and only a superuser may install the extension.",
"version": "2.6.0",
"maintainer": [
"Joshua D. Drake <jd@commandprompt.com>"
],
"license": "postgresql",
"release_status": "stable",
"prereqs": {
"runtime": {
"requires": {
"PostgreSQL": "11.0.0"
}
}
},
"provides": {
"plphp": {
"file": "plphp--2.6.sql",
"docfile": "doc/plphp.md",
"version": "2.6.0",
"abstract": "PHP as a procedural language for PostgreSQL"
},
"jsonb_plphp": {
"file": "jsonb_plphp/jsonb_plphp--1.0.sql",
"version": "1.0.0",
"abstract": "Transform between jsonb and PL/php values"
},
"hstore_plphp": {
"file": "hstore_plphp/hstore_plphp--1.0.sql",
"version": "1.0.0",
"abstract": "Transform between hstore and PL/php arrays"
},
"bytea_plphp": {
"file": "bytea_plphp/bytea_plphp--1.0.sql",
"version": "1.0.0",
"abstract": "Transform between bytea and binary-safe PL/php strings"
}
},
"resources": {
"homepage": "https://github.com/commandprompt/plPHP",
"bugtracker": {
"web": "https://github.com/commandprompt/plPHP/issues"
},
"repository": {
"url": "https://github.com/commandprompt/plPHP.git",
"web": "https://github.com/commandprompt/plPHP",
"type": "git"
}
},
"meta-spec": {
"version": "1.0.0",
"url": "https://pgxn.org/meta/spec.txt"
},
"tags": [
"php",
"procedural language",
"plphp",
"language handler",
"untrusted",
"transform"
]
}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-11_to_18-336791?logo=postgresql&logoColor=white)](https://www.postgresql.org/)
[![PHP](https://img.shields.io/badge/PHP-8.1--8.4-777BB4?logo=php&logoColor=white)](https://www.php.net/)
[![Tests](https://img.shields.io/badge/tests-17_passing-brightgreen)](sql/)
[![Tests](https://img.shields.io/badge/tests-26_passing-brightgreen)](sql/)
[![License](https://img.shields.io/badge/license-permissive-blue)](#license)

<br>
Expand Down Expand Up @@ -107,6 +107,14 @@ $$;

## Installation

From [PGXN](https://pgxn.org/dist/plphp/):

```sh
pgxn install plphp
```

From a source checkout:

```sh
make
sudo make install
Expand Down
Loading