URL Rewriting in WordPress importer demo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env php | |
| <?php | |
| /** | |
| * Composer Fast Resolve - Fast parallel dependency resolution | |
| * | |
| * Resolves all transitive dependencies from a composer.json and outputs | |
| * a new composer.json with all dependencies explicitly listed. | |
| * | |
| * Usage: | |
| * php composer-shrinkwrap.php composer.json > composer-shrinkwrap.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "plugins": ["wp-staging"], | |
| "steps": [ | |
| { | |
| "step": "writeFile", | |
| "path": "/wordpress/wp-content/mu-plugins/shim_mysqli.php", | |
| "data": { | |
| "resource": "url", | |
| "url": "https://gist.githubusercontent.com/adamziel/51ac62858a97937a84a4c4b9e8dea463/raw/9185e69fc9e7d36f276e72aba92944107fd94bed/shim_mysqli.php" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Serves a syntax-highlighted, source-mapped, debuggable file to Chrome devtools | |
| over the CDP protocol. | |
| """ | |
| import asyncio | |
| import websockets | |
| import json | |
| import base64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rm out.txt | |
| PHP=7.4 node --stack-trace-limit=100 --loader=./packages/meta/src/node-es-module-loader/loader.mts ./packages/php-wasm/cli/src/main.ts test.php &> out.txt | |
| cat out.txt | bun packages/meta/bin/verify-asyncify-functions.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // build.mjs | |
| import esbuild from 'esbuild' | |
| import importUrlPlugin from './import-url-plugin.ts'; // the plugin shown earlier | |
| await esbuild.build({ | |
| entryPoints: ['src/index.ts'], | |
| bundle: true, | |
| outdir: 'build', | |
| format: 'esm', | |
| platform: 'browser', // change to 'node' if you bundle for Node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Data Liberation Boilerplate | |
| * 1. Clone the https://github.com/wordPress/php-toolkit/ repo | |
| * 2. Switch to branch push-qvpwqtzqzyrw (this PR https://github.com/WordPress/php-toolkit/pull/127) | |
| * 3. Put this file in the repo root | |
| * 4. Adjust the require paths below | |
| * 5. Run the script | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Can you run WordPress on PostgreSQL? | |
| Not yet, but this Gist gets you closer. This is a PostgreSQL driver | |
| for https://github.com/Automattic/sqlite-database-integration. I've | |
| generated it by asking AI to port the SQLite driver to PostgreSQL driver. | |
| It parses a MySQL query and runs a corresponding PostgreSQL query. Some | |
| queries work, some don't, the escaping is a mess, but it's a good first draft. |
A simple demo of how a WordPress Playground instance running in the web browser could be reached from the outside world.
The data flow:
- The browser receives a unique session ID
- The browser connects via a long-lived connection to gateway.php (SSE)
- An external caller sends a HTTP request to the gateway (with session ID).
- Gateway stalls, stores the request details on the disk
- The browser receives request details via the long-lived connection
NewerOlder