Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-73269

Add PHP version and required/optional extensions to composer.json

    XMLWordPrintable

Details

    Description

      There are a few changes that could be done in composer.json file to improve following:

      1. let PhpStorm and other tools know what PHP version Moodle supports - at the moment you need to configure them manually
      2. let PhpStorm and other tools know what PHP extensions are required - at the moment PhpStorm shows warnings (for example any json_encode call)
      3. admins/developers cannot find Moodle requirements easily, they have to read environment XML file
      4. Moodle developer running "composer update" to create composer.local needs to be using lowest support PHP version

      Solution is to:

      • add PHP version requirement to composer.json
      • add optional and required PHP extensions to composer.json
      • add platform setting to composer to get composer.lock file for all PHP binaries

      Benefits:

      1. PhpStorm can show unavailable PHP syntax based on PHP versions required by Moodle
      2. PhpStorm does not show warnings about missing PHP extensions
      3. Developers are notified about missing PHP extensions and unsupported PHP versions when they init behat or phpunit
      4. Moodle developers can use any PHP version when building composer.lock

      Attachments

        1. MDL-73269_v39.png
          MDL-73269_v39.png
          188 kB
        2. MDL-73269_v311.webm
          1.35 MB
        3. MDL-73269_v310.png
          MDL-73269_v310.png
          195 kB
        4. MDL-73269_master.webm
          1.17 MB

        Issue Links

          Activity

            People

              skodak Petr Skoda
              skodak Petr Skoda
              Andrew Lyons Andrew Lyons
              Victor Déniz Falcón Victor Déniz Falcón
              Angelia Dela Cruz Angelia Dela Cruz
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/Jan/22

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 55 minutes
                  1h 55m