feat: run WordPress projects on native runtime
This commit is contained in:
@@ -28,7 +28,8 @@ for (const executable of [
|
||||
'php-fpm',
|
||||
'nginx',
|
||||
'mariadbd',
|
||||
'mariadb-install-db'
|
||||
'mariadb-install-db',
|
||||
'wp'
|
||||
]) {
|
||||
const path = join(stagingRoot, 'bin', executable)
|
||||
if (!existsSync(path)) throw new Error(`Builder did not produce ${path}`)
|
||||
|
||||
@@ -28,6 +28,12 @@ const checks = [
|
||||
join(root, 'bin/mariadbd'),
|
||||
['--version'],
|
||||
template.components.find((item) => item.id === 'mariadb')?.version
|
||||
],
|
||||
[
|
||||
'WP-CLI',
|
||||
join(root, 'bin/wp'),
|
||||
['--version'],
|
||||
template.components.find((item) => item.id === 'wp-cli')?.version
|
||||
]
|
||||
]
|
||||
for (const [name, command, args, version] of checks) {
|
||||
@@ -40,6 +46,15 @@ for (const [name, command, args, version] of checks) {
|
||||
process.stdout.write(`${name} ${version} OK\n`)
|
||||
}
|
||||
|
||||
const extensions = spawnSync(
|
||||
join(root, 'bin/php'),
|
||||
['-r', "exit(extension_loaded('mysqli') && extension_loaded('pdo_mysql') ? 0 : 1);"],
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
if (extensions.error || extensions.status !== 0)
|
||||
throw extensions.error || new Error(`PHP database extensions failed: ${extensions.stderr}`)
|
||||
process.stdout.write('PHP mysqli and pdo_mysql extensions OK\n')
|
||||
|
||||
const databaseDirectory = mkdtempSync(join(tmpdir(), 'aurora-native-mariadb-'))
|
||||
const temporaryDirectory = mkdtempSync(join(tmpdir(), 'aurora-native-mariadb-tmp-'))
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user