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

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

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
    • MDL-73269/master
    • Hide
      1. initialise phpunit on supported platform and test it works as before
      2. attempt to "composer install" on unsupported platform (missing required extension or wrong PHP version) and confirm the composer gives correct error message
      3. confirm that composer suggests missing optional extensions (such as sqlsrv or oracle extension)
      4. run "composer validate" to make sure the lock file is valid
      Show
      initialise phpunit on supported platform and test it works as before attempt to "composer install" on unsupported platform (missing required extension or wrong PHP version) and confirm the composer gives correct error message confirm that composer suggests missing optional extensions (such as sqlsrv or oracle extension) run "composer validate" to make sure the lock file is valid

      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

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

            skodak Petr Skoda (Inactive)
            skodak Petr Skoda (Inactive)
            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

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.