Skip to content
Closed
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
136 changes: 68 additions & 68 deletions README.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions components/BlockParser/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# BlockParser

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/blockparser.html](https://wordpress.github.io/php-toolkit/reference/blockparser.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

## Why this exists

WordPress stores post content as annotated HTML. Instead of inventing a separate file format, it embeds block boundaries directly inside HTML comments:
Expand Down
5 changes: 5 additions & 0 deletions components/Blueprints/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Blueprints

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/blueprints.html](https://wordpress.github.io/php-toolkit/reference/blueprints.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

Declarative WordPress site provisioning. Define a site's desired state as a JSON blueprint -- which plugins to install, which options to set, which content to import -- and let the runner execute it. Blueprints can create a new WordPress site from scratch or modify an existing one, making them useful for development environments, demo sites, automated testing, and reproducible WordPress setups.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/ByteStream/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ByteStream

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/bytestream.html](https://wordpress.github.io/php-toolkit/reference/bytestream.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

Composable streaming primitives for reading, writing, and transforming byte data in pure PHP. ByteStream provides a pull-based model where you request bytes from a source, peek at or consume them, and optionally transform them through filters like compression or checksums -- all without loading entire files into memory.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/CLI/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CLI

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/cli.html](https://wordpress.github.io/php-toolkit/reference/cli.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

A POSIX-style command-line argument parser for PHP. It handles long options (`--verbose`), short options (`-v`), bundled short options (`-abc`), inline values (`--port=8080`, `-p=8080`), and positional arguments -- all in a single static method call with no external dependencies.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/CORSProxy/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CORSProxy

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/corsproxy.html](https://wordpress.github.io/php-toolkit/reference/corsproxy.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

A PHP CORS proxy that lets browser-based JavaScript make cross-origin requests to external services. Built for WordPress Playground to bridge `fetch()` calls to git servers and other APIs that don't set CORS headers. The proxy streams data bidirectionally, blocks requests to private IP ranges, filters sensitive headers, and enforces size limits -- all without external dependencies.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/DataLiberation/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# DataLiberation

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/dataliberation.html](https://wordpress.github.io/php-toolkit/reference/dataliberation.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

Streaming data import and export for WordPress. Reads and writes WordPress content in multiple formats -- WXR (WordPress eXtended RSS), SQL dumps, block markup, and more -- without loading everything into memory. Designed for migrating content between WordPress sites, converting between formats, and processing large exports that would otherwise exhaust PHP's memory limits.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/Encoding/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Encoding

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/encoding.html](https://wordpress.github.io/php-toolkit/reference/encoding.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

Pure PHP utilities for UTF-8 validation, scrubbing, and conversion. This component detects invalid byte sequences, replaces them with the Unicode Replacement Character using the maximal subpart algorithm, and provides low-level tools for working with Unicode code points -- all without requiring the `mbstring` extension. When `mbstring` is available, the library delegates to it for better performance.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/Filesystem/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Filesystem

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/filesystem.html](https://wordpress.github.io/php-toolkit/reference/filesystem.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

## Why this exists

PHP's built-in file functions (`file_get_contents`, `fopen`, `mkdir`, etc.) are tightly coupled to the local disk. That's fine for simple scripts, but it creates a real problem when you want to:
Expand Down
5 changes: 5 additions & 0 deletions components/Git/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Git

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/git.html](https://wordpress.github.io/php-toolkit/reference/git.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

## Why this exists

Git is typically used through the `git` binary — a compiled C program that reads and writes the repository on disk. That's perfect for most development workflows, but it breaks down in a few important scenarios:
Expand Down
5 changes: 5 additions & 0 deletions components/HTML/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# HTML

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/html.html](https://wordpress.github.io/php-toolkit/reference/html.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

## Why this exists

Modifying HTML in PHP usually means one of two things: string manipulation (fragile, breaks on any attribute ordering or whitespace variation) or loading the DOM extension (which requires libxml2, triggers errors on valid HTML5 that doesn't conform to XML rules, and mangles the document in the process).
Expand Down
5 changes: 5 additions & 0 deletions components/HttpClient/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# HttpClient

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/httpclient.html](https://wordpress.github.io/php-toolkit/reference/httpclient.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

An asynchronous HTTP client that works on vanilla PHP without requiring `curl` or any other extensions. It can use `curl` when available for better performance, but falls back to pure PHP sockets automatically. Supports concurrent requests, streaming responses, redirects, chunked encoding, gzip decompression, and basic auth.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/HttpServer/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# HttpServer

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/httpserver.html](https://wordpress.github.io/php-toolkit/reference/httpserver.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

A minimal, blocking TCP-based HTTP server written in pure PHP. It is designed for CLI tools, local development servers, and test harnesses where you need a lightweight HTTP endpoint without pulling in a full web server.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/Markdown/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Markdown

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/markdown.html](https://wordpress.github.io/php-toolkit/reference/markdown.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

Bidirectional converter between Markdown and WordPress block markup. Use `MarkdownConsumer` to parse Markdown (with optional YAML frontmatter) into WordPress blocks, and `MarkdownProducer` to serialize supported blocks back to Markdown. Designed for content synchronization workflows where a practical, structured conversion matters, such as three-way merging of static Markdown files with a WordPress database. It is not a byte-perfect Markdown formatter, and block attributes with no Markdown representation may be lost.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/Merge/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Merge

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/merge.html](https://wordpress.github.io/php-toolkit/reference/merge.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

A three-way merge and diff library for PHP. Given a common base version and two diverging branches, it computes diffs and merges the changes together, detecting conflicts along the way. The architecture is pluggable: swap out the differ (line-based or character-based), the merger (line-level or chunk-level), and add optional validation of the merged result.

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/Polyfill/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Polyfill

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/polyfill.html](https://wordpress.github.io/php-toolkit/reference/polyfill.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

Provides polyfills for PHP functions and WordPress core APIs so that WordPress-adjacent code can run in standalone PHP applications without a full WordPress installation. It backports PHP 8.0 string functions to PHP 7.2, stubs common WordPress escaping and translation functions, and implements a minimal but functional WordPress hook system (`add_filter`/`apply_filters`/`add_action`/`do_action`).

## Installation
Expand Down
5 changes: 5 additions & 0 deletions components/ToolkitCodingStandards/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ToolkitCodingStandards

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/coding-standards.html](https://wordpress.github.io/php-toolkit/reference/coding-standards.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

Custom PHP_CodeSniffer sniffs used internally by the PHP Toolkit project. This component provides two sniffs that enforce WordPress-style coding conventions: one requires Yoda-style comparisons (literal on the left side of `===`), and the other forbids the short ternary (Elvis) operator `?:`. Both sniffs support automatic fixing via `phpcbf`.

This is internal tooling for the toolkit's own linter pipeline, not a general-purpose coding standard.
Expand Down
5 changes: 5 additions & 0 deletions components/XML/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# XML

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/xml.html](https://wordpress.github.io/php-toolkit/reference/xml.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

## Why this exists

PHP ships with excellent XML support — `SimpleXML`, `DOMDocument`, `XMLReader` — but all of them rely on `libxml2`, a native C library. In most PHP environments that's fine. In WordPress Playground, which runs PHP compiled to WebAssembly in the browser, native extensions aren't available. You get the PHP standard library and nothing else.
Expand Down
5 changes: 5 additions & 0 deletions components/Zip/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Zip

<!-- docs-site-banner -->
> **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/zip.html](https://wordpress.github.io/php-toolkit/reference/zip.html)
> Snippets execute live in WordPress Playground — edit them in your browser and see real output.
<!-- /docs-site-banner -->

## Why this exists

PHP ships with `ZipArchive`, a convenient class for reading and writing ZIP files. The catch: it requires the `libzip` native extension, which isn't available everywhere. WordPress Playground compiles PHP to WebAssembly and runs it in the browser — no native extensions, no `libzip`, no `ZipArchive`.
Expand Down
4 changes: 4 additions & 0 deletions examples/create-wp-site/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Import Static Files Examples

<!-- docs-site-banner -->
> **📚 Looking for runnable PHP Toolkit examples?** See **<https://wordpress.github.io/php-toolkit/>** — every component has a reference page with snippets that execute in WordPress Playground.
<!-- /docs-site-banner -->

This repository contains scripts and examples demonstrating how to import static files and documentation from various sources into your project using `bun` and custom scripts.

## Usage
Expand Down
Loading