Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 446d4ca

Browse files
committed
wip
1 parent 24289d9 commit 446d4ca

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
lines changed

Diff for: dist/server/php.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ function retrievePhpIniSettings() {
4646
cwd: appPath,
4747
env
4848
};
49-
return yield (0, util_1.promisify)(child_process_1.execFile)(state_1.default.php, ['artisan', 'native:php-ini'], phpOptions);
49+
let command = ['artisan', 'native:php-ini'];
50+
if (runningSecureBuild()) {
51+
command.unshift((0, path_1.join)(appPath, 'build', '__nativephp_app_bundle'));
52+
}
53+
return yield (0, util_1.promisify)(child_process_1.execFile)(state_1.default.php, command, phpOptions);
5054
});
5155
}
5256
exports.retrievePhpIniSettings = retrievePhpIniSettings;
@@ -61,7 +65,11 @@ function retrieveNativePHPConfig() {
6165
cwd: appPath,
6266
env
6367
};
64-
return yield (0, util_1.promisify)(child_process_1.execFile)(state_1.default.php, ['artisan', 'native:config'], phpOptions);
68+
let command = ['artisan', 'native:config'];
69+
if (runningSecureBuild()) {
70+
command.unshift((0, path_1.join)(appPath, 'build', '__nativephp_app_bundle'));
71+
}
72+
return yield (0, util_1.promisify)(child_process_1.execFile)(state_1.default.php, command, phpOptions);
6573
});
6674
}
6775
exports.retrieveNativePHPConfig = retrieveNativePHPConfig;

Diff for: src/server/php.ts

+23-11
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,24 @@ async function getPhpPort() {
2323
}
2424

2525
async function retrievePhpIniSettings() {
26-
const env = {
27-
NATIVEPHP_RUNNING: 'true',
28-
NATIVEPHP_STORAGE_PATH: storagePath,
29-
NATIVEPHP_DATABASE_PATH: databaseFile,
30-
};
26+
const env = {
27+
NATIVEPHP_RUNNING: 'true',
28+
NATIVEPHP_STORAGE_PATH: storagePath,
29+
NATIVEPHP_DATABASE_PATH: databaseFile,
30+
};
3131

32-
const phpOptions = {
33-
cwd: appPath,
34-
env
35-
};
32+
const phpOptions = {
33+
cwd: appPath,
34+
env
35+
};
3636

37-
return await promisify(execFile)(state.php, ['artisan', 'native:php-ini'], phpOptions);
37+
let command = ['artisan', 'native:php-ini'];
38+
39+
if (runningSecureBuild()) {
40+
command.unshift(join(appPath, 'build', '__nativephp_app_bundle'));
41+
}
42+
43+
return await promisify(execFile)(state.php, command, phpOptions);
3844
}
3945

4046
async function retrieveNativePHPConfig() {
@@ -49,7 +55,13 @@ async function retrieveNativePHPConfig() {
4955
env
5056
};
5157

52-
return await promisify(execFile)(state.php, ['artisan', 'native:config'], phpOptions);
58+
let command = ['artisan', 'native:config'];
59+
60+
if (runningSecureBuild()) {
61+
command.unshift(join(appPath, 'build', '__nativephp_app_bundle'));
62+
}
63+
64+
return await promisify(execFile)(state.php, command, phpOptions);
5365
}
5466

5567
function callPhp(args, options, phpIniSettings = {}) {

0 commit comments

Comments
 (0)