Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@php-wasm/cli

Package Overview
Dependencies
Maintainers
0
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@php-wasm/cli - npm Package Compare versions

Comparing version 0.7.20 to 0.9.2

8

main.js

@@ -1,4 +0,4 @@

import{existsSync as v,writeFileSync as f,mkdtempSync as P,rmSync as w,rmdirSync as y}from"fs";import{rootCertificates as E}from"tls";import{LatestSupportedPHPVersion as S,SupportedPHPVersionsList as $}from"@php-wasm/universal";import{NodePHP as g}from"@php-wasm/node";import{spawn as C}from"child_process";const R="modulepreload",k=function(a){return"/"+a},d={},H=function(r,c,p){if(!c||c.length===0)return r();const i=document.getElementsByTagName("link");return Promise.all(c.map(t=>{if(t=k(t),t in d)return;d[t]=!0;const e=t.endsWith(".css"),m=e?'[rel="stylesheet"]':"";if(!!p)for(let n=i.length-1;n>=0;n--){const l=i[n];if(l.href===t&&(!e||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${m}`))return;const s=document.createElement("link");if(s.rel=e?"stylesheet":R,e||(s.as="script",s.crossOrigin=""),s.href=t,document.head.appendChild(s),e)return new Promise((n,l)=>{s.addEventListener("load",n),s.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${t}`)))})})).then(()=>r()).catch(t=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t})};let o=process.argv.slice(2);o.length||(o=["--help"]);const u=new URL("ca-bundle.crt",(import.meta||{}).url).pathname;v(u)||f(u,E.join(`
`));o.unshift("-d",`openssl.cafile=${u}`);async function L(){const a=await H(()=>import("./assets/php-e1f9edd4.js"),[]),r=process.env.PHP||S;if(!$.includes(r))throw new Error(`Unsupported PHP version ${r}`);const{TMPDIR:c,...p}=process.env,i=await g.load(r,{emscriptenOptions:{ENV:{...p,TERM:"xterm"}}});i.useHostFilesystem(),i.setSpawnHandler(e=>{const m=`${process.argv[0]} ${process.execArgv.join(" ")} ${process.argv[1]}`,h=e.replace(/^(?:\\ |[^ ])*php\d?(\s|$)/,m+"$1"),s=P("php-wasm-"),n=`${s}/script.sh`;f(n,`#!/bin/sh
${h} < /dev/stdin
`);try{return C(h,[],{shell:!0,stdio:["pipe","pipe","pipe"],timeout:5e3})}finally{w(n),y(s)}}),o.some(e=>e.startsWith("-c"))||o.unshift("-c",a),await i.cli(["php",...o]).catch(e=>{throw e.name==="ExitStatus"&&process.exit(e.status===void 0?1:e.status),e}).finally(()=>{setTimeout(()=>{process.exit(0)},100)})}L();
import{existsSync as v,writeFileSync as f,mkdtempSync as P,rmSync as w,rmdirSync as y}from"fs";import{rootCertificates as E}from"tls";import{LatestSupportedPHPVersion as S,SupportedPHPVersionsList as $,PHP as g}from"@php-wasm/universal";import{spawn as R}from"child_process";import{loadNodeRuntime as C,useHostFilesystem as k}from"@php-wasm/node";const H="modulepreload",L=function(a){return"/"+a},d={},_=function(r,c,p){if(!c||c.length===0)return r();const i=document.getElementsByTagName("link");return Promise.all(c.map(t=>{if(t=L(t),t in d)return;d[t]=!0;const e=t.endsWith(".css"),m=e?'[rel="stylesheet"]':"";if(!!p)for(let n=i.length-1;n>=0;n--){const l=i[n];if(l.href===t&&(!e||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${m}`))return;const s=document.createElement("link");if(s.rel=e?"stylesheet":H,e||(s.as="script",s.crossOrigin=""),s.href=t,document.head.appendChild(s),e)return new Promise((n,l)=>{s.addEventListener("load",n),s.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${t}`)))})})).then(()=>r()).catch(t=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t})};let o=process.argv.slice(2);o.length||(o=["--help"]);const h=new URL("ca-bundle.crt",(import.meta||{}).url).pathname;v(h)||f(h,E.join(`
`));o.unshift("-d",`openssl.cafile=${h}`);async function x(){const a=await _(()=>import("./assets/php-e1f9edd4.js"),[]),r=process.env.PHP||S;if(!$.includes(r))throw new Error(`Unsupported PHP version ${r}`);const{TMPDIR:c,...p}=process.env,i=new g(await C(r,{emscriptenOptions:{ENV:{...p,TERM:"xterm"}}}));k(i),i.setSpawnHandler(e=>{const m=`${process.argv[0]} ${process.execArgv.join(" ")} ${process.argv[1]}`,u=e.replace(/^(?:\\ |[^ ])*php\d?(\s|$)/,m+"$1"),s=P("php-wasm-"),n=`${s}/script.sh`;f(n,`#!/bin/sh
${u} < /dev/stdin
`);try{return R(u,[],{shell:!0,stdio:["pipe","pipe","pipe"],timeout:5e3})}finally{w(n),y(s)}}),o.some(e=>e.startsWith("-c"))||o.unshift("-c",a),await i.cli(["php",...o]).catch(e=>{throw e.name==="ExitStatus"&&process.exit(e.status===void 0?1:e.status),e}).finally(()=>{setTimeout(()=>{process.exit(0)},100)})}x();
{
"name": "@php-wasm/cli",
"version": "0.7.20",
"version": "0.9.2",
"description": "PHP.wasm CLI for node.js",

@@ -26,3 +26,3 @@ "repository": {

"bin": "php-wasm.js",
"gitHead": "5915ef756c88da8dcb665f9f0e49ddc0c0b10d50",
"gitHead": "40dca15bf2d5c21c2ee57a878940cb6f7f7851f0",
"dependencies": {

@@ -32,5 +32,5 @@ "comlink": "^4.4.1",

"ws": "8.13.0",
"@php-wasm/universal": "0.7.20",
"@php-wasm/node": "0.7.20"
"@php-wasm/universal": "0.9.2",
"@php-wasm/node": "0.9.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc