Skip to content

Commit a1a60a1

Browse files
committed
Remove dev artifacts
1 parent 58a36c0 commit a1a60a1

File tree

6 files changed

+20
-43
lines changed

6 files changed

+20
-43
lines changed

.vscode/settings.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
"array": "c",
1717
"string": "c",
1818
"string_view": "c",
19-
"vector": "c",
20-
"span": "c",
21-
"numeric": "c",
22-
"fcntl.h": "c"
19+
"vector": "c"
2320
},
2421
"autoImportFileExcludePatterns": [
2522
"@wp-playground/client"

curltest/cli.js

+14-9
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,29 @@
22

33
// import { NodePHP } from '@php-wasm/node';
44
import { NodePHP } from '../dist/packages/php-wasm/node/index.cjs';
5+
import { rootCertificates } from 'tls';
6+
7+
const caBundlePath = new URL('ca-bundle.crt', (import.meta || {}).url).pathname;
58

69
NodePHP.load('8.0')
710
.then((php) => {
811
php.setPhpIniEntry('allow_url_fopen', '1');
912
php.setPhpIniEntry('disable_functions', '');
13+
php.setPhpIniEntry('openssl.cafile', caBundlePath);
1014
php.useHostFilesystem();
15+
php.writeFile(caBundlePath, rootCertificates.join('\n'));
1116

12-
// return php.run({
13-
// code: `<?php
14-
// echo file_get_contents('https://wordpress.org');
15-
// `
16-
// });
17+
console.log('php.run');
18+
return php.run({
19+
code: `<?php
20+
echo file_get_contents('https://wordpress.org');
21+
`,
22+
});
1723
return php.cli(['php', ...process.argv.slice(2)]);
1824
})
19-
.then(() => {
20-
for (const fn of global.asyncifyFunctions) {
21-
console.log(`"${fn}",`);
22-
}
25+
.then((result) => {
26+
console.log('done!');
27+
console.log(result.text);
2328
})
2429
.catch((e) => {
2530
console.error(e);

packages/php-wasm/compile/php/phpwasm-emscripten-library.js

-10
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,6 @@ const LibraryExample = {
9191
return [];
9292
}
9393
}
94-
95-
global.asyncifyFunctions = new Set();
96-
const originalHandleSleep = Asyncify.handleSleep;
97-
Asyncify.handleSleep = function (fn) {
98-
const e = new Error();
99-
for (const elem of extractPHPFunctionsFromStack(e.stack)) {
100-
global.asyncifyFunctions.add(elem);
101-
}
102-
return originalHandleSleep(fn);
103-
};
10494
},
10595
/**
10696
* A utility function to get all websocket objects associated

packages/php-wasm/node/public/php_8_0.js

-11
Original file line numberDiff line numberDiff line change
@@ -6949,17 +6949,6 @@ url = Module["websocket"]["url"](...arguments);
69496949
return [];
69506950
}
69516951
}
6952-
6953-
global.asyncifyFunctions = new Set();
6954-
const originalHandleSleep = Asyncify.handleSleep;
6955-
Asyncify.handleSleep = function (fn) {
6956-
const e = new Error();
6957-
console.error(e.stack);
6958-
global.asyncifyFunctions.add(
6959-
...extractPHPFunctionsFromStack(e.stack)
6960-
);
6961-
return originalHandleSleep(fn);
6962-
};
69636952
},
69646953
getAllWebSockets:function (sock) {
69656954
const webSockets = /* @__PURE__ */ new Set();

packages/php-wasm/node/src/lib/networking/outbound-ws-to-tcp-proxy.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ async function onWsConnect(client: any, request: http.IncomingMessage) {
175175
}
176176

177177
client.on('message', function (msg: Buffer) {
178-
clientLog('PHP -> network buffer:', msg);
178+
// clientLog('PHP -> network buffer:', msg);
179179
recvQueue.unshift(msg);
180180
if (target) {
181181
flushMessagesQueue();
@@ -220,10 +220,10 @@ async function onWsConnect(client: any, request: http.IncomingMessage) {
220220
flushMessagesQueue();
221221
});
222222
target.on('data', function (data: any) {
223-
clientLog(
224-
'network -> PHP buffer:',
225-
[...data.slice(0, 100)].join(', ') + '...'
226-
);
223+
// clientLog(
224+
// 'network -> PHP buffer:',
225+
// [...data.slice(0, 100)].join(', ') + '...'
226+
// );
227227
try {
228228
client.send(data);
229229
} catch (e) {

packages/playground/blueprints/src/lib/steps/enable-multisite.spec.ts

-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ describe('Blueprint step enableMultisite', () => {
3131
const response = await requestHandler.request({
3232
url: '/wp-admin/network/',
3333
});
34-
35-
for (const fn of global.asyncifyFunctions) {
36-
console.log(`"${fn}",`);
37-
}
3834
expect(response.text).toContain('My Sites');
3935
}, 30_000);
4036

0 commit comments

Comments
 (0)