Closed QuingKhaos closed 7 years ago
This seems like a weird use-case for this library. What I could do is exposing the constant being generated (unsure if I want to keep BC compliance there though), and then you'd be on your own.
Still, I believe that you should try something different for your embed/embed
dependency:
EmbedAdapter
, provided by a secondary package of yours, optionally installed, requiring embed/embed:^3
"conflict": {"embed/embed": "<3 || >=4"}
, then use class_exists()
The constant being generated is already exposed because default visibility is public. But I assume it's nothing of the public API, especially it won't be available, when --no-scripts
was called and it falls back to the FallbackVersions
.
Maybe I overestimated the use cases of the lib and the class_exists()
check is the way to go in my use case :blush:
Closed as invalid
Use Case: Check if a dependency isn't installed at all and if it is installed check the version constraint.
Scenario: Having optional code, which should be only executed if a given dependency is installed and at the right version. Currently doing the following:
Either a new
hasDependency()
or a new$throw
parameter could work. Don't know which is better for the public API. A$throw
parameter wouldn't cause an extra call. With it my code would look like this: