Skip to content

Commit 469a7cc

Browse files
authored
Use specified SQLite version also for PHP < 7.4 (#32)
## Motivation for the change, related issues The libsqlite version [specified for PHP WASM build](https://github.com/Automattic/wordpress-playground-private/blob/e092d448c9cd0fe56cde3a5048c132b3c55b3c04/packages/php-wasm/compile/libsqlite3/Dockerfile#L16) was not respected for PHP < 7.4. This change fixes it for all PHP versions. Fixes Automattic/wordpress-playground-private#31. ## Implementation details Originally, it seemed that for PHP < 7.4 this [needs to be done differently](https://www.php.net/manual/en/ref.pdo-sqlite.php): > The PDO_SQLITE PDO driver is enabled by default. To disable, --without-pdo-sqlite[=DIR] may be used, where the optional [=DIR] is the sqlite base install directory. As of PHP 7.4.0 [» libsqlite](http://sqlite.org/) ≥ 3.5.0 is required. Formerly, the bundled libsqlite could have been used instead, and was the default, if [=DIR] has been omitted. However, during my testing, it turned out that simply keeping `-lsqlite3` for all PHP versions fixes the issue. I verified this for PHP 7.0, 7.1, 7.2, and 7.3. ## Testing Instructions (or ideally a Blueprint) Run the following command, replacing `7.0` with any desired PHP version: ```js PHP=7.0 npx nx run php-wasm-cli:start -- -r "var_dump(PHP_VERSION); var_dump((new PDO('sqlite::memory:'))->query('select sqlite_version()')->fetch());" ```
1 parent 3fd6bb1 commit 469a7cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+744
-690
lines changed

packages/php-wasm/compile/php/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

packages/php-wasm/node/asyncify/php_7_0.js

Lines changed: 136 additions & 129 deletions
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/asyncify/php_7_1.js

Lines changed: 134 additions & 127 deletions
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/asyncify/php_7_2.js

Lines changed: 135 additions & 128 deletions
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/asyncify/php_7_3.js

Lines changed: 134 additions & 127 deletions
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/asyncify/php_7_4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/asyncify/php_8_1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/asyncify/php_8_2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/asyncify/php_8_3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/asyncify/php_8_4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
79 Bytes
Binary file not shown.
43 Bytes
Binary file not shown.
15 Bytes
Binary file not shown.
33 Bytes
Binary file not shown.
-4 Bytes
Binary file not shown.
2 Bytes
Binary file not shown.

packages/php-wasm/node/jspi/php_7_0.js

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/jspi/php_7_1.js

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/jspi/php_7_2.js

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/jspi/php_7_3.js

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/jspi/php_7_4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/jspi/php_8_1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/jspi/php_8_2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/jspi/php_8_3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change

packages/php-wasm/node/jspi/php_8_4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

packages/php-wasm/web/public/php/asyncify/php_7_0.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/asyncify/php_7_1.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/asyncify/php_7_2.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/asyncify/php_7_3.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/asyncify/php_7_4.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/asyncify/php_8_0.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/asyncify/php_8_1.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/asyncify/php_8_2.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/asyncify/php_8_3.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/asyncify/php_8_4.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

packages/php-wasm/web/public/php/jspi/php_7_0.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/jspi/php_7_1.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/jspi/php_7_2.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/jspi/php_7_3.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/jspi/php_7_4.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/jspi/php_8_0.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/jspi/php_8_1.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/jspi/php_8_2.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/jspi/php_8_3.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/web/public/php/jspi/php_8_4.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)