Skip to content

Commit 0dd263e

Browse files
OffgridwithJDclaude
andcommitted
Add PGXN distribution metadata (META.json)
Adds a META.json conforming to version 1.0.0 of the PGXN distribution metadata spec so PL/php can be released on PGXN and installed with "pgxn install plphp". It declares the four extensions the distribution provides: plphp itself plus the jsonb_plphp, hstore_plphp, and bytea_plphp transforms, each with its own version. Validated with PGXN::Meta::Validator 0.16.0. While documenting the PGXN install path in README and INSTALL, corrects two stale statements: the README test-count badge (17, now 26) and the INSTALL note that described a single optional jsonb transform. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 2e1432a commit 0dd263e

4 files changed

Lines changed: 96 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to PL/php are documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and the project aims to follow [Semantic Versioning](https://semver.org/).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- **PGXN packaging.** A `META.json` conforming to version 1.0.0 of the PGXN
13+
distribution metadata spec, so PL/php can be released on
14+
[PGXN](https://pgxn.org/) and installed with `pgxn install plphp`. It lists
15+
the four extensions in the distribution (`plphp` plus the `jsonb_plphp`,
16+
`hstore_plphp`, and `bytea_plphp` transforms).
17+
18+
### Fixed
19+
20+
- Documentation: the README test-count badge and the INSTALL note on the
21+
optional transforms, which still described a single jsonb transform.
22+
823
## [2.6.0] - 2026-07-06
924

1025
### Added

INSTALL

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ and links against the PHP "embed" SAPI.
3232
2. Build and install
3333
---------------------
3434

35+
From PGXN, which downloads, builds, and installs the current release:
36+
37+
pgxn install plphp
38+
39+
From a source checkout:
40+
3541
make
3642
sudo make install
3743

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

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

5662
make -C jsonb_plphp PG_CONFIG=... PHP_CONFIG=...
5763
sudo make -C jsonb_plphp PG_CONFIG=... install

META.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "plphp",
3+
"abstract": "PHP as a procedural language for PostgreSQL",
4+
"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.",
5+
"version": "2.6.0",
6+
"maintainer": [
7+
"Joshua D. Drake <jd@commandprompt.com>"
8+
],
9+
"license": "postgresql",
10+
"release_status": "stable",
11+
"prereqs": {
12+
"runtime": {
13+
"requires": {
14+
"PostgreSQL": "11.0.0"
15+
}
16+
}
17+
},
18+
"provides": {
19+
"plphp": {
20+
"file": "plphp--2.6.sql",
21+
"docfile": "doc/plphp.md",
22+
"version": "2.6.0",
23+
"abstract": "PHP as a procedural language for PostgreSQL"
24+
},
25+
"jsonb_plphp": {
26+
"file": "jsonb_plphp/jsonb_plphp--1.0.sql",
27+
"version": "1.0.0",
28+
"abstract": "Transform between jsonb and PL/php values"
29+
},
30+
"hstore_plphp": {
31+
"file": "hstore_plphp/hstore_plphp--1.0.sql",
32+
"version": "1.0.0",
33+
"abstract": "Transform between hstore and PL/php arrays"
34+
},
35+
"bytea_plphp": {
36+
"file": "bytea_plphp/bytea_plphp--1.0.sql",
37+
"version": "1.0.0",
38+
"abstract": "Transform between bytea and binary-safe PL/php strings"
39+
}
40+
},
41+
"resources": {
42+
"homepage": "https://github.com/commandprompt/PL-php",
43+
"bugtracker": {
44+
"web": "https://github.com/commandprompt/PL-php/issues"
45+
},
46+
"repository": {
47+
"url": "https://github.com/commandprompt/PL-php.git",
48+
"web": "https://github.com/commandprompt/PL-php",
49+
"type": "git"
50+
}
51+
},
52+
"meta-spec": {
53+
"version": "1.0.0",
54+
"url": "https://pgxn.org/meta/spec.txt"
55+
},
56+
"tags": [
57+
"php",
58+
"procedural language",
59+
"plphp",
60+
"language handler",
61+
"untrusted",
62+
"transform"
63+
]
64+
}

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

1515
<br>
@@ -107,6 +107,14 @@ $$;
107107

108108
## Installation
109109

110+
From [PGXN](https://pgxn.org/dist/plphp/):
111+
112+
```sh
113+
pgxn install plphp
114+
```
115+
116+
From a source checkout:
117+
110118
```sh
111119
make
112120
sudo make install

0 commit comments

Comments
 (0)