Skip to content

Commit 0e88cdb

Browse files
committed
Add shared extension parser
{craft} extensions: bcmath shared-extensions: xdebug,swoole sapi: cli {/craft} [spc_prefix:bin/spc-gnu-docker]
1 parent e5cd3ad commit 0e88cdb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/deps-craft-yml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ build-options:
4242
# Set micro SAPI as win32 mode, without this, micro SAPI will be compiled as a console application (only for Windows, default: false)
4343
enable-micro-win32: false
4444

45-
# Build options for shared extensions (same as `build-shared` command options, all options are optional)
45+
# Build options for shared extensions (list or comma-separated are both accepted)
4646
shared-extensions: [ ]
4747

4848
# Download options

src/SPC/util/ConfigValidator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ public static function validateAndParseCraftFile(mixed $craft_file, Command $com
164164
if (is_string($craft['extensions'])) {
165165
$craft['extensions'] = array_filter(array_map(fn ($x) => trim($x), explode(',', $craft['extensions'])));
166166
}
167+
if (!isset($craft['shared-extensions'])) {
168+
$craft['shared-extensions'] = [];
169+
}
170+
if (is_string($craft['shared-extensions'] ?? [])) {
171+
$craft['shared-extensions'] = array_filter(array_map(fn ($x) => trim($x), explode(',', $craft['shared-extensions'])));
172+
}
167173
// check libs
168174
if (isset($craft['libs']) && is_string($craft['libs'])) {
169175
$craft['libs'] = array_filter(array_map(fn ($x) => trim($x), explode(',', $craft['libs'])));

0 commit comments

Comments
 (0)