Sean Morris

Results 66 comments of Sean Morris

> Other question, can we use IndexedDb with PhpWeb filesystem? Working on releasing that now. You should already see it working in the [Drupal Demo](https://seanmorris.github.io/php-wasm/?demo=drupal.php&render-as=html&autorun=1&persist=0&single-expression=0&code=%253C%253Fphp%2520%252F%252F%2520%257B%2522autorun%2522%253Atrue%252C%2520%2522persist%2522%253Afalse%252C%2520%2522single-expression%2522%253A%2520false%252C%2520%2522render-as%2522%253A%2520%2522html%2522%257D%250Aini_set%28%27session.save_path%27%252C%2520%27%252Fpersist%27%29%253B%250A%250A%2524stdErr%2520%253D%2520fopen%28%27php%253A%252F%252Fstderr%27%252C%2520%27w%27%29%253B%250A%2524errors%2520%253D%2520%255B%255D%253B%250A%250Aset_error_handler%28function%28...%2524args%29%2520use%28%2524stdErr%252C%2520%2526%2524errors%29%257B%250A%2509fwrite%28%2524stdErr%252C%2520print_r%28%2524args%252C1%29%29%253B%250A%257D%29%253B%250A%250A%2524docroot%2520%253D%2520%27%252Fpersist%252Fdrupal-7.95%27%253B%250A%2524path%2520%2520%2520%2520%253D%2520%27%252Fnode%27%253B%250A%2524script%2520%2520%253D%2520%27index.php%27%253B%250A%250Aif%28%21is_dir%28%2524docroot%29%29%250A%257B%250A%2520%2520%2520%2520%2524it%2520%253D%2520new%2520RecursiveIteratorIterator%28new%2520RecursiveDirectoryIterator%28%2522%252Fpreload%252Fdrupal-7.95%252F%2522%252C%2520FilesystemIterator%253A%253ASKIP_DOTS%29%29%253B%250A%2520%2520%2520%2520foreach%2520%28%2524it%2520as%2520%2524name%2520%253D%253E%2520%2524entry%29%250A%2520%2520%2520%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520if%28is_dir%28%2524name%29%29%2520continue%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2524fromDir%2520%253D%2520dirname%28%2524name%29%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2524toDir%2520%2520%253D%2520%27%252Fpersist%27%2520.%2520substr%28%2524fromDir%252C%25208%29%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2524filename%2520%253D%2520basename%28%2524name%29%253B%250A%2520%2520%2520%2520%2509%2524pDirs%2520%253D%2520%255B%2524pDir%2520%253D%2520%2524toDir%255D%253B%250A%2520%2520%2520%2520%2509while%28%2524pDir%2520%21%253D%253D%2520dirname%28%2524pDir%29%29%2520%2524pDirs%255B%255D%2520%253D%2520%2524pDir%2520%253D%2520dirname%28%2524pDir%29%253B%250A%2520%2520%2520%2520%2509%2524pDirs%2520%253D%2520array_reverse%28%2524pDirs%29%253B%250A%2520%2520%2520%2520%2509foreach%28%2524pDirs%2520as%2520%2524pDir%29%2520if%28%21is_dir%28%2524pDir%29%29%2520mkdir%28%2524pDir%252C%25200777%29%253B%250A%2520%2520%2520%2520%2509file_put_contents%28%2524toDir%2520%2520.%2520%27%252F%27%2520.%2520%2524filename%252C%2520file_get_contents%28%2524fromDir%2520.%2520%27%252F%27%2520.%2520%2524filename%29%29%253B%250A%2520%2520%2520%2520%257D%250A%257D%250A%250A%2524_SERVER%255B%27REQUEST_URI%27%255D%2520%2520%2520%2520%2520%253D%2520%27%252Fphp-wasm%27%2520.%2520%2524docroot%2520.%2520%2524path%253B%250A%2524_SERVER%255B%27REMOTE_ADDR%27%255D%2520%2520%2520%2520%2520%253D%2520%27127.0.0.1%27%253B%250A%2524_SERVER%255B%27SERVER_NAME%27%255D%2520%2520%2520%2520%2520%253D%2520%27localhost%27%253B%250A%2524_SERVER%255B%27SERVER_PORT%27%255D%2520%2520%2520%2520%2520%253D%25203333%253B%250A%2524_SERVER%255B%27REQUEST_METHOD%27%255D%2520%2520%253D%2520%27GET%27%253B%250A%2524_SERVER%255B%27SCRIPT_FILENAME%27%255D%2520%253D%2520%2524docroot%2520.%2520%27%252F%27%2520.%2520%2524script%253B%250A%2524_SERVER%255B%27SCRIPT_NAME%27%255D%2520%2520%2520%2520%2520%253D%2520%2524docroot%2520.%2520%27%252F%27%2520.%2520%2524script%253B%250A%2524_SERVER%255B%27PHP_SELF%27%255D%2520%2520%2520%2520%2520%2520%2520%2520%253D%2520%2524docroot%2520.%2520%27%252F%27%2520.%2520%2524script%253B%250A%250Achdir%28%2524docroot%29%253B%250A%250Aif%28%21defined%28%27DRUPAL_ROOT%27%29%29%2520define%28%27DRUPAL_ROOT%27%252C%2520getcwd%28%29%29%253B%250A%250Arequire_once%2520DRUPAL_ROOT%2520.%2520%27%252Fincludes%252Fbootstrap.inc%27%253B%250Adrupal_bootstrap%28DRUPAL_BOOTSTRAP_FULL%29%253B%250Adrupal_session_start%28%29%253B%250A%250Afwrite%28%2524stdErr%252C%2520json_encode%28%255B%27session_id%27%2520%253D%253E%2520session_id%28%29%255D%29%2520.%2520%2522%255Cn%2522%29%253B%250A%250Aglobal%2520%2524user%253B%250A%250A%2524uid%2520%2520%2520%2520%2520%253D%25201%253B%250A%2524user%2520%2520%2520%2520%253D%2520user_load%28%2524uid%29%253B%250A%2524account%2520%253D%2520array%28%27uid%27%2520%253D%253E%2520%2524user-%253Euid%29%253B%250A%2524session_name%2520%253D%2520session_name%28%29%253B%250A%250Aif%28%21%2524_COOKIE%2520%257C%257C%2520%21%2524_COOKIE%255B%2524%2524session_name%255D%29%250A%257B%250A%2509user_login_submit%28array%28%29%252C%2520%2524account%29%253B%250A%257D%250A%250A%2524itemPath%2520%253D%2520%2524path%253B%250A%2524itemPath%2520%253D%2520preg_replace%28%27%252F%255E%255C%255C%252F%252F%27%252C%2520%27%27%252C%2520%2524path%29%253B%250A%250A%2524GLOBALS%255B%27base_path%27%255D%2520%253D%2520%27%252Fphp-wasm%27%2520.%2520%2524docroot%2520.%2520%27%252F%27%253B%250A%2524base_url%2520%253D%2520%27%252Fphp-wasm%27%2520.%2520%2524docroot%253B%250A%250A%2524_GET%255B%27q%27%255D%2520%253D%2520%2524itemPath%253B%250A%250Amenu_execute_active_handler%28%29%253B%250A%250Afwrite%28%2524stdErr%252C%2520json_encode%28%255B%27HEADERS%27%2520%253D%253Eheaders_list%28%29%255D%29%2520.%2520%2522%255Cn%2522%29%253B%250Afwrite%28%2524stdErr%252C%2520json_encode%28%255B%27COOKIE%27%2520%2520%253D%253E%2520%2524_COOKIE%255D%29%2520.%2520PHP_EOL%29%253B%250Afwrite%28%2524stdErr%252C%2520json_encode%28%255B%27errors%27%2520%2520%253D%253E%2520error_get_last%28%29%255D%29%2520.%2520%2522%255Cn%2522%29%253B%250A)

Is the problem still occurring with the latest updates?

@rhildred Can you pull the latest `master` and give it another shot? I've made some changes and its now building with emscripten 3.1.43.

> It still fails in the same place. I reasoned that it was broken because of emsdk no longer including fastcomp ([emscripten-core/emscripten#11319](https://github.com/emscripten-core/emscripten/issues/11319)). So I changed the dockerfile to have: >...

Those are build artifacts, which I usually try not to commit to a source repository. They files are all available in the npm package, as well as on [unpkg](https://unpkg.com/browse/php-wasm), though....

@kenorb Are you using a bundler?

Are you waiting for `ready` to fire? ```javascript php.addEventListener('ready', () => { php.run('

Hmmm, on a hunch, does it work if you `await require` the asm2wasm module before the php-wasm module?

I've created an ESM version and published it with `unpkg` as a preview: https://jsfiddle.net/ohtba1d8/1 (might take a moment to load) ```php const loadPhp = import('https://www.unpkg.com/[email protected]/PhpWeb.mjs'); loadPhp.then(({PhpWeb}) => { const php...

> * the `printErr` is invoked all the time with empty messages > * when errors actually happen these don't pass through any `error` handler or `printErr` I need to...