php-wasm-mbstring

0.0.0-c • Public • Published

php-wasm-mbstring

mbstring extension for php-wasm

https://github.com/seanmorris/php-wasm

https://www.npmjs.com/package/php-wasm

Usage

php-wasm-mbstring can be loaded via dynamic imports:

const php = new PhpWeb({sharedLibs: [
	await import('https://unpkg.com/php-wasm-mbstring')
]});

The supporting library libonig.so will automatically be pulled from the package.

You can rely on the default loading behavior if .so files are served from the same directory as your .wasm files.

const php = new PhpWeb({sharedLibs: ['php8.3-mbstring.so']});

You can provide a callback as the locateFile option to map library names to URLs:

const locateFile = (libName) => {
	return `https://my-example-server.site/path/to/libs/${libName}`;
};

const php = new PhpWeb({locateFile, sharedLibs: ['php8.3-mbstring.so']});

Build options:

The following options may be set in .php-wasm-rc for custom builds of php-wasm & php-cgi-wasm.

  • WITH_MBSTRING
  • WITH_ONIGURUMA

WITH_MBSTRING

0|static|shared|dynamic

When compiled as a dynamic extension, this will produce the extension php-8.𝑥-mbstring.so.

WITH_ONIGURUMA

0|static|shared

When compiled as a shared library, this will produce the library libonig.so.

Readme

Keywords

none

Package Sidebar

Install

npm i php-wasm-mbstring

Weekly Downloads

19

Version

0.0.0-c

License

none

Unpacked Size

4.82 MB

Total Files

11

Last publish

Collaborators

  • seanmorris