From 676a0560318e582fd26a428a0a117b2ac7c3a4f7 Mon Sep 17 00:00:00 2001 From: "Joshua (D) Drake" <136637981+ChronicallyJD@users.noreply.github.com> Date: Wed, 26 Aug 2026 10:48:09 -0600 Subject: [PATCH 1/2] 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) --- CHANGELOG.md | 15 ++++++++++++ INSTALL | 10 ++++++-- META.json | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 10 +++++++- 4 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 META.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d9d5e7..5927074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/INSTALL b/INSTALL index 06565ab..1b7c883 100644 --- a/INSTALL +++ b/INSTALL @@ -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 @@ -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 diff --git a/META.json b/META.json new file mode 100644 index 0000000..eed964b --- /dev/null +++ b/META.json @@ -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 " + ], + "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/PL-php", + "bugtracker": { + "web": "https://github.com/commandprompt/PL-php/issues" + }, + "repository": { + "url": "https://github.com/commandprompt/PL-php.git", + "web": "https://github.com/commandprompt/PL-php", + "type": "git" + } + }, + "meta-spec": { + "version": "1.0.0", + "url": "https://pgxn.org/meta/spec.txt" + }, + "tags": [ + "php", + "procedural language", + "plphp", + "language handler", + "untrusted", + "transform" + ] +} diff --git a/README.md b/README.md index 2dc3e29..dab0d1e 100644 --- a/README.md +++ b/README.md @@ -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)
@@ -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 From faf3506e98b57e832266335ce3fb673bf949b504 Mon Sep 17 00:00:00 2001 From: "Joshua (D) Drake" <136637981+ChronicallyJD@users.noreply.github.com> Date: Wed, 26 Aug 2026 11:00:32 -0600 Subject: [PATCH 2/2] META.json: use the current repository URL The repository was renamed from PL-php to plPHP. The old URLs redirect, but PGXN releases are permanent, so record the canonical name. Co-Authored-By: Claude Opus 5 (1M context) --- META.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/META.json b/META.json index eed964b..c4665e2 100644 --- a/META.json +++ b/META.json @@ -39,13 +39,13 @@ } }, "resources": { - "homepage": "https://github.com/commandprompt/PL-php", + "homepage": "https://github.com/commandprompt/plPHP", "bugtracker": { - "web": "https://github.com/commandprompt/PL-php/issues" + "web": "https://github.com/commandprompt/plPHP/issues" }, "repository": { - "url": "https://github.com/commandprompt/PL-php.git", - "web": "https://github.com/commandprompt/PL-php", + "url": "https://github.com/commandprompt/plPHP.git", + "web": "https://github.com/commandprompt/plPHP", "type": "git" } },