Can I define the minimum php version for my module in my .info.yml file?

drupal.stackexchange https://drupal.stackexchange.com/questions/235283

  •  29-12-2020
  •  | 
  •  

سؤال

I need to define the minimum PHP version in my module.info.yml file but I don't know if this is posible using:

php: 5.6

If you search about this in the drupal.org documentation you will only see the reference about this in the theme.info.yml file: Defining a theme with an .info.yml file

php (optional)

The minimum version of PHP required. Defaults to value of DRUPAL_MINIMUM_PHP constant.

php: 5.5.9

But in the documentation about the module.info.yml file there is nothing about the php version: Let Drupal 8 know about your module with an .info.yml file.

So, really I can't define the minimum php version in my module.info.yml file?

هل كانت مفيدة؟

المحلول

Sometimes the answer to a question is best found by trying. If you add php: 8.0 to your module.info.yml file you will see this:

incompatible module

So it can still be used. (I have updated the linked documentation as well.)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى drupal.stackexchange
scroll top