How to define the required operating system in the Composer?

Asked

Viewed 25 times

0

I built a PHP package for deployment via Composer, but this only works on Windows machines. In Composer.json it is possible to specify this restriction?

  • 1

    I believe it is not possible, as far as I know Composer is used for package management not to define which OS is required, I will still search about.

  • It is not possible to determine such a requirement in Composer, since Composer is a dependency manager, the maximum would be to specify a version of PHP and its extensions.

1 answer

0

Researching found nothing to limit installation on machines with SO’s incompatible. But I find it strange a package that only serves in one ONLY since the PHP is an interpreted and not compiled language.

But I believe it is impossible to make such a limitation, since the Composer serves to manage dependencies, I believe the most you can do is set a version for the PHP, since the Composer is a package manager PHP.

  • 1

    My package makes use of dotnet library for COM connection. Therefore it presents incompatibility on non-windows systems. See: https://packagist.org/packages/crphp/wmi

  • I understood, but unfortunately it is not possible to define the obligation of Windows with Composer.:/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.