Moodle
  1. Moodle
  2. MDL-5653

add blacklisted level into environment XML

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6.3, 1.7
    • Component/s: Administration
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE
    • Rank:
      34112

      Description

      I just ran into problem I can not easily display warning for buggy PHP 5.0.x implementations in Administration/Environment.

      I think we might need some general blacklisting mechanism in environment.xml and environment.php

      Or we could change the XML format to allow multiple version ranges - for example <PHP><VERSION min=4.3.0 max=4.3.99 level=supported /><VERSION min=4.4.0 max=4.99 level=recommended /><VERSION min=5.0.0 max=5.0.99 level=broken />...</PHP>.

      Candidates for blacklisting:

      • PHP 5.0.x (quiz not working)
      • PHP 6.x when it comes, I guess we will need some time to fix BC breakages
      • early versions of MySQL 5

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          From Howard Miller (howard.miller at udcf.gla.ac.uk) Tuesday, 30 May 2006, 11:09 PM:

          I think this is a little more than a feature request. Some aspects of Moodle don't work due to bugs in early versions of PHP5. If this routine doesn't detect these problem versions then there isn't much reason to have it!

          From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 31 May 2006, 01:53 AM:

          Hi Petr,

          currently the XML format supports the specification of this:

          <BYPASS function=bypass_mysql416_reqs message=mysql416bypassed />

          that specifies one function to be executed if the original test result was ok, allowing to bypass such test, showing one warning message, defined in the XML declaration or in the function itself (although it's better to define it in the XML).

          If I'm not wrong, what we need here is something like:

          <RESTRICT function=restrict_php50_version message=php50restricted />

          that should be executed only when the original test has been positive, working exactly like the current BYPASS implementation.

          How does this sound for you?

          From Petr Skoda (skodak at centrum.cz) Wednesday, 31 May 2006, 04:22 AM:

          Eloy, did you mean something like the attached patch?

          From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 31 May 2006, 07:25 AM:

          Hi Petr,

          it's 99% what I was thinking (line by line)!

          Just two comments:

          a) There are some minor typos: resutl instead of result.

          b) I was thinking about having some new str_restricted string to show the status of affected rows, just like str_bypassed to show that, originally, the test was ok, BUT something exceptional is happening....

          I'll take a look to it tomorrow...just going to sleep a bit now....great job!

          Ciao

          From Petr Skoda (skodak at centrum.cz) Wednesday, 31 May 2006, 01:29 PM:

          patch updated with your comments, are we going to push it into 1.6?

          From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 31 May 2006, 03:55 PM:

          (I'll take a look to it this afternoon...)

          +2 for 1.6, and, why not, for 1.5 and HEAD too.

          The only question to decide is to determine if restricted tests must set the global result of the environment to false or no. What if somebody wants to install, ignoring restricted functions status? I can imagine a lot of servers running 5.0.x versions of PHP and we haven't published this req. until now.

          Uhm, perhaps we should add another level to our XML format, calling it CLARIFY or something else that, instead of changing the result->status (like byspass or required) just add some comment (and colour) to the test.... If so, we could just inform to users instead of blocking them....

          yep, nop?

          From Petr Skoda (skodak at centrum.cz) Thursday, 1 June 2006, 01:17 AM:

          ...adding Eloy's patch, IMHO it is ready for inclusion into STABLE

          From Eloy Lafuente (stronk7 at moodle.org) Thursday, 1 June 2006, 07:00 AM:

          Yep, we just need one more vote here....Martin?

          Also I think we should add such code to 1.5, 1.6 and HEAD and document it somewhere in docs.moodle.org because a lot of people could have 5.0.x PHP in their servers, but I really think it's better to prevent them to use Moodle than leaving and having a bad experience/problems...

          Martin?

          From Eloy Lafuente (stronk7 at moodle.org) Saturday, 3 June 2006, 06:18 PM:

          MARTIN !!!!?!!!?

          :-P :-D

          P.S.: Re-note that this will forbid installations under PHP 5.0.x

          From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 7 June 2006, 12:39 AM:

          Oki,

          now the library itself has been added to 1.5, 1.6 and HEAD, so the RESTRICT functionality will be available.

          All we need to do it to update the XML file to enable the PHP 5.0.x test if we want....

          Ciao

          From Eloy Lafuente (stronk7 at moodle.org) Friday, 9 June 2006, 12:59 AM:

          Perhaps we could, at least add such test against 1.7 to prevent users....without being 100% radical for 1.6 ?

          From Eloy Lafuente (stronk7 at moodle.org) Friday, 11 August 2006, 08:34 PM:

          Anything about this? Is it ok to add the 5.0.x prevention for 1.7?

          From Petr Skoda (skodak at centrum.cz) Friday, 11 August 2006, 09:08 PM:

          +1 from me

          Show
          Martin Dougiamas added a comment - From Howard Miller (howard.miller at udcf.gla.ac.uk) Tuesday, 30 May 2006, 11:09 PM: I think this is a little more than a feature request. Some aspects of Moodle don't work due to bugs in early versions of PHP5. If this routine doesn't detect these problem versions then there isn't much reason to have it! From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 31 May 2006, 01:53 AM: Hi Petr, currently the XML format supports the specification of this: <BYPASS function=bypass_mysql416_reqs message=mysql416bypassed /> that specifies one function to be executed if the original test result was ok, allowing to bypass such test, showing one warning message, defined in the XML declaration or in the function itself (although it's better to define it in the XML). If I'm not wrong, what we need here is something like: <RESTRICT function=restrict_php50_version message=php50restricted /> that should be executed only when the original test has been positive, working exactly like the current BYPASS implementation. How does this sound for you? From Petr Skoda (skodak at centrum.cz) Wednesday, 31 May 2006, 04:22 AM: Eloy, did you mean something like the attached patch? From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 31 May 2006, 07:25 AM: Hi Petr, it's 99% what I was thinking (line by line)! Just two comments: a) There are some minor typos: resutl instead of result. b) I was thinking about having some new str_restricted string to show the status of affected rows, just like str_bypassed to show that, originally, the test was ok, BUT something exceptional is happening.... I'll take a look to it tomorrow...just going to sleep a bit now....great job! Ciao From Petr Skoda (skodak at centrum.cz) Wednesday, 31 May 2006, 01:29 PM: patch updated with your comments, are we going to push it into 1.6? From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 31 May 2006, 03:55 PM: (I'll take a look to it this afternoon...) +2 for 1.6, and, why not, for 1.5 and HEAD too. The only question to decide is to determine if restricted tests must set the global result of the environment to false or no. What if somebody wants to install, ignoring restricted functions status? I can imagine a lot of servers running 5.0.x versions of PHP and we haven't published this req. until now. Uhm, perhaps we should add another level to our XML format, calling it CLARIFY or something else that, instead of changing the result->status (like byspass or required) just add some comment (and colour) to the test.... If so, we could just inform to users instead of blocking them.... yep, nop? From Petr Skoda (skodak at centrum.cz) Thursday, 1 June 2006, 01:17 AM: ...adding Eloy's patch, IMHO it is ready for inclusion into STABLE From Eloy Lafuente (stronk7 at moodle.org) Thursday, 1 June 2006, 07:00 AM: Yep, we just need one more vote here....Martin? Also I think we should add such code to 1.5, 1.6 and HEAD and document it somewhere in docs.moodle.org because a lot of people could have 5.0.x PHP in their servers, but I really think it's better to prevent them to use Moodle than leaving and having a bad experience/problems... Martin? From Eloy Lafuente (stronk7 at moodle.org) Saturday, 3 June 2006, 06:18 PM: MARTIN !!!!? !!! ? :-P :-D P.S.: Re-note that this will forbid installations under PHP 5.0.x From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 7 June 2006, 12:39 AM: Oki, now the library itself has been added to 1.5, 1.6 and HEAD, so the RESTRICT functionality will be available. All we need to do it to update the XML file to enable the PHP 5.0.x test if we want.... Ciao From Eloy Lafuente (stronk7 at moodle.org) Friday, 9 June 2006, 12:59 AM: Perhaps we could, at least add such test against 1.7 to prevent users....without being 100% radical for 1.6 ? From Eloy Lafuente (stronk7 at moodle.org) Friday, 11 August 2006, 08:34 PM: Anything about this? Is it ok to add the 5.0.x prevention for 1.7? From Petr Skoda (skodak at centrum.cz) Friday, 11 August 2006, 09:08 PM: +1 from me
          Hide
          Martin Dougiamas added a comment -

          Yep +1 from me! Death to PHP 5.0.x!

          Show
          Martin Dougiamas added a comment - Yep +1 from me! Death to PHP 5.0.x!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          In CVS now.

          All Moodle 1.5, 1.6 and 1.7 have the PHP 5.0.x check included when looking for Moodle 1.7 reqs.

          Show
          Eloy Lafuente (stronk7) added a comment - In CVS now. All Moodle 1.5, 1.6 and 1.7 have the PHP 5.0.x check included when looking for Moodle 1.7 reqs.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: