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..c4665e2 --- /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/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" + ] +} 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