File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,6 +61,28 @@ public function getExtensionName(): string
6161 return str_replace ('ext- ' , '' , $ this ->getName ());
6262 }
6363
64+ /**
65+ * Get the list of OS platforms that this extension supports.
66+ * Returns an empty array if no restriction is defined (all platforms supported).
67+ */
68+ public function getSupportedOSList (): array
69+ {
70+ return $ this ->extension_config ['os ' ] ?? [];
71+ }
72+
73+ /**
74+ * Check if this extension is supported on the current target OS.
75+ * Returns true if no 'os' restriction is defined, or if the current OS is in the list.
76+ */
77+ public function isSupportedOnCurrentOS (): bool
78+ {
79+ $ osList = $ this ->getSupportedOSList ();
80+ if (empty ($ osList )) {
81+ return true ;
82+ }
83+ return in_array (SystemTarget::getTargetOS (), $ osList , true );
84+ }
85+
6486 public function addCustomPhpConfigureArgCallback (string $ os , callable $ fn ): void
6587 {
6688 if ($ os === '' ) {
You can’t perform that action at this time.
0 commit comments