will talk for elePHPants! on Nostr: Hey #PHP friends. My websearch-foo is failing me and perhaps someone knows an answer: ...
Hey #PHP friends. My websearch-foo is failing me and perhaps someone knows an answer:
With composer it is right now possible to only install a package when a certain extension is available by setting
{
require: {
ext-foo: "*"
}
}
Is there a way to do the opposite? Install a package only when a certain extension is **not** available?
I was so far not able to find anything in that direction...
Background are polyfills that should **only** be installed when an extension is missing...
Published at
2025-04-30 05:04:28Event JSON
{
"id": "9fbd36a7b3c043a154c47c3c53d010415e320fe015a6df30832f0f868f4cceb9",
"pubkey": "8c52c16ae7ee1b5a9084c52cfd4bf9f8c667265966f168e176cea433814c95a9",
"created_at": 1745989468,
"kind": 1,
"tags": [
[
"t",
"php"
],
[
"proxy",
"https://phpc.social/users/heiglandreas/statuses/114425165830439540",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.mostr.pub"
]
],
"content": "Hey #PHP friends. My websearch-foo is failing me and perhaps someone knows an answer:\n\nWith composer it is right now possible to only install a package when a certain extension is available by setting \n\n{\n require: {\n ext-foo: \"*\"\n }\n}\n\nIs there a way to do the opposite? Install a package only when a certain extension is **not** available?\n\nI was so far not able to find anything in that direction...\n\nBackground are polyfills that should **only** be installed when an extension is missing...",
"sig": "08c6b76dbe6d87b500ebef3e7d81708afa10a25fc46d2276a1f1c7ad4edac5f8813fd30ac4d5eb9c0f0b781eeb317c78045a32cca536c5d7d25f1600dc2036fd"
}